Skip to content

Commit

Permalink
Remove object-assign polyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon committed Jul 26, 2017
1 parent 6606511 commit c7355fa
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 106 deletions.
3 changes: 1 addition & 2 deletions packages/react-art/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
"homepage": "https://facebook.github.io/react/",
"dependencies": {
"fbjs": "^0.8.9",
"loose-envify": "^1.1.0",
"object-assign": "^4.1.0"
"loose-envify": "^1.1.0"
},
"peerDependencies": {
"react": "^16.0.0-alpha.13"
Expand Down
1 change: 0 additions & 1 deletion packages/react-dom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"dependencies": {
"fbjs": "^0.8.9",
"loose-envify": "^1.1.0",
"object-assign": "^4.1.0",
"prop-types": "^15.5.6"
},
"peerDependencies": {
Expand Down
3 changes: 1 addition & 2 deletions packages/react-noop-renderer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
"repository": "facebook/react",
"license": "BSD-3-Clause",
"dependencies": {
"fbjs": "^0.8.9",
"object-assign": "^4.1.0"
"fbjs": "^0.8.9"
},
"files": [
"LICENSE",
Expand Down
3 changes: 1 addition & 2 deletions packages/react-test-renderer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
},
"homepage": "https://facebook.github.io/react/",
"dependencies": {
"fbjs": "^0.8.9",
"object-assign": "^4.1.0"
"fbjs": "^0.8.9"
},
"peerDependencies": {
"react": "^16.0.0-alpha.13"
Expand Down
1 change: 0 additions & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"dependencies": {
"fbjs": "^0.8.9",
"loose-envify": "^1.1.0",
"object-assign": "^4.1.0",
"prop-types": "^15.5.6"
},
"browserify": {
Expand Down
51 changes: 0 additions & 51 deletions scripts/babel/transform-object-assign-require.js

This file was deleted.

4 changes: 1 addition & 3 deletions scripts/jest/preprocessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@ var babelOptions = {
[
babelPluginModules,
{
map: Object.assign({}, moduleMap, {
'object-assign': 'object-assign',
}),
map: moduleMap,
},
],
// Keep stacks detailed in tests.
Expand Down
2 changes: 0 additions & 2 deletions scripts/rollup/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,6 @@ function updateBabelConfig(babelOpts, bundleType) {
case NODE_PROD:
return Object.assign({}, babelOpts, {
plugins: babelOpts.plugins.concat([
// Use object-assign polyfill in open source
resolve('./scripts/babel/transform-object-assign-require'),
// Replace __DEV__ with process.env.NODE_ENV and minify invariant messages
require('../error-codes/dev-expression-with-codes'),
]),
Expand Down
6 changes: 0 additions & 6 deletions scripts/rollup/modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,10 @@ function createModuleMap(paths, extractErrors, bundleType) {
}

function getNodeModules(bundleType) {
// rather than adding the rollup node resolve plugin,
// we can instead deal with the only node module that is used
// for UMD bundles - object-assign
switch (bundleType) {
case UMD_DEV:
case UMD_PROD:
return {
'object-assign': resolve('./node_modules/object-assign/index.js'),
// include the ART package modules directly by aliasing them from node_modules
'art/modes/current': resolve('./node_modules/art/modes/current.js'),
'art/modes/fast-noSideEffects': resolve(
Expand Down Expand Up @@ -156,8 +152,6 @@ function getExternalModules(externals, bundleType, isRenderer) {
case RN_DEV:
case RN_PROD:
fbjsModules.forEach(module => externalModules.push(module));
externalModules.push('object-assign');

if (isRenderer) {
externalModules.push('react');
}
Expand Down
72 changes: 36 additions & 36 deletions scripts/rollup/results.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{
"bundleSizes": {
"react.development.js (UMD_DEV)": {
"size": 65928,
"gzip": 16792
"size": 63860,
"gzip": 16063
},
"react.production.min.js (UMD_PROD)": {
"size": 6738,
"gzip": 2759
"size": 5854,
"gzip": 2398
},
"react.development.js (NODE_DEV)": {
"size": 56228,
"gzip": 14438
"size": 56177,
"gzip": 14420
},
"react.production.min.js (NODE_PROD)": {
"size": 5598,
"gzip": 2334
"size": 5605,
"gzip": 2327
},
"React-dev.js (FB_DEV)": {
"size": 53485,
Expand All @@ -25,20 +25,20 @@
"gzip": 6705
},
"react-dom.development.js (UMD_DEV)": {
"size": 630876,
"gzip": 143999
"size": 628906,
"gzip": 143288
},
"react-dom.production.min.js (UMD_PROD)": {
"size": 127001,
"gzip": 40233
"size": 126236,
"gzip": 39919
},
"react-dom.development.js (NODE_DEV)": {
"size": 590270,
"gzip": 134359
"size": 590326,
"gzip": 134354
},
"react-dom.production.min.js (NODE_PROD)": {
"size": 123917,
"gzip": 39159
"size": 124043,
"gzip": 39170
},
"ReactDOMFiber-dev.js (FB_DEV)": {
"size": 589473,
Expand All @@ -65,20 +65,20 @@
"gzip": 81957
},
"react-dom-server.development.js (UMD_DEV)": {
"size": 121172,
"gzip": 30762
"size": 119150,
"gzip": 30045
},
"react-dom-server.production.min.js (UMD_PROD)": {
"size": 20365,
"gzip": 7841
"size": 19541,
"gzip": 7501
},
"react-dom-server.development.js (NODE_DEV)": {
"size": 90322,
"gzip": 23339
"size": 90286,
"gzip": 23330
},
"react-dom-server.production.min.js (NODE_PROD)": {
"size": 18871,
"gzip": 7306
"size": 18938,
"gzip": 7302
},
"ReactDOMServerStream-dev.js (FB_DEV)": {
"size": 264750,
Expand Down Expand Up @@ -189,12 +189,12 @@
"gzip": 13644
},
"react-dom-node-stream.development.js (NODE_DEV)": {
"size": 92016,
"gzip": 23840
"size": 91980,
"gzip": 23825
},
"react-dom-node-stream.production.min.js (NODE_PROD)": {
"size": 19808,
"gzip": 7646
"size": 19875,
"gzip": 7641
},
"ReactDOMNodeStream-dev.js (FB_DEV)": {
"size": 264918,
Expand All @@ -205,20 +205,20 @@
"gzip": 50956
},
"react-dom-unstable-native-dependencies.development.js (UMD_DEV)": {
"size": 87163,
"gzip": 21689
"size": 85091,
"gzip": 20954
},
"react-dom-unstable-native-dependencies.production.min.js (UMD_PROD)": {
"size": 18899,
"gzip": 6159
"size": 18013,
"gzip": 5783
},
"react-dom-unstable-native-dependencies.development.js (NODE_DEV)": {
"size": 80583,
"gzip": 19737
"size": 80533,
"gzip": 19717
},
"react-dom-unstable-native-dependencies.production.min.js (NODE_PROD)": {
"size": 17154,
"gzip": 5513
"size": 17160,
"gzip": 5515
},
"ReactDOMUnstableNativeDependencies-dev.js (FB_DEV)": {
"size": 79722,
Expand Down

0 comments on commit c7355fa

Please sign in to comment.