-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[core] Import esm babel helpers #16701
Conversation
In this diff I changed babel helpers imports to esm versions for esm/es/umd bundles. For example ``` @babel/runtime/helpers/extends -> @babel/runtime/helpers/esm/extends ```
@material-ui/core: parsed: +0.72% , gzip: -0.01% 😍 Details of bundle changes.Comparing: 29a61df...9a48ae7
|
It seems to product the same result than last time. No? |
I really don't understand what's wrong with size snapshot script. Is it possible result is cached by branch name? My manual testing shows this 58040 -> 56949 for minified bundle Here's not minified diffindex d0531b7ce..63cc37f77 100644
--- a/main0.js
+++ b/main.js
@@ -81,68 +81,17 @@
/******/
/******/
/******/ // Load entry module and return exports
-/******/ return __webpack_require__(__webpack_require__.s = 16);
+/******/ return __webpack_require__(__webpack_require__.s = 11);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports) {
-function _extends() {
- module.exports = _extends = Object.assign || function (target) {
- for (var i = 1; i < arguments.length; i++) {
- var source = arguments[i];
-
- for (var key in source) {
- if (Object.prototype.hasOwnProperty.call(source, key)) {
- target[key] = source[key];
- }
- }
- }
-
- return target;
- };
-
- return _extends.apply(this, arguments);
-}
-
-module.exports = _extends;
-
-/***/ }),
-/* 1 */
-/***/ (function(module, exports) {
-
module.exports = react;
/***/ }),
-/* 2 */
-/***/ (function(module, exports, __webpack_require__) {
-
-var objectWithoutPropertiesLoose = __webpack_require__(10);
-
-function _objectWithoutProperties(source, excluded) {
- if (source == null) return {};
- var target = objectWithoutPropertiesLoose(source, excluded);
- var key, i;
-
- if (Object.getOwnPropertySymbols) {
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
-
- for (i = 0; i < sourceSymbolKeys.length; i++) {
- key = sourceSymbolKeys[i];
- if (excluded.indexOf(key) >= 0) continue;
- if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
- target[key] = source[key];
- }
- }
-
- return target;
-}
-
-module.exports = _objectWithoutProperties;
-
-/***/ }),
-/* 3 */
+/* 1 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -211,7 +160,7 @@ module.exports = warning;
/***/ }),
-/* 4 */
+/* 2 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -329,28 +278,7 @@ module.exports = deepmerge_1;
/***/ }),
-/* 5 */
-/***/ (function(module, exports) {
-
-function _defineProperty(obj, key, value) {
- if (key in obj) {
- Object.defineProperty(obj, key, {
- value: value,
- enumerable: true,
- configurable: true,
- writable: true
- });
- } else {
- obj[key] = value;
- }
-
- return obj;
-}
-
-module.exports = _defineProperty;
-
-/***/ }),
-/* 6 */
+/* 3 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -363,13 +291,13 @@ module.exports = _defineProperty;
if (false) { var throwOnDirectAccess, ReactIs; } else {
// By explicitly using `prop-types` you are opting into new production behavior.
// http://fb.me/prop-types-in-prod
- module.exports = __webpack_require__(11)();
+ module.exports = __webpack_require__(7)();
}
/***/ }),
-/* 7 */,
-/* 8 */
+/* 4 */,
+/* 5 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -379,7 +307,7 @@ if (false) { var throwOnDirectAccess, ReactIs; } else {
* Copyright 2015, Yahoo! Inc.
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
*/
-var ReactIs = __webpack_require__(13);
+var ReactIs = __webpack_require__(9);
var REACT_STATICS = {
childContextTypes: true,
contextType: true,
@@ -479,29 +407,8 @@ module.exports = hoistNonReactStatics;
/***/ }),
-/* 9 */,
-/* 10 */
-/***/ (function(module, exports) {
-
-function _objectWithoutPropertiesLoose(source, excluded) {
- if (source == null) return {};
- var target = {};
- var sourceKeys = Object.keys(source);
- var key, i;
-
- for (i = 0; i < sourceKeys.length; i++) {
- key = sourceKeys[i];
- if (excluded.indexOf(key) >= 0) continue;
- target[key] = source[key];
- }
-
- return target;
-}
-
-module.exports = _objectWithoutPropertiesLoose;
-
-/***/ }),
-/* 11 */
+/* 6 */,
+/* 7 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -514,7 +421,7 @@ module.exports = _objectWithoutPropertiesLoose;
-var ReactPropTypesSecret = __webpack_require__(12);
+var ReactPropTypesSecret = __webpack_require__(8);
function emptyFunction() {}
function emptyFunctionWithReset() {}
@@ -572,7 +479,7 @@ module.exports = function() {
/***/ }),
-/* 12 */
+/* 8 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -591,19 +498,19 @@ module.exports = ReactPropTypesSecret;
/***/ }),
-/* 13 */
+/* 9 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
if (true) {
- module.exports = __webpack_require__(14);
+ module.exports = __webpack_require__(10);
} else {}
/***/ }),
-/* 14 */
+/* 10 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -625,48 +532,71 @@ exports.isSuspense=function(a){return t(a)===p};
/***/ }),
-/* 15 */
-/***/ (function(module, exports) {
+/* 11 */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
-function _typeof2(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof2(obj); }
+"use strict";
+__webpack_require__.r(__webpack_exports__);
-function _typeof(obj) {
- if (typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol") {
- module.exports = _typeof = function _typeof(obj) {
- return _typeof2(obj);
- };
- } else {
- module.exports = _typeof = function _typeof(obj) {
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : _typeof2(obj);
- };
+// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
+function _objectWithoutPropertiesLoose(source, excluded) {
+ if (source == null) return {};
+ var target = {};
+ var sourceKeys = Object.keys(source);
+ var key, i;
+
+ for (i = 0; i < sourceKeys.length; i++) {
+ key = sourceKeys[i];
+ if (excluded.indexOf(key) >= 0) continue;
+ target[key] = source[key];
}
- return _typeof(obj);
+ return target;
}
+// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js
-module.exports = _typeof;
+function _objectWithoutProperties(source, excluded) {
+ if (source == null) return {};
+ var target = _objectWithoutPropertiesLoose(source, excluded);
+ var key, i;
-/***/ }),
-/* 16 */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ if (Object.getOwnPropertySymbols) {
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
-"use strict";
-__webpack_require__.r(__webpack_exports__);
+ for (i = 0; i < sourceSymbolKeys.length; i++) {
+ key = sourceSymbolKeys[i];
+ if (excluded.indexOf(key) >= 0) continue;
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
+ target[key] = source[key];
+ }
+ }
-// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/objectWithoutProperties.js
-var objectWithoutProperties = __webpack_require__(2);
-var objectWithoutProperties_default = /*#__PURE__*/__webpack_require__.n(objectWithoutProperties);
+ return target;
+}
+// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
+function _extends() {
+ _extends = Object.assign || function (target) {
+ for (var i = 1; i < arguments.length; i++) {
+ var source = arguments[i];
+
+ for (var key in source) {
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
+ target[key] = source[key];
+ }
+ }
+ }
-// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/extends.js
-var helpers_extends = __webpack_require__(0);
-var extends_default = /*#__PURE__*/__webpack_require__.n(helpers_extends);
+ return target;
+ };
+ return _extends.apply(this, arguments);
+}
// EXTERNAL MODULE: external "react"
-var external_react_ = __webpack_require__(1);
+var external_react_ = __webpack_require__(0);
var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
// EXTERNAL MODULE: ./node_modules/prop-types/index.js
-var prop_types = __webpack_require__(6);
+var prop_types = __webpack_require__(3);
// CONCATENATED MODULE: ./node_modules/clsx/dist/clsx.m.js
function toVal(mix) {
@@ -708,30 +638,12 @@ function toVal(mix) {
});
// EXTERNAL MODULE: ./node_modules/warning/warning.js
-var warning = __webpack_require__(3);
+var warning = __webpack_require__(1);
// EXTERNAL MODULE: ./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js
-var hoist_non_react_statics_cjs = __webpack_require__(8);
+var hoist_non_react_statics_cjs = __webpack_require__(5);
var hoist_non_react_statics_cjs_default = /*#__PURE__*/__webpack_require__.n(hoist_non_react_statics_cjs);
-// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
-function _extends() {
- _extends = Object.assign || function (target) {
- for (var i = 1; i < arguments.length; i++) {
- var source = arguments[i];
-
- for (var key in source) {
- if (Object.prototype.hasOwnProperty.call(source, key)) {
- target[key] = source[key];
- }
- }
- }
-
- return target;
- };
-
- return _extends.apply(this, arguments);
-}
// CONCATENATED MODULE: ./node_modules/is-in-browser/dist/module.js
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
@@ -791,21 +703,6 @@ function _assertThisInitialized(self) {
return self;
}
-// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
-function _objectWithoutPropertiesLoose(source, excluded) {
- if (source == null) return {};
- var target = {};
- var sourceKeys = Object.keys(source);
- var key, i;
-
- for (i = 0; i < sourceKeys.length; i++) {
- key = sourceKeys[i];
- if (excluded.indexOf(key) >= 0) continue;
- target[key] = source[key];
- }
-
- return target;
-}
// CONCATENATED MODULE: ./node_modules/jss/dist/jss.esm.js
@@ -3011,7 +2908,7 @@ function mergeClasses() {
return baseClasses;
}
- var nextClasses = extends_default()({}, baseClasses);
+ var nextClasses = _extends({}, baseClasses);
if (false) {}
@@ -4502,11 +4399,11 @@ function StylesProvider(props) {
injectFirst = _props$injectFirst === void 0 ? false : _props$injectFirst,
_props$disableGenerat = props.disableGeneration,
disableGeneration = _props$disableGenerat === void 0 ? false : _props$disableGenerat,
- localOptions = objectWithoutProperties_default()(props, ["children", "injectFirst", "disableGeneration"]);
+ localOptions = _objectWithoutProperties(props, ["children", "injectFirst", "disableGeneration"]);
var outerOptions = external_react_default.a.useContext(StylesContext);
- var context = extends_default()({}, outerOptions, {
+ var context = _extends({}, outerOptions, {
disableGeneration: disableGeneration
}, localOptions);
@@ -4554,11 +4451,24 @@ function increment() {
false ? undefined : void 0;
return indexCounter;
}
-// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/typeof.js
-var helpers_typeof = __webpack_require__(15);
+// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js
+function _typeof2(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof2(obj); }
+function typeof_typeof(obj) {
+ if (typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol") {
+ typeof_typeof = function _typeof(obj) {
+ return _typeof2(obj);
+ };
+ } else {
+ typeof_typeof = function _typeof(obj) {
+ return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : _typeof2(obj);
+ };
+ }
+
+ return typeof_typeof(obj);
+}
// EXTERNAL MODULE: ./node_modules/deepmerge/dist/cjs.js
-var cjs = __webpack_require__(4);
+var cjs = __webpack_require__(2);
var cjs_default = /*#__PURE__*/__webpack_require__.n(cjs);
// CONCATENATED MODULE: ./packages/material-ui-styles/build/esm/getStylesCreator/getStylesCreator.js
@@ -4593,7 +4503,7 @@ function getStylesCreator(stylesOrCreator) {
var overrides = theme.overrides[name];
- var stylesWithOverrides = extends_default()({}, styles);
+ var stylesWithOverrides = _extends({}, styles);
Object.keys(overrides).forEach(function (key) {
false ? undefined : void 0;
@@ -4693,7 +4603,7 @@ function attach(_ref2, props) {
makeStyles_multiKeyStore.set(stylesOptions.sheetsManager, stylesCreator, theme, sheetManager);
}
- var options = extends_default()({}, stylesCreator.options, stylesOptions, {
+ var options = _extends({}, stylesCreator.options, stylesOptions, {
theme: theme,
flip: typeof stylesOptions.flip === 'boolean' ? stylesOptions.flip : theme.direction === 'rtl'
});
@@ -4711,7 +4621,7 @@ function attach(_ref2, props) {
var styles = stylesCreator.create(theme, name);
if (!staticSheet) {
- staticSheet = stylesOptions.jss.createStyleSheet(styles, extends_default()({
+ staticSheet = stylesOptions.jss.createStyleSheet(styles, _extends({
link: false
}, options));
staticSheet.attach();
@@ -4730,7 +4640,7 @@ function attach(_ref2, props) {
}
if (sheetManager.dynamicStyles) {
- var dynamicSheet = stylesOptions.jss.createStyleSheet(sheetManager.dynamicStyles, extends_default()({
+ var dynamicSheet = stylesOptions.jss.createStyleSheet(sheetManager.dynamicStyles, _extends({
link: true
}, options));
false ? undefined : void 0;
@@ -4823,7 +4733,7 @@ function makeStyles(stylesOrCreator) {
Component = options.Component,
_options$defaultTheme = options.defaultTheme,
defaultTheme = _options$defaultTheme === void 0 ? getStylesCreator_noopTheme : _options$defaultTheme,
- stylesOptions2 = objectWithoutProperties_default()(options, ["name", "classNamePrefix", "Component", "defaultTheme"]);
+ stylesOptions2 = _objectWithoutProperties(options, ["name", "classNamePrefix", "Component", "defaultTheme"]);
var stylesCreator = getStylesCreator_getStylesCreator(stylesOrCreator);
var classNamePrefix = name || classNamePrefixOption || 'makeStyles';
@@ -4838,7 +4748,7 @@ function makeStyles(stylesOrCreator) {
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var theme = (listenToTheme ? useTheme() : null) || defaultTheme;
- var stylesOptions = extends_default()({}, external_react_default.a.useContext(StylesContext), stylesOptions2);
+ var stylesOptions = _extends({}, external_react_default.a.useContext(StylesContext), stylesOptions2);
var instance = external_react_default.a.useRef();
var shouldUpdate = external_react_default.a.useRef();
@@ -4915,7 +4825,7 @@ var withStyles_withStyles = function withStyles(stylesOrCreator) {
_options$withTheme = options.withTheme,
withTheme = _options$withTheme === void 0 ? false : _options$withTheme,
name = options.name,
- stylesOptions = objectWithoutProperties_default()(options, ["defaultTheme", "withTheme", "name"]);
+ stylesOptions = _objectWithoutProperties(options, ["defaultTheme", "withTheme", "name"]);
if (false) {}
@@ -4923,7 +4833,7 @@ var withStyles_withStyles = function withStyles(stylesOrCreator) {
if (false) { var displayName; }
- var useStyles = makeStyles_makeStyles(stylesOrCreator, extends_default()({
+ var useStyles = makeStyles_makeStyles(stylesOrCreator, _extends({
defaultTheme: defaultTheme,
Component: Component,
name: name || Component.displayName,
@@ -4932,7 +4842,7 @@ var withStyles_withStyles = function withStyles(stylesOrCreator) {
var WithStyles = external_react_default.a.forwardRef(function WithStyles(props, ref) {
var classesProp = props.classes,
innerRef = props.innerRef,
- other = objectWithoutProperties_default()(props, ["classes", "innerRef"]);
+ other = _objectWithoutProperties(props, ["classes", "innerRef"]);
var classes = useStyles(props);
var theme;
@@ -4958,7 +4868,7 @@ var withStyles_withStyles = function withStyles(stylesOrCreator) {
}
}
- return external_react_default.a.createElement(Component, extends_default()({
+ return external_react_default.a.createElement(Component, _extends({
ref: innerRef || ref,
classes: classes
}, more));
@@ -4976,10 +4886,21 @@ var withStyles_withStyles = function withStyles(stylesOrCreator) {
};
/* harmony default export */ var esm_withStyles_withStyles = (withStyles_withStyles);
-// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/defineProperty.js
-var defineProperty = __webpack_require__(5);
-var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty);
+// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
+function _defineProperty(obj, key, value) {
+ if (key in obj) {
+ Object.defineProperty(obj, key, {
+ value: value,
+ enumerable: true,
+ configurable: true,
+ writable: true
+ });
+ } else {
+ obj[key] = value;
+ }
+ return obj;
+}
// CONCATENATED MODULE: ./packages/material-ui/node_modules/isobject/index.js
/*!
* isobject <https://github.com/jonschlinkert/isobject>
@@ -5049,7 +4970,7 @@ function createBreakpoints(breakpoints) {
unit = _breakpoints$unit === void 0 ? 'px' : _breakpoints$unit,
_breakpoints$step = breakpoints.step,
step = _breakpoints$step === void 0 ? 5 : _breakpoints$step,
- other = objectWithoutProperties_default()(breakpoints, ["values", "unit", "step"]);
+ other = _objectWithoutProperties(breakpoints, ["values", "unit", "step"]);
function up(key) {
var value = typeof values[key] === 'number' ? values[key] : key;
@@ -5087,7 +5008,7 @@ function createBreakpoints(breakpoints) {
return values[key];
}
- return extends_default()({
+ return _extends({
keys: keys,
values: values,
up: up,
@@ -5104,7 +5025,7 @@ function createBreakpoints(breakpoints) {
function createMixins(breakpoints, spacing, mixins) {
var _toolbar;
- return extends_default()({
+ return _extends({
gutters: function gutters() {
var styles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
// To deprecate in v4.1
@@ -5123,19 +5044,19 @@ function createMixins(breakpoints, spacing, mixins) {
// `,
// ].join('\n'),
// );
- return extends_default()({
+ return _extends({
paddingLeft: spacing(2),
paddingRight: spacing(2)
- }, styles, defineProperty_default()({}, breakpoints.up('sm'), extends_default()({
+ }, styles, _defineProperty({}, breakpoints.up('sm'), _extends({
paddingLeft: spacing(3),
paddingRight: spacing(3)
}, styles[breakpoints.up('sm')])));
},
toolbar: (_toolbar = {
minHeight: 56
- }, defineProperty_default()(_toolbar, "".concat(breakpoints.up('xs'), " and (orientation: landscape)"), {
+ }, _defineProperty(_toolbar, "".concat(breakpoints.up('xs'), " and (orientation: landscape)"), {
minHeight: 48
- }), defineProperty_default()(_toolbar, breakpoints.up('sm'), {
+ }), _defineProperty(_toolbar, breakpoints.up('sm'), {
minHeight: 64
}), _toolbar)
}, mixins);
@@ -5608,7 +5529,7 @@ function createPalette(palette) {
contrastThreshold = _palette$contrastThre === void 0 ? 3 : _palette$contrastThre,
_palette$tonalOffset = palette.tonalOffset,
tonalOffset = _palette$tonalOffset === void 0 ? 0.2 : _palette$tonalOffset,
- other = objectWithoutProperties_default()(palette, ["primary", "secondary", "error", "type", "contrastThreshold", "tonalOffset"]); // Use the same logic as
+ other = _objectWithoutProperties(palette, ["primary", "secondary", "error", "type", "contrastThreshold", "tonalOffset"]); // Use the same logic as
// Bootstrap: https://github.com/twbs/bootstrap/blob/1d6e3710dd447de1a200f29e8fa521f8a0908f70/scss/_functions.scss#L59
// and material-components-web https://github.com/material-components/material-components-web/blob/ac46b8863c4dab9fc22c4c662dc6bd1b65dd652f/packages/mdc-theme/_functions.scss#L54
@@ -5626,7 +5547,7 @@ function createPalette(palette) {
var mainShade = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;
var lightShade = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 300;
var darkShade = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 700;
- color = extends_default()({}, color);
+ color = _extends({}, color);
if (!color.main && color[mainShade]) {
color.main = color[mainShade];
@@ -5649,7 +5570,7 @@ function createPalette(palette) {
light: light
};
false ? undefined : void 0;
- var paletteOutput = cjs_default()(extends_default()({
+ var paletteOutput = cjs_default()(_extends({
// A collection of common colors.
common: colors_common,
// The palette type, can be light or dark.
@@ -5716,7 +5637,7 @@ function createTypography(palette, typography) {
_ref$htmlFontSize = _ref.htmlFontSize,
htmlFontSize = _ref$htmlFontSize === void 0 ? 16 : _ref$htmlFontSize,
allVariants = _ref.allVariants,
- other = objectWithoutProperties_default()(_ref, ["fontFamily", "fontSize", "fontWeightLight", "fontWeightRegular", "fontWeightMedium", "fontWeightBold", "htmlFontSize", "allVariants"]);
+ other = _objectWithoutProperties(_ref, ["fontFamily", "fontSize", "fontWeightLight", "fontWeightRegular", "fontWeightMedium", "fontWeightBold", "htmlFontSize", "allVariants"]);
false ? undefined : void 0;
false ? undefined : void 0;
@@ -5727,7 +5648,7 @@ function createTypography(palette, typography) {
};
var buildVariant = function buildVariant(fontWeight, size, lineHeight, letterSpacing, casing) {
- return extends_default()({
+ return _extends({
fontFamily: fontFamily,
fontWeight: fontWeight,
fontSize: pxToRem(size),
@@ -5753,7 +5674,7 @@ function createTypography(palette, typography) {
caption: buildVariant(fontWeightRegular, 12, 1.66, 0.4),
overline: buildVariant(fontWeightRegular, 12, 2.66, 1, caseAllCaps)
};
- return cjs_default()(extends_default()({
+ return cjs_default()(_extends({
htmlFontSize: htmlFontSize,
pxToRem: pxToRem,
round: round,
@@ -5906,7 +5827,7 @@ var isNumber = function isNumber(value) {
easingOption = _options$easing === void 0 ? easing.easeInOut : _options$easing,
_options$delay = options.delay,
delay = _options$delay === void 0 ? 0 : _options$delay,
- other = objectWithoutProperties_default()(options, ["duration", "easing", "delay"]);
+ other = _objectWithoutProperties(options, ["duration", "easing", "delay"]);
false ? undefined : void 0;
false ? undefined : void 0;
@@ -5970,13 +5891,13 @@ function createMuiTheme() {
spacingInput = options.spacing,
_options$typography = options.typography,
typographyInput = _options$typography === void 0 ? {} : _options$typography,
- other = objectWithoutProperties_default()(options, ["breakpoints", "mixins", "palette", "shadows", "spacing", "typography"]);
+ other = _objectWithoutProperties(options, ["breakpoints", "mixins", "palette", "shadows", "spacing", "typography"]);
var palette = createPalette(paletteInput);
var breakpoints = createBreakpoints(breakpointsInput);
var spacing = createSpacing(spacingInput);
- var muiTheme = extends_default()({
+ var muiTheme = _extends({
breakpoints: breakpoints,
direction: 'ltr',
mixins: createMixins(breakpoints, spacing, mixinsInput),
@@ -6013,7 +5934,7 @@ var defaultTheme_defaultTheme = styles_createMuiTheme();
function styles_withStyles_withStyles(stylesOrCreator, options) {
- return esm_withStyles_withStyles(stylesOrCreator, extends_default()({
+ return esm_withStyles_withStyles(stylesOrCreator, _extends({
defaultTheme: styles_defaultTheme
}, options));
}
@@ -6034,7 +5955,7 @@ var Paper_styles = function styles(theme) {
boxShadow: shadow
};
});
- return extends_default()({
+ return _extends({
/* Styles applied to the root element. */
root: {
backgroundColor: theme.palette.background.paper,
@@ -6057,11 +5978,11 @@ var Paper_Paper = external_react_default.a.forwardRef(function Paper(props, ref)
square = _props$square === void 0 ? false : _props$square,
_props$elevation = props.elevation,
elevation = _props$elevation === void 0 ? 1 : _props$elevation,
- other = objectWithoutProperties_default()(props, ["classes", "className", "component", "square", "elevation"]);
+ other = _objectWithoutProperties(props, ["classes", "className", "component", "square", "elevation"]);
false ? undefined : void 0;
var className = clsx_m(classes.root, classes["elevation".concat(elevation)], classNameProp, !square && classes.rounded);
- return external_react_default.a.createElement(Component, extends_default()({
+ return external_react_default.a.createElement(Component, _extends({
className: className,
ref: ref
}, other));
|
Webpack seems to not like the change. Umd bundle is strictly smaller. |
This is config I used to test size const path = require('path');
const workspaceRoot = process.cwd()
module.exports = {
entry: './packages/material-ui/build/esm/Paper',
// ideally this would be computed from the bundles peer dependencies
externals: /^(react|react-dom)$/,
mode: 'production',
resolve: {
alias: {
'@material-ui/core': path.join(workspaceRoot, 'packages/material-ui/build'),
'@material-ui/lab': path.join(workspaceRoot, 'packages/material-ui-lab/build'),
'@material-ui/styles': path.join(workspaceRoot, 'packages/material-ui-styles/build'),
'@material-ui/system': path.join(workspaceRoot, 'packages/material-ui-system/build'),
'@material-ui/utils': path.join(workspaceRoot, 'packages/material-ui-utils/build'),
},
},
}; |
Not sure what happened there for you. Did you run every step before creating the snapshot? merge-base shows "@material-ui/core/Paper.esm": {
"parsed": 61960,
"gzip": 19210
}, Seems right. Will check out locally. Aside: TODO: save the size snapshot in azure artifacts |
I ran yarn build for all packages before running webpack |
You didn't use Should probably overhaul this and remove the entries from nextjs (they should already be compiled so no need to use it as an entry) and either put the commonJS build of Paper in a different config or just remove it. |
Yeah can reproduce your result with a single entry but not with multiple entries. Our azure pipeline has the stats.json output from webpack. You could put that in a bundle analyser and check what's causing this. |
Or maybe put each entry into own config? This will give true size. |
It will give the isolated size which will unlikely ever be observable in actual bundles. We're trading isolation for more integrated and faster tests. |
Did I prove this worth merging? |
I find this change interesting:
The usage of the option seems to match: https://babeljs.io/docs/en/babel-plugin-transform-runtime#useesmodules. From my part, I have no objection. @eps1lon? |
Yeah. I'd say even if this produces some duplication the burden is on the packages using commonJS to improve. |
Yes, we did our best to fix all these issues in material-ui and friends. |
In this diff I changed babel helpers imports to esm versions for
esm/es/umd bundles. For example