From 7903e43124f095bcce7bd0c8189d996312f60988 Mon Sep 17 00:00:00 2001 From: Sebastian Markbage Date: Fri, 28 Feb 2020 15:59:30 -0800 Subject: [PATCH 1/2] react-debug-tools and jest-react should leave object-assign as an external dep This avoids it being compiled into the output. --- packages/jest-react/package.json | 3 +++ packages/react-debug-tools/package.json | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/jest-react/package.json b/packages/jest-react/package.json index bbb1a34a827..506eb22a8e3 100644 --- a/packages/jest-react/package.json +++ b/packages/jest-react/package.json @@ -23,6 +23,9 @@ "react": "^16.0.0", "react-test-renderer": "^16.0.0" }, + "dependencies": { + "object-assign": "^4.1.1" + }, "files": [ "LICENSE", "README.md", diff --git a/packages/react-debug-tools/package.json b/packages/react-debug-tools/package.json index 1a2e787d12b..0d69a5f55f5 100644 --- a/packages/react-debug-tools/package.json +++ b/packages/react-debug-tools/package.json @@ -29,6 +29,7 @@ "react": "^16.0.0" }, "dependencies": { - "error-stack-parser": "^2.0.2" + "error-stack-parser": "^2.0.2", + "object-assign": "^4.1.1" } } From 598f445bb60ccd312fa03033cb1cc83b5a79db2c Mon Sep 17 00:00:00 2001 From: Sebastian Markbage Date: Thu, 20 Feb 2020 22:08:56 -0800 Subject: [PATCH 2/2] Only use Rollup's CommonJS plugin for "react-art" We still need it for the "art" UMD builds but nothing else should have CommonJS dependencies anymore. --- scripts/rollup/build.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/rollup/build.js b/scripts/rollup/build.js index 2bf93d8e185..c3e7d8c7c73 100644 --- a/scripts/rollup/build.js +++ b/scripts/rollup/build.js @@ -392,8 +392,10 @@ function getPlugins( 'process.env.NODE_ENV': isProduction ? "'production'" : "'development'", __EXPERIMENTAL__, }), - // We still need CommonJS for external deps like object-assign. - commonjs(), + // The CommonJS plugin *only* exists to pull "art" into "react-art". + // I'm going to port "art" to ES modules to avoid this problem. + // Please don't enable this for anything else! + isUMDBundle && entry === 'react-art' && commonjs(), // Apply dead code elimination and/or minification. isProduction && closure(