diff --git a/packages/react-art/package.json b/packages/react-art/package.json index 1f9ff696504f5..abd5b813e8c13 100644 --- a/packages/react-art/package.json +++ b/packages/react-art/package.json @@ -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" diff --git a/packages/react-dom/package.json b/packages/react-dom/package.json index 34fe03bf7d243..f8631967f0496 100644 --- a/packages/react-dom/package.json +++ b/packages/react-dom/package.json @@ -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": { diff --git a/packages/react-noop-renderer/package.json b/packages/react-noop-renderer/package.json index 1c148ecc2666e..a709d3cfbf450 100644 --- a/packages/react-noop-renderer/package.json +++ b/packages/react-noop-renderer/package.json @@ -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", diff --git a/packages/react-test-renderer/package.json b/packages/react-test-renderer/package.json index 6fc32c5739798..bbb02f2e5bc7a 100644 --- a/packages/react-test-renderer/package.json +++ b/packages/react-test-renderer/package.json @@ -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" diff --git a/packages/react/package.json b/packages/react/package.json index ef5c5bb7cdc3b..7cbc551561159 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -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": { diff --git a/scripts/babel/transform-object-assign-require.js b/scripts/babel/transform-object-assign-require.js deleted file mode 100644 index d11fba2466361..0000000000000 --- a/scripts/babel/transform-object-assign-require.js +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -'use strict'; - -module.exports = function autoImporter(babel) { - const t = babel.types; - - function getAssignIdent(path, file, state) { - if (!state.id) { - state.id = path.scope.generateUidIdentifier('assign'); - path.scope.getProgramParent().push({ - id: state.id, - init: t.callExpression(t.identifier('require'), [ - t.stringLiteral('object-assign'), - ]), - }); - } - return state.id; - } - - return { - pre: function() { - // map from module to generated identifier - this.id = null; - }, - - visitor: { - CallExpression: function(path, file) { - if (path.get('callee').matchesPattern('Object.assign')) { - // generate identifier and require if it hasn't been already - var id = getAssignIdent(path, file, this); - path.node.callee = id; - } - }, - - MemberExpression: function(path, file) { - if (path.matchesPattern('Object.assign')) { - var id = getAssignIdent(path, file, this); - path.replaceWith(id); - } - }, - }, - }; -}; diff --git a/scripts/jest/preprocessor.js b/scripts/jest/preprocessor.js index 5f661d1aabbf4..76844cabb5b4a 100644 --- a/scripts/jest/preprocessor.js +++ b/scripts/jest/preprocessor.js @@ -43,9 +43,7 @@ var babelOptions = { [ babelPluginModules, { - map: Object.assign({}, moduleMap, { - 'object-assign': 'object-assign', - }), + map: moduleMap, }, ], // Keep stacks detailed in tests. diff --git a/scripts/rollup/build.js b/scripts/rollup/build.js index 33662d9caaf92..fcd026c9e7bac 100644 --- a/scripts/rollup/build.js +++ b/scripts/rollup/build.js @@ -9,7 +9,6 @@ const replace = require('rollup-plugin-replace'); const chalk = require('chalk'); const escapeStringRegexp = require('escape-string-regexp'); const join = require('path').join; -const resolve = require('path').resolve; const fs = require('fs'); const rimraf = require('rimraf'); const argv = require('minimist')(process.argv.slice(2)); @@ -124,8 +123,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'), ]), diff --git a/scripts/rollup/modules.js b/scripts/rollup/modules.js index 5907a23757d7c..4ebd963d84bde 100644 --- a/scripts/rollup/modules.js +++ b/scripts/rollup/modules.js @@ -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( @@ -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'); } diff --git a/scripts/rollup/results.json b/scripts/rollup/results.json index d419dbe5d1612..954294bbcd8ad 100644 --- a/scripts/rollup/results.json +++ b/scripts/rollup/results.json @@ -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, @@ -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, @@ -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, @@ -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, @@ -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,