From 857ee8cdf9af81bc94a7f04528fbda7fb2510eb4 Mon Sep 17 00:00:00 2001 From: Andrew Clark Date: Sat, 20 Apr 2024 11:23:46 -0400 Subject: [PATCH] Don't minify symbols in production builds (#28881) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This disables symbol renaming in production builds. The original variable and function names are preserved. All other forms of compression applied by Closure (dead code elimination, inlining, etc) are unchanged — the final program is identical to what we were producing before, just in a more readable form. The motivation is to make it easier to debug React issues that only occur in production — the same reason we decided to start shipping sourcemaps in #28827 and #28827. However, because most apps run their own minification step on their npm dependencies, it's not necessary for us to minify the symbols before publishing — it'll be handled the app, if desired. This is the same strategy Meta has used to ship React for years. The React build itself has unminified symbols, but they get minified as part of Meta's regular build pipeline. Even if an app does not minify their npm dependencies, gzip covers most of the cost of symbol renaming anyway. This saves us from having to ship sourcemaps, which means even apps that don't have sourcemaps configured will be able to debug the React build as easily as they would any other npm dependency. --- dangerfile.js | 4 +- package.json | 1 - .../eslint-plugin-react-hooks/npm/index.js | 2 +- packages/jest-react/npm/index.js | 2 +- packages/react-art/npm/index.js | 2 +- packages/react-cache/npm/index.js | 2 +- packages/react-client/npm/flight.js | 2 +- packages/react-debug-tools/npm/index.js | 2 +- packages/react-dom/npm/index.js | 2 +- packages/react-dom/npm/profiling.js | 2 +- .../react-dom/npm/react-dom.react-server.js | 2 +- .../react-dom/npm/server-rendering-stub.js | 2 +- packages/react-dom/npm/server.browser.js | 4 +- packages/react-dom/npm/server.bun.js | 4 +- packages/react-dom/npm/server.edge.js | 4 +- packages/react-dom/npm/server.node.js | 4 +- packages/react-dom/npm/static.browser.js | 2 +- packages/react-dom/npm/static.edge.js | 2 +- packages/react-dom/npm/static.node.js | 2 +- packages/react-dom/npm/test-utils.js | 2 +- packages/react-dom/npm/unstable_testing.js | 2 +- packages/react-is/npm/index.js | 2 +- .../react-noop-renderer/npm/flight-client.js | 2 +- .../react-noop-renderer/npm/flight-server.js | 2 +- packages/react-noop-renderer/npm/index.js | 2 +- .../react-noop-renderer/npm/persistent.js | 2 +- packages/react-noop-renderer/npm/server.js | 2 +- packages/react-reconciler/npm/constants.js | 2 +- packages/react-reconciler/npm/index.js | 2 +- packages/react-reconciler/npm/reflection.js | 2 +- packages/react-refresh/npm/babel.js | 2 +- packages/react-refresh/npm/runtime.js | 2 +- ...-server-dom-esm-node-loader.production.js} | 0 .../npm/client.browser.js | 2 +- .../react-server-dom-esm/npm/client.node.js | 2 +- .../react-server-dom-esm/npm/server.node.js | 2 +- packages/react-server-dom-esm/package.json | 2 +- ...r-dom-turbopack-node-loader.production.js} | 0 .../npm/client.browser.js | 2 +- .../npm/client.edge.js | 2 +- .../npm/client.node.js | 2 +- .../npm/client.node.unbundled.js | 2 +- .../npm/server.browser.js | 2 +- .../npm/server.edge.js | 2 +- .../npm/server.node.js | 2 +- .../npm/server.node.unbundled.js | 2 +- .../react-server-dom-turbopack/package.json | 2 +- ...ver-dom-webpack-node-loader.production.js} | 0 .../npm/client.browser.js | 2 +- .../npm/client.edge.js | 2 +- .../npm/client.node.js | 2 +- .../npm/client.node.unbundled.js | 2 +- .../npm/server.browser.js | 2 +- .../npm/server.edge.js | 2 +- .../npm/server.node.js | 2 +- .../npm/server.node.unbundled.js | 2 +- .../react-server-dom-webpack/package.json | 2 +- packages/react-server/npm/flight.js | 2 +- packages/react-server/npm/index.js | 2 +- packages/react-test-renderer/npm/index.js | 2 +- packages/react/npm/index.js | 2 +- packages/react/npm/jsx-dev-runtime.js | 2 +- packages/react/npm/jsx-runtime.js | 2 +- .../react/npm/jsx-runtime.react-server.js | 2 +- packages/react/npm/react.react-server.js | 2 +- packages/react/npm/unstable-cache.js | 2 +- packages/scheduler/npm/index.js | 2 +- packages/scheduler/npm/index.native.js | 2 +- packages/scheduler/npm/unstable_mock.js | 2 +- packages/scheduler/npm/unstable_post_task.js | 2 +- packages/use-subscription/npm/index.js | 2 +- packages/use-sync-external-store/npm/index.js | 2 +- .../use-sync-external-store/npm/shim/index.js | 2 +- .../npm/shim/index.native.js | 2 +- .../npm/shim/with-selector.js | 2 +- .../npm/with-selector.js | 2 +- scripts/bench/benchmarks/hacker-news/build.js | 8 +- .../benchmarks/pe-class-components/build.js | 8 +- .../pe-functional-components/build.js | 8 +- .../benchmarks/pe-no-components/build.js | 8 +- scripts/rollup/build.js | 113 +----------------- scripts/rollup/bundles.js | 8 +- yarn.lock | 52 +------- 83 files changed, 101 insertions(+), 259 deletions(-) rename packages/react-server-dom-esm/esm/{react-server-dom-esm-node-loader.production.min.js => react-server-dom-esm-node-loader.production.js} (100%) rename packages/react-server-dom-turbopack/esm/{react-server-dom-turbopack-node-loader.production.min.js => react-server-dom-turbopack-node-loader.production.js} (100%) rename packages/react-server-dom-webpack/esm/{react-server-dom-webpack-node-loader.production.min.js => react-server-dom-webpack-node-loader.production.js} (100%) diff --git a/dangerfile.js b/dangerfile.js index 8f75f7ece3cb8..9c4b7e2183489 100644 --- a/dangerfile.js +++ b/dangerfile.js @@ -43,8 +43,8 @@ const SIGNIFICANCE_THRESHOLD = 0.002; const CRITICAL_ARTIFACT_PATHS = new Set([ // We always report changes to these bundles, even if the change is // insignificant or non-existent. - 'oss-stable/react-dom/cjs/react-dom.production.min.js', - 'oss-experimental/react-dom/cjs/react-dom.production.min.js', + 'oss-stable/react-dom/cjs/react-dom.production.js', + 'oss-experimental/react-dom/cjs/react-dom.production.js', 'facebook-www/ReactDOM-prod.classic.js', 'facebook-www/ReactDOM-prod.modern.js', ]); diff --git a/package.json b/package.json index 5accd7eac1076..1c42047b86de8 100644 --- a/package.json +++ b/package.json @@ -94,7 +94,6 @@ "shelljs": "^0.8.5", "signedsource": "^2.0.0", "targz": "^1.0.1", - "terser": "^5.30.3", "through2": "^3.0.1", "tmp": "^0.1.0", "typescript": "^3.7.5", diff --git a/packages/eslint-plugin-react-hooks/npm/index.js b/packages/eslint-plugin-react-hooks/npm/index.js index 0e91baf6cd189..20458a7a9bf22 100644 --- a/packages/eslint-plugin-react-hooks/npm/index.js +++ b/packages/eslint-plugin-react-hooks/npm/index.js @@ -3,7 +3,7 @@ // TODO: this doesn't make sense for an ESLint rule. // We need to fix our build process to not create bundles for "raw" packages like this. if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/eslint-plugin-react-hooks.production.min.js'); + module.exports = require('./cjs/eslint-plugin-react-hooks.production.js'); } else { module.exports = require('./cjs/eslint-plugin-react-hooks.development.js'); } diff --git a/packages/jest-react/npm/index.js b/packages/jest-react/npm/index.js index 800d65a58fb8b..e6bdc4c48b8ae 100644 --- a/packages/jest-react/npm/index.js +++ b/packages/jest-react/npm/index.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/jest-react.production.min.js'); + module.exports = require('./cjs/jest-react.production.js'); } else { module.exports = require('./cjs/jest-react.development.js'); } diff --git a/packages/react-art/npm/index.js b/packages/react-art/npm/index.js index 549740524df38..90873e0d3ca71 100644 --- a/packages/react-art/npm/index.js +++ b/packages/react-art/npm/index.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react-art.production.min.js'); + module.exports = require('./cjs/react-art.production.js'); } else { module.exports = require('./cjs/react-art.development.js'); } diff --git a/packages/react-cache/npm/index.js b/packages/react-cache/npm/index.js index 2b4d5aec4158b..e9c3893af0ad0 100644 --- a/packages/react-cache/npm/index.js +++ b/packages/react-cache/npm/index.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react-cache.production.min.js'); + module.exports = require('./cjs/react-cache.production.js'); } else { module.exports = require('./cjs/react-cache.development.js'); } diff --git a/packages/react-client/npm/flight.js b/packages/react-client/npm/flight.js index 8009499c2898e..b1256c4afac78 100644 --- a/packages/react-client/npm/flight.js +++ b/packages/react-client/npm/flight.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react-client-flight.production.min.js'); + module.exports = require('./cjs/react-client-flight.production.js'); } else { module.exports = require('./cjs/react-client-flight.development.js'); } diff --git a/packages/react-debug-tools/npm/index.js b/packages/react-debug-tools/npm/index.js index 436e6ee2019f1..d1b6699df97f4 100644 --- a/packages/react-debug-tools/npm/index.js +++ b/packages/react-debug-tools/npm/index.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react-debug-tools.production.min.js'); + module.exports = require('./cjs/react-debug-tools.production.js'); } else { module.exports = require('./cjs/react-debug-tools.development.js'); } diff --git a/packages/react-dom/npm/index.js b/packages/react-dom/npm/index.js index 0eb376e9d5c39..973f373e461a4 100644 --- a/packages/react-dom/npm/index.js +++ b/packages/react-dom/npm/index.js @@ -32,7 +32,7 @@ if (process.env.NODE_ENV === 'production') { // DCE check should happen before ReactDOM bundle executes so that // DevTools can report bad minification during injection. checkDCE(); - module.exports = require('./cjs/react-dom.production.min.js'); + module.exports = require('./cjs/react-dom.production.js'); } else { module.exports = require('./cjs/react-dom.development.js'); } diff --git a/packages/react-dom/npm/profiling.js b/packages/react-dom/npm/profiling.js index 91f89f07ffe13..ad62952364dcf 100644 --- a/packages/react-dom/npm/profiling.js +++ b/packages/react-dom/npm/profiling.js @@ -32,7 +32,7 @@ if (process.env.NODE_ENV === 'production') { // DCE check should happen before ReactDOM bundle executes so that // DevTools can report bad minification during injection. checkDCE(); - module.exports = require('./cjs/react-dom.profiling.min.js'); + module.exports = require('./cjs/react-dom.profiling.js'); } else { module.exports = require('./cjs/react-dom.development.js'); } diff --git a/packages/react-dom/npm/react-dom.react-server.js b/packages/react-dom/npm/react-dom.react-server.js index 7ba04f2fec7c0..065c99003f3c7 100644 --- a/packages/react-dom/npm/react-dom.react-server.js +++ b/packages/react-dom/npm/react-dom.react-server.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react-dom.react-server.production.min.js'); + module.exports = require('./cjs/react-dom.react-server.production.js'); } else { module.exports = require('./cjs/react-dom.react-server.development.js'); } diff --git a/packages/react-dom/npm/server-rendering-stub.js b/packages/react-dom/npm/server-rendering-stub.js index fa2464a3e59fe..c402d242d6362 100644 --- a/packages/react-dom/npm/server-rendering-stub.js +++ b/packages/react-dom/npm/server-rendering-stub.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react-dom-server-rendering-stub.production.min.js'); + module.exports = require('./cjs/react-dom-server-rendering-stub.production.js'); } else { module.exports = require('./cjs/react-dom-server-rendering-stub.development.js'); } diff --git a/packages/react-dom/npm/server.browser.js b/packages/react-dom/npm/server.browser.js index 318fe36fa203a..04446965dc662 100644 --- a/packages/react-dom/npm/server.browser.js +++ b/packages/react-dom/npm/server.browser.js @@ -2,8 +2,8 @@ var l, s; if (process.env.NODE_ENV === 'production') { - l = require('./cjs/react-dom-server-legacy.browser.production.min.js'); - s = require('./cjs/react-dom-server.browser.production.min.js'); + l = require('./cjs/react-dom-server-legacy.browser.production.js'); + s = require('./cjs/react-dom-server.browser.production.js'); } else { l = require('./cjs/react-dom-server-legacy.browser.development.js'); s = require('./cjs/react-dom-server.browser.development.js'); diff --git a/packages/react-dom/npm/server.bun.js b/packages/react-dom/npm/server.bun.js index 74390e99c86a4..f0b6bf3a82981 100644 --- a/packages/react-dom/npm/server.bun.js +++ b/packages/react-dom/npm/server.bun.js @@ -3,8 +3,8 @@ var b; var l; if (process.env.NODE_ENV === 'production') { - b = require('./cjs/react-dom-server.bun.production.min.js'); - l = require('./cjs/react-dom-server-legacy.browser.production.min.js'); + b = require('./cjs/react-dom-server.bun.production.js'); + l = require('./cjs/react-dom-server-legacy.browser.production.js'); } else { b = require('./cjs/react-dom-server.bun.development.js'); l = require('./cjs/react-dom-server-legacy.browser.development.js'); diff --git a/packages/react-dom/npm/server.edge.js b/packages/react-dom/npm/server.edge.js index 50192934179b2..d64b9da7360a6 100644 --- a/packages/react-dom/npm/server.edge.js +++ b/packages/react-dom/npm/server.edge.js @@ -3,8 +3,8 @@ var b; var l; if (process.env.NODE_ENV === 'production') { - b = require('./cjs/react-dom-server.edge.production.min.js'); - l = require('./cjs/react-dom-server-legacy.browser.production.min.js'); + b = require('./cjs/react-dom-server.edge.production.js'); + l = require('./cjs/react-dom-server-legacy.browser.production.js'); } else { b = require('./cjs/react-dom-server.edge.development.js'); l = require('./cjs/react-dom-server-legacy.browser.development.js'); diff --git a/packages/react-dom/npm/server.node.js b/packages/react-dom/npm/server.node.js index edee039b26b0a..0373a33b3a750 100644 --- a/packages/react-dom/npm/server.node.js +++ b/packages/react-dom/npm/server.node.js @@ -2,8 +2,8 @@ var l, s; if (process.env.NODE_ENV === 'production') { - l = require('./cjs/react-dom-server-legacy.node.production.min.js'); - s = require('./cjs/react-dom-server.node.production.min.js'); + l = require('./cjs/react-dom-server-legacy.node.production.js'); + s = require('./cjs/react-dom-server.node.production.js'); } else { l = require('./cjs/react-dom-server-legacy.node.development.js'); s = require('./cjs/react-dom-server.node.development.js'); diff --git a/packages/react-dom/npm/static.browser.js b/packages/react-dom/npm/static.browser.js index 9ec4543cc6e79..6d3f52b0e6c1e 100644 --- a/packages/react-dom/npm/static.browser.js +++ b/packages/react-dom/npm/static.browser.js @@ -2,7 +2,7 @@ var s; if (process.env.NODE_ENV === 'production') { - s = require('./cjs/react-dom-server.browser.production.min.js'); + s = require('./cjs/react-dom-server.browser.production.js'); } else { s = require('./cjs/react-dom-server.browser.development.js'); } diff --git a/packages/react-dom/npm/static.edge.js b/packages/react-dom/npm/static.edge.js index 4593f91d2936a..de57d7a4c022e 100644 --- a/packages/react-dom/npm/static.edge.js +++ b/packages/react-dom/npm/static.edge.js @@ -2,7 +2,7 @@ var s; if (process.env.NODE_ENV === 'production') { - s = require('./cjs/react-dom-server.edge.production.min.js'); + s = require('./cjs/react-dom-server.edge.production.js'); } else { s = require('./cjs/react-dom-server.edge.development.js'); } diff --git a/packages/react-dom/npm/static.node.js b/packages/react-dom/npm/static.node.js index c86dc54e027d3..0a7cc8dfd7855 100644 --- a/packages/react-dom/npm/static.node.js +++ b/packages/react-dom/npm/static.node.js @@ -2,7 +2,7 @@ var s; if (process.env.NODE_ENV === 'production') { - s = require('./cjs/react-dom-server.node.production.min.js'); + s = require('./cjs/react-dom-server.node.production.js'); } else { s = require('./cjs/react-dom-server.node.development.js'); } diff --git a/packages/react-dom/npm/test-utils.js b/packages/react-dom/npm/test-utils.js index bc23ebec47892..bc945913b977d 100644 --- a/packages/react-dom/npm/test-utils.js +++ b/packages/react-dom/npm/test-utils.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react-dom-test-utils.production.min.js'); + module.exports = require('./cjs/react-dom-test-utils.production.js'); } else { module.exports = require('./cjs/react-dom-test-utils.development.js'); } diff --git a/packages/react-dom/npm/unstable_testing.js b/packages/react-dom/npm/unstable_testing.js index bb0dfdfa8865f..7cc1d5a5606bc 100644 --- a/packages/react-dom/npm/unstable_testing.js +++ b/packages/react-dom/npm/unstable_testing.js @@ -32,7 +32,7 @@ if (process.env.NODE_ENV === 'production') { // DCE check should happen before ReactDOM bundle executes so that // DevTools can report bad minification during injection. checkDCE(); - module.exports = require('./cjs/react-dom-unstable_testing.production.min.js'); + module.exports = require('./cjs/react-dom-unstable_testing.production.js'); } else { module.exports = require('./cjs/react-dom-unstable_testing.development.js'); } diff --git a/packages/react-is/npm/index.js b/packages/react-is/npm/index.js index 3ae098d078776..2cafe482766b4 100644 --- a/packages/react-is/npm/index.js +++ b/packages/react-is/npm/index.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react-is.production.min.js'); + module.exports = require('./cjs/react-is.production.js'); } else { module.exports = require('./cjs/react-is.development.js'); } diff --git a/packages/react-noop-renderer/npm/flight-client.js b/packages/react-noop-renderer/npm/flight-client.js index d557e5036036a..c4c0919ed6135 100644 --- a/packages/react-noop-renderer/npm/flight-client.js +++ b/packages/react-noop-renderer/npm/flight-client.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react-noop-renderer-flight-client.production.min.js'); + module.exports = require('./cjs/react-noop-renderer-flight-client.production.js'); } else { module.exports = require('./cjs/react-noop-renderer-flight-client.development.js'); } diff --git a/packages/react-noop-renderer/npm/flight-server.js b/packages/react-noop-renderer/npm/flight-server.js index de627385e808f..d1242cd78e293 100644 --- a/packages/react-noop-renderer/npm/flight-server.js +++ b/packages/react-noop-renderer/npm/flight-server.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react-noop-renderer-flight-server.production.min.js'); + module.exports = require('./cjs/react-noop-renderer-flight-server.production.js'); } else { module.exports = require('./cjs/react-noop-renderer-flight-server.development.js'); } diff --git a/packages/react-noop-renderer/npm/index.js b/packages/react-noop-renderer/npm/index.js index 7d59503074308..4f878211b65da 100644 --- a/packages/react-noop-renderer/npm/index.js +++ b/packages/react-noop-renderer/npm/index.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react-noop-renderer.production.min.js'); + module.exports = require('./cjs/react-noop-renderer.production.js'); } else { module.exports = require('./cjs/react-noop-renderer.development.js'); } diff --git a/packages/react-noop-renderer/npm/persistent.js b/packages/react-noop-renderer/npm/persistent.js index 14991d5371aef..74d88fb134363 100644 --- a/packages/react-noop-renderer/npm/persistent.js +++ b/packages/react-noop-renderer/npm/persistent.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react-noop-renderer-persistent.production.min.js'); + module.exports = require('./cjs/react-noop-renderer-persistent.production.js'); } else { module.exports = require('./cjs/react-noop-renderer-persistent.development.js'); } diff --git a/packages/react-noop-renderer/npm/server.js b/packages/react-noop-renderer/npm/server.js index 1abd91cef128e..836aed8242c01 100644 --- a/packages/react-noop-renderer/npm/server.js +++ b/packages/react-noop-renderer/npm/server.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react-noop-renderer-server.production.min.js'); + module.exports = require('./cjs/react-noop-renderer-server.production.js'); } else { module.exports = require('./cjs/react-noop-renderer-server.development.js'); } diff --git a/packages/react-reconciler/npm/constants.js b/packages/react-reconciler/npm/constants.js index df4f2b61987c0..d3ec461294f6f 100644 --- a/packages/react-reconciler/npm/constants.js +++ b/packages/react-reconciler/npm/constants.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react-reconciler-constants.production.min.js'); + module.exports = require('./cjs/react-reconciler-constants.production.js'); } else { module.exports = require('./cjs/react-reconciler-constants.development.js'); } diff --git a/packages/react-reconciler/npm/index.js b/packages/react-reconciler/npm/index.js index 28d36c9d30df1..63c171f119161 100644 --- a/packages/react-reconciler/npm/index.js +++ b/packages/react-reconciler/npm/index.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react-reconciler.production.min.js'); + module.exports = require('./cjs/react-reconciler.production.js'); } else { module.exports = require('./cjs/react-reconciler.development.js'); } diff --git a/packages/react-reconciler/npm/reflection.js b/packages/react-reconciler/npm/reflection.js index a25929bd73bcb..e9a23ccf320e4 100644 --- a/packages/react-reconciler/npm/reflection.js +++ b/packages/react-reconciler/npm/reflection.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react-reconciler-reflection.production.min.js'); + module.exports = require('./cjs/react-reconciler-reflection.production.js'); } else { module.exports = require('./cjs/react-reconciler-reflection.development.js'); } diff --git a/packages/react-refresh/npm/babel.js b/packages/react-refresh/npm/babel.js index d222a0d3fd1da..d9900d21a2857 100644 --- a/packages/react-refresh/npm/babel.js +++ b/packages/react-refresh/npm/babel.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react-refresh-babel.production.min.js'); + module.exports = require('./cjs/react-refresh-babel.production.js'); } else { module.exports = require('./cjs/react-refresh-babel.development.js'); } diff --git a/packages/react-refresh/npm/runtime.js b/packages/react-refresh/npm/runtime.js index 28e3b0ceeca91..c23bf725e9bdd 100644 --- a/packages/react-refresh/npm/runtime.js +++ b/packages/react-refresh/npm/runtime.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react-refresh-runtime.production.min.js'); + module.exports = require('./cjs/react-refresh-runtime.production.js'); } else { module.exports = require('./cjs/react-refresh-runtime.development.js'); } diff --git a/packages/react-server-dom-esm/esm/react-server-dom-esm-node-loader.production.min.js b/packages/react-server-dom-esm/esm/react-server-dom-esm-node-loader.production.js similarity index 100% rename from packages/react-server-dom-esm/esm/react-server-dom-esm-node-loader.production.min.js rename to packages/react-server-dom-esm/esm/react-server-dom-esm-node-loader.production.js diff --git a/packages/react-server-dom-esm/npm/client.browser.js b/packages/react-server-dom-esm/npm/client.browser.js index 992565cd69138..b189a8c4cb54e 100644 --- a/packages/react-server-dom-esm/npm/client.browser.js +++ b/packages/react-server-dom-esm/npm/client.browser.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react-server-dom-esm-client.browser.production.min.js'); + module.exports = require('./cjs/react-server-dom-esm-client.browser.production.js'); } else { module.exports = require('./cjs/react-server-dom-esm-client.browser.development.js'); } diff --git a/packages/react-server-dom-esm/npm/client.node.js b/packages/react-server-dom-esm/npm/client.node.js index e7ae5a5eb7779..afd623e509c91 100644 --- a/packages/react-server-dom-esm/npm/client.node.js +++ b/packages/react-server-dom-esm/npm/client.node.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react-server-dom-esm-client.node.production.min.js'); + module.exports = require('./cjs/react-server-dom-esm-client.node.production.js'); } else { module.exports = require('./cjs/react-server-dom-esm-client.node.development.js'); } diff --git a/packages/react-server-dom-esm/npm/server.node.js b/packages/react-server-dom-esm/npm/server.node.js index ec707a9db6a17..0896fc96b3aca 100644 --- a/packages/react-server-dom-esm/npm/server.node.js +++ b/packages/react-server-dom-esm/npm/server.node.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react-server-dom-esm-server.node.production.min.js'); + module.exports = require('./cjs/react-server-dom-esm-server.node.production.js'); } else { module.exports = require('./cjs/react-server-dom-esm-server.node.development.js'); } diff --git a/packages/react-server-dom-esm/package.json b/packages/react-server-dom-esm/package.json index 39fbff3a0270e..bd9e9c394962e 100644 --- a/packages/react-server-dom-esm/package.json +++ b/packages/react-server-dom-esm/package.json @@ -33,7 +33,7 @@ "default": "./server.js" }, "./server.node": "./server.node.js", - "./node-loader": "./esm/react-server-dom-esm-node-loader.production.min.js", + "./node-loader": "./esm/react-server-dom-esm-node-loader.production.js", "./src/*": "./src/*.js", "./package.json": "./package.json" }, diff --git a/packages/react-server-dom-turbopack/esm/react-server-dom-turbopack-node-loader.production.min.js b/packages/react-server-dom-turbopack/esm/react-server-dom-turbopack-node-loader.production.js similarity index 100% rename from packages/react-server-dom-turbopack/esm/react-server-dom-turbopack-node-loader.production.min.js rename to packages/react-server-dom-turbopack/esm/react-server-dom-turbopack-node-loader.production.js diff --git a/packages/react-server-dom-turbopack/npm/client.browser.js b/packages/react-server-dom-turbopack/npm/client.browser.js index 5cd0ada188456..84f8cf245dca1 100644 --- a/packages/react-server-dom-turbopack/npm/client.browser.js +++ b/packages/react-server-dom-turbopack/npm/client.browser.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react-server-dom-turbopack-client.browser.production.min.js'); + module.exports = require('./cjs/react-server-dom-turbopack-client.browser.production.js'); } else { module.exports = require('./cjs/react-server-dom-turbopack-client.browser.development.js'); } diff --git a/packages/react-server-dom-turbopack/npm/client.edge.js b/packages/react-server-dom-turbopack/npm/client.edge.js index 3499ce22c2a39..4cfab85b0e5d8 100644 --- a/packages/react-server-dom-turbopack/npm/client.edge.js +++ b/packages/react-server-dom-turbopack/npm/client.edge.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react-server-dom-turbopack-client.edge.production.min.js'); + module.exports = require('./cjs/react-server-dom-turbopack-client.edge.production.js'); } else { module.exports = require('./cjs/react-server-dom-turbopack-client.edge.development.js'); } diff --git a/packages/react-server-dom-turbopack/npm/client.node.js b/packages/react-server-dom-turbopack/npm/client.node.js index c346d351d344e..d9c2ddf9985d4 100644 --- a/packages/react-server-dom-turbopack/npm/client.node.js +++ b/packages/react-server-dom-turbopack/npm/client.node.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react-server-dom-turbopack-client.node.production.min.js'); + module.exports = require('./cjs/react-server-dom-turbopack-client.node.production.js'); } else { module.exports = require('./cjs/react-server-dom-turbopack-client.node.development.js'); } diff --git a/packages/react-server-dom-turbopack/npm/client.node.unbundled.js b/packages/react-server-dom-turbopack/npm/client.node.unbundled.js index 9b15ea16d8a33..04eb5b1972bed 100644 --- a/packages/react-server-dom-turbopack/npm/client.node.unbundled.js +++ b/packages/react-server-dom-turbopack/npm/client.node.unbundled.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react-server-dom-turbopack-client.node.unbundled.production.min.js'); + module.exports = require('./cjs/react-server-dom-turbopack-client.node.unbundled.production.js'); } else { module.exports = require('./cjs/react-server-dom-turbopack-client.node.unbundled.development.js'); } diff --git a/packages/react-server-dom-turbopack/npm/server.browser.js b/packages/react-server-dom-turbopack/npm/server.browser.js index 05c0b03496bda..1d0364c5d392b 100644 --- a/packages/react-server-dom-turbopack/npm/server.browser.js +++ b/packages/react-server-dom-turbopack/npm/server.browser.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react-server-dom-turbopack-server.browser.production.min.js'); + module.exports = require('./cjs/react-server-dom-turbopack-server.browser.production.js'); } else { module.exports = require('./cjs/react-server-dom-turbopack-server.browser.development.js'); } diff --git a/packages/react-server-dom-turbopack/npm/server.edge.js b/packages/react-server-dom-turbopack/npm/server.edge.js index b09cb0b82282d..c893cc3cdfa6e 100644 --- a/packages/react-server-dom-turbopack/npm/server.edge.js +++ b/packages/react-server-dom-turbopack/npm/server.edge.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react-server-dom-turbopack-server.edge.production.min.js'); + module.exports = require('./cjs/react-server-dom-turbopack-server.edge.production.js'); } else { module.exports = require('./cjs/react-server-dom-turbopack-server.edge.development.js'); } diff --git a/packages/react-server-dom-turbopack/npm/server.node.js b/packages/react-server-dom-turbopack/npm/server.node.js index 59635310eb2d1..ac6128983dc6b 100644 --- a/packages/react-server-dom-turbopack/npm/server.node.js +++ b/packages/react-server-dom-turbopack/npm/server.node.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react-server-dom-turbopack-server.node.production.min.js'); + module.exports = require('./cjs/react-server-dom-turbopack-server.node.production.js'); } else { module.exports = require('./cjs/react-server-dom-turbopack-server.node.development.js'); } diff --git a/packages/react-server-dom-turbopack/npm/server.node.unbundled.js b/packages/react-server-dom-turbopack/npm/server.node.unbundled.js index 4f8856e4303a8..86f9dcdefb1d7 100644 --- a/packages/react-server-dom-turbopack/npm/server.node.unbundled.js +++ b/packages/react-server-dom-turbopack/npm/server.node.unbundled.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react-server-dom-turbopack-server.node.unbundled.production.min.js'); + module.exports = require('./cjs/react-server-dom-turbopack-server.node.unbundled.production.js'); } else { module.exports = require('./cjs/react-server-dom-turbopack-server.node.unbundled.development.js'); } diff --git a/packages/react-server-dom-turbopack/package.json b/packages/react-server-dom-turbopack/package.json index c31d5c5832027..93e694b3a3e1b 100644 --- a/packages/react-server-dom-turbopack/package.json +++ b/packages/react-server-dom-turbopack/package.json @@ -63,7 +63,7 @@ "./server.edge": "./server.edge.js", "./server.node": "./server.node.js", "./server.node.unbundled": "./server.node.unbundled.js", - "./node-loader": "./esm/react-server-dom-turbopack-node-loader.production.min.js", + "./node-loader": "./esm/react-server-dom-turbopack-node-loader.production.js", "./node-register": "./node-register.js", "./src/*": "./src/*.js", "./package.json": "./package.json" diff --git a/packages/react-server-dom-webpack/esm/react-server-dom-webpack-node-loader.production.min.js b/packages/react-server-dom-webpack/esm/react-server-dom-webpack-node-loader.production.js similarity index 100% rename from packages/react-server-dom-webpack/esm/react-server-dom-webpack-node-loader.production.min.js rename to packages/react-server-dom-webpack/esm/react-server-dom-webpack-node-loader.production.js diff --git a/packages/react-server-dom-webpack/npm/client.browser.js b/packages/react-server-dom-webpack/npm/client.browser.js index 9a80cea84cbb8..6c2dfafceb239 100644 --- a/packages/react-server-dom-webpack/npm/client.browser.js +++ b/packages/react-server-dom-webpack/npm/client.browser.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react-server-dom-webpack-client.browser.production.min.js'); + module.exports = require('./cjs/react-server-dom-webpack-client.browser.production.js'); } else { module.exports = require('./cjs/react-server-dom-webpack-client.browser.development.js'); } diff --git a/packages/react-server-dom-webpack/npm/client.edge.js b/packages/react-server-dom-webpack/npm/client.edge.js index 661caffa755ba..ffdcc94ee2e0a 100644 --- a/packages/react-server-dom-webpack/npm/client.edge.js +++ b/packages/react-server-dom-webpack/npm/client.edge.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react-server-dom-webpack-client.edge.production.min.js'); + module.exports = require('./cjs/react-server-dom-webpack-client.edge.production.js'); } else { module.exports = require('./cjs/react-server-dom-webpack-client.edge.development.js'); } diff --git a/packages/react-server-dom-webpack/npm/client.node.js b/packages/react-server-dom-webpack/npm/client.node.js index cb7dbcf4c34f7..32b45503d142c 100644 --- a/packages/react-server-dom-webpack/npm/client.node.js +++ b/packages/react-server-dom-webpack/npm/client.node.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react-server-dom-webpack-client.node.production.min.js'); + module.exports = require('./cjs/react-server-dom-webpack-client.node.production.js'); } else { module.exports = require('./cjs/react-server-dom-webpack-client.node.development.js'); } diff --git a/packages/react-server-dom-webpack/npm/client.node.unbundled.js b/packages/react-server-dom-webpack/npm/client.node.unbundled.js index 17fe876fd388a..5ec0f2cb36236 100644 --- a/packages/react-server-dom-webpack/npm/client.node.unbundled.js +++ b/packages/react-server-dom-webpack/npm/client.node.unbundled.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react-server-dom-webpack-client.node.unbundled.production.min.js'); + module.exports = require('./cjs/react-server-dom-webpack-client.node.unbundled.production.js'); } else { module.exports = require('./cjs/react-server-dom-webpack-client.node.unbundled.development.js'); } diff --git a/packages/react-server-dom-webpack/npm/server.browser.js b/packages/react-server-dom-webpack/npm/server.browser.js index ef53389abbc30..12fe5da29af0f 100644 --- a/packages/react-server-dom-webpack/npm/server.browser.js +++ b/packages/react-server-dom-webpack/npm/server.browser.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react-server-dom-webpack-server.browser.production.min.js'); + module.exports = require('./cjs/react-server-dom-webpack-server.browser.production.js'); } else { module.exports = require('./cjs/react-server-dom-webpack-server.browser.development.js'); } diff --git a/packages/react-server-dom-webpack/npm/server.edge.js b/packages/react-server-dom-webpack/npm/server.edge.js index d061fe624e78f..ceab7b1ea0626 100644 --- a/packages/react-server-dom-webpack/npm/server.edge.js +++ b/packages/react-server-dom-webpack/npm/server.edge.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react-server-dom-webpack-server.edge.production.min.js'); + module.exports = require('./cjs/react-server-dom-webpack-server.edge.production.js'); } else { module.exports = require('./cjs/react-server-dom-webpack-server.edge.development.js'); } diff --git a/packages/react-server-dom-webpack/npm/server.node.js b/packages/react-server-dom-webpack/npm/server.node.js index 7ac5a189e2a2d..84da8eda2a247 100644 --- a/packages/react-server-dom-webpack/npm/server.node.js +++ b/packages/react-server-dom-webpack/npm/server.node.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react-server-dom-webpack-server.node.production.min.js'); + module.exports = require('./cjs/react-server-dom-webpack-server.node.production.js'); } else { module.exports = require('./cjs/react-server-dom-webpack-server.node.development.js'); } diff --git a/packages/react-server-dom-webpack/npm/server.node.unbundled.js b/packages/react-server-dom-webpack/npm/server.node.unbundled.js index 5f75de80942a2..26e6677eed9bc 100644 --- a/packages/react-server-dom-webpack/npm/server.node.unbundled.js +++ b/packages/react-server-dom-webpack/npm/server.node.unbundled.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react-server-dom-webpack-server.node.unbundled.production.min.js'); + module.exports = require('./cjs/react-server-dom-webpack-server.node.unbundled.production.js'); } else { module.exports = require('./cjs/react-server-dom-webpack-server.node.unbundled.development.js'); } diff --git a/packages/react-server-dom-webpack/package.json b/packages/react-server-dom-webpack/package.json index 565b12bf79955..b8e2ccf92e3e3 100644 --- a/packages/react-server-dom-webpack/package.json +++ b/packages/react-server-dom-webpack/package.json @@ -63,7 +63,7 @@ "./server.edge": "./server.edge.js", "./server.node": "./server.node.js", "./server.node.unbundled": "./server.node.unbundled.js", - "./node-loader": "./esm/react-server-dom-webpack-node-loader.production.min.js", + "./node-loader": "./esm/react-server-dom-webpack-node-loader.production.js", "./node-register": "./node-register.js", "./src/*": "./src/*.js", "./package.json": "./package.json" diff --git a/packages/react-server/npm/flight.js b/packages/react-server/npm/flight.js index 7e1d00ca14f13..a8c2e2bce9528 100644 --- a/packages/react-server/npm/flight.js +++ b/packages/react-server/npm/flight.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react-server-flight.production.min.js'); + module.exports = require('./cjs/react-server-flight.production.js'); } else { module.exports = require('./cjs/react-server-flight.development.js'); } diff --git a/packages/react-server/npm/index.js b/packages/react-server/npm/index.js index e9f3d0324e3b9..06d58af609ce0 100644 --- a/packages/react-server/npm/index.js +++ b/packages/react-server/npm/index.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react-server.production.min.js'); + module.exports = require('./cjs/react-server.production.js'); } else { module.exports = require('./cjs/react-server.development.js'); } diff --git a/packages/react-test-renderer/npm/index.js b/packages/react-test-renderer/npm/index.js index e06cbbe3c3425..c3a24f4e6a4c2 100644 --- a/packages/react-test-renderer/npm/index.js +++ b/packages/react-test-renderer/npm/index.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react-test-renderer.production.min.js'); + module.exports = require('./cjs/react-test-renderer.production.js'); } else { module.exports = require('./cjs/react-test-renderer.development.js'); } diff --git a/packages/react/npm/index.js b/packages/react/npm/index.js index 999ead77897d1..d830d7a2f9f7f 100644 --- a/packages/react/npm/index.js +++ b/packages/react/npm/index.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react.production.min.js'); + module.exports = require('./cjs/react.production.js'); } else { module.exports = require('./cjs/react.development.js'); } diff --git a/packages/react/npm/jsx-dev-runtime.js b/packages/react/npm/jsx-dev-runtime.js index 324eb11e5992d..0a80857d2d65a 100644 --- a/packages/react/npm/jsx-dev-runtime.js +++ b/packages/react/npm/jsx-dev-runtime.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react-jsx-dev-runtime.production.min.js'); + module.exports = require('./cjs/react-jsx-dev-runtime.production.js'); } else { module.exports = require('./cjs/react-jsx-dev-runtime.development.js'); } diff --git a/packages/react/npm/jsx-runtime.js b/packages/react/npm/jsx-runtime.js index 0416df54291a8..8679b72159b9c 100644 --- a/packages/react/npm/jsx-runtime.js +++ b/packages/react/npm/jsx-runtime.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react-jsx-runtime.production.min.js'); + module.exports = require('./cjs/react-jsx-runtime.production.js'); } else { module.exports = require('./cjs/react-jsx-runtime.development.js'); } diff --git a/packages/react/npm/jsx-runtime.react-server.js b/packages/react/npm/jsx-runtime.react-server.js index cd80277331d46..2d23c8c3442fe 100644 --- a/packages/react/npm/jsx-runtime.react-server.js +++ b/packages/react/npm/jsx-runtime.react-server.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react-jsx-runtime.react-server.production.min.js'); + module.exports = require('./cjs/react-jsx-runtime.react-server.production.js'); } else { module.exports = require('./cjs/react-jsx-runtime.react-server.development.js'); } diff --git a/packages/react/npm/react.react-server.js b/packages/react/npm/react.react-server.js index 42772dc4ba3c7..c66e3b76365d7 100644 --- a/packages/react/npm/react.react-server.js +++ b/packages/react/npm/react.react-server.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react.react-server.production.min.js'); + module.exports = require('./cjs/react.react-server.production.js'); } else { module.exports = require('./cjs/react.react-server.development.js'); } diff --git a/packages/react/npm/unstable-cache.js b/packages/react/npm/unstable-cache.js index ca819bd092951..9e0d773ebadf9 100644 --- a/packages/react/npm/unstable-cache.js +++ b/packages/react/npm/unstable-cache.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react-unstable-cache.production.min.js'); + module.exports = require('./cjs/react-unstable-cache.production.js'); } else { module.exports = require('./cjs/react-unstable-cache.development.js'); } diff --git a/packages/scheduler/npm/index.js b/packages/scheduler/npm/index.js index 77770b0c219e2..d6b7b0a8797dc 100644 --- a/packages/scheduler/npm/index.js +++ b/packages/scheduler/npm/index.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/scheduler.production.min.js'); + module.exports = require('./cjs/scheduler.production.js'); } else { module.exports = require('./cjs/scheduler.development.js'); } diff --git a/packages/scheduler/npm/index.native.js b/packages/scheduler/npm/index.native.js index 4b65547421073..4186b711d2548 100644 --- a/packages/scheduler/npm/index.native.js +++ b/packages/scheduler/npm/index.native.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/scheduler.native.production.min.js'); + module.exports = require('./cjs/scheduler.native.production.js'); } else { module.exports = require('./cjs/scheduler.native.development.js'); } diff --git a/packages/scheduler/npm/unstable_mock.js b/packages/scheduler/npm/unstable_mock.js index e72ea3186f005..acc901ca45fa1 100644 --- a/packages/scheduler/npm/unstable_mock.js +++ b/packages/scheduler/npm/unstable_mock.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/scheduler-unstable_mock.production.min.js'); + module.exports = require('./cjs/scheduler-unstable_mock.production.js'); } else { module.exports = require('./cjs/scheduler-unstable_mock.development.js'); } diff --git a/packages/scheduler/npm/unstable_post_task.js b/packages/scheduler/npm/unstable_post_task.js index 62ecbd5a072bc..e9681528a227f 100644 --- a/packages/scheduler/npm/unstable_post_task.js +++ b/packages/scheduler/npm/unstable_post_task.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/scheduler-unstable_post_task.production.min.js'); + module.exports = require('./cjs/scheduler-unstable_post_task.production.js'); } else { module.exports = require('./cjs/scheduler-unstable_post_task.development.js'); } diff --git a/packages/use-subscription/npm/index.js b/packages/use-subscription/npm/index.js index b91e9c4a14237..84c3d1091ce7c 100644 --- a/packages/use-subscription/npm/index.js +++ b/packages/use-subscription/npm/index.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/use-subscription.production.min.js'); + module.exports = require('./cjs/use-subscription.production.js'); } else { module.exports = require('./cjs/use-subscription.development.js'); } diff --git a/packages/use-sync-external-store/npm/index.js b/packages/use-sync-external-store/npm/index.js index a9d619acec0ac..303d4b916e8f7 100644 --- a/packages/use-sync-external-store/npm/index.js +++ b/packages/use-sync-external-store/npm/index.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/use-sync-external-store.production.min.js'); + module.exports = require('./cjs/use-sync-external-store.production.js'); } else { module.exports = require('./cjs/use-sync-external-store.development.js'); } diff --git a/packages/use-sync-external-store/npm/shim/index.js b/packages/use-sync-external-store/npm/shim/index.js index bde36f38efdb3..974854c2cd8ad 100644 --- a/packages/use-sync-external-store/npm/shim/index.js +++ b/packages/use-sync-external-store/npm/shim/index.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('../cjs/use-sync-external-store-shim.production.min.js'); + module.exports = require('../cjs/use-sync-external-store-shim.production.js'); } else { module.exports = require('../cjs/use-sync-external-store-shim.development.js'); } diff --git a/packages/use-sync-external-store/npm/shim/index.native.js b/packages/use-sync-external-store/npm/shim/index.native.js index 0bd5c7e1c0f85..69bc7586babc8 100644 --- a/packages/use-sync-external-store/npm/shim/index.native.js +++ b/packages/use-sync-external-store/npm/shim/index.native.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('../cjs/use-sync-external-store-shim.native.production.min.js'); + module.exports = require('../cjs/use-sync-external-store-shim.native.production.js'); } else { module.exports = require('../cjs/use-sync-external-store-shim.native.development.js'); } diff --git a/packages/use-sync-external-store/npm/shim/with-selector.js b/packages/use-sync-external-store/npm/shim/with-selector.js index 1175186c64286..91859dbd47282 100644 --- a/packages/use-sync-external-store/npm/shim/with-selector.js +++ b/packages/use-sync-external-store/npm/shim/with-selector.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('../cjs/use-sync-external-store-shim/with-selector.production.min.js'); + module.exports = require('../cjs/use-sync-external-store-shim/with-selector.production.js'); } else { module.exports = require('../cjs/use-sync-external-store-shim/with-selector.development.js'); } diff --git a/packages/use-sync-external-store/npm/with-selector.js b/packages/use-sync-external-store/npm/with-selector.js index 9163b3e7e13f7..c0d0da3b43d46 100644 --- a/packages/use-sync-external-store/npm/with-selector.js +++ b/packages/use-sync-external-store/npm/with-selector.js @@ -1,7 +1,7 @@ 'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/use-sync-external-store-with-selector.production.min.js'); + module.exports = require('./cjs/use-sync-external-store-with-selector.production.js'); } else { module.exports = require('./cjs/use-sync-external-store-with-selector.development.js'); } diff --git a/scripts/bench/benchmarks/hacker-news/build.js b/scripts/bench/benchmarks/hacker-news/build.js index 6622176404f3e..ffbd82637d2c9 100644 --- a/scripts/bench/benchmarks/hacker-news/build.js +++ b/scripts/bench/benchmarks/hacker-news/build.js @@ -5,12 +5,12 @@ const {join} = require('path'); async function build(reactPath, asyncCopyTo) { // copy the UMD bundles await asyncCopyTo( - join(reactPath, 'build', 'dist', 'react.production.min.js'), - join(__dirname, 'react.production.min.js') + join(reactPath, 'build', 'dist', 'react.production.js'), + join(__dirname, 'react.production.js') ); await asyncCopyTo( - join(reactPath, 'build', 'dist', 'react-dom.production.min.js'), - join(__dirname, 'react-dom.production.min.js') + join(reactPath, 'build', 'dist', 'react-dom.production.js'), + join(__dirname, 'react-dom.production.js') ); } diff --git a/scripts/bench/benchmarks/pe-class-components/build.js b/scripts/bench/benchmarks/pe-class-components/build.js index 6622176404f3e..ffbd82637d2c9 100644 --- a/scripts/bench/benchmarks/pe-class-components/build.js +++ b/scripts/bench/benchmarks/pe-class-components/build.js @@ -5,12 +5,12 @@ const {join} = require('path'); async function build(reactPath, asyncCopyTo) { // copy the UMD bundles await asyncCopyTo( - join(reactPath, 'build', 'dist', 'react.production.min.js'), - join(__dirname, 'react.production.min.js') + join(reactPath, 'build', 'dist', 'react.production.js'), + join(__dirname, 'react.production.js') ); await asyncCopyTo( - join(reactPath, 'build', 'dist', 'react-dom.production.min.js'), - join(__dirname, 'react-dom.production.min.js') + join(reactPath, 'build', 'dist', 'react-dom.production.js'), + join(__dirname, 'react-dom.production.js') ); } diff --git a/scripts/bench/benchmarks/pe-functional-components/build.js b/scripts/bench/benchmarks/pe-functional-components/build.js index 6622176404f3e..ffbd82637d2c9 100644 --- a/scripts/bench/benchmarks/pe-functional-components/build.js +++ b/scripts/bench/benchmarks/pe-functional-components/build.js @@ -5,12 +5,12 @@ const {join} = require('path'); async function build(reactPath, asyncCopyTo) { // copy the UMD bundles await asyncCopyTo( - join(reactPath, 'build', 'dist', 'react.production.min.js'), - join(__dirname, 'react.production.min.js') + join(reactPath, 'build', 'dist', 'react.production.js'), + join(__dirname, 'react.production.js') ); await asyncCopyTo( - join(reactPath, 'build', 'dist', 'react-dom.production.min.js'), - join(__dirname, 'react-dom.production.min.js') + join(reactPath, 'build', 'dist', 'react-dom.production.js'), + join(__dirname, 'react-dom.production.js') ); } diff --git a/scripts/bench/benchmarks/pe-no-components/build.js b/scripts/bench/benchmarks/pe-no-components/build.js index 6622176404f3e..ffbd82637d2c9 100644 --- a/scripts/bench/benchmarks/pe-no-components/build.js +++ b/scripts/bench/benchmarks/pe-no-components/build.js @@ -5,12 +5,12 @@ const {join} = require('path'); async function build(reactPath, asyncCopyTo) { // copy the UMD bundles await asyncCopyTo( - join(reactPath, 'build', 'dist', 'react.production.min.js'), - join(__dirname, 'react.production.min.js') + join(reactPath, 'build', 'dist', 'react.production.js'), + join(__dirname, 'react.production.js') ); await asyncCopyTo( - join(reactPath, 'build', 'dist', 'react-dom.production.min.js'), - join(__dirname, 'react-dom.production.min.js') + join(reactPath, 'build', 'dist', 'react-dom.production.js'), + join(__dirname, 'react-dom.production.js') ); } diff --git a/scripts/rollup/build.js b/scripts/rollup/build.js index 533b682d814e1..2ade58493a5f2 100644 --- a/scripts/rollup/build.js +++ b/scripts/rollup/build.js @@ -10,7 +10,6 @@ const stripBanner = require('rollup-plugin-strip-banner'); const chalk = require('chalk'); const resolve = require('@rollup/plugin-node-resolve').nodeResolve; const fs = require('fs'); -const path = require('path'); const argv = require('minimist')(process.argv.slice(2)); const Modules = require('./modules'); const Bundles = require('./bundles'); @@ -23,7 +22,6 @@ const Packaging = require('./packaging'); const {asyncRimRaf} = require('./utils'); const codeFrame = require('@babel/code-frame'); const Wrappers = require('./wrappers'); -const minify = require('terser').minify; const RELEASE_CHANNEL = process.env.RELEASE_CHANNEL; @@ -363,31 +361,8 @@ function getPlugins( const isProduction = isProductionBundleType(bundleType); const isProfiling = isProfilingBundleType(bundleType); - const {shouldStayReadable} = getBundleTypeFlags(bundleType); - const needsMinifiedByClosure = isProduction && bundleType !== ESM_PROD; - // Any other packages that should specifically _not_ have sourcemaps - const sourcemapPackageExcludes = [ - // Having `//#sourceMappingUrl` for the `react-debug-tools` prod bundle breaks - // `ReactDevToolsHooksIntegration-test.js`, because it changes Node's generated - // stack traces and thus alters the hook name parsing behavior. - // Also, this is an internal-only package that doesn't need sourcemaps anyway - 'react-debug-tools', - ]; - - // Generate sourcemaps for true "production" build artifacts - // that will be used by bundlers, such as `react-dom.production.min.js`. - // Also include profiling builds as well. - const needsSourcemaps = - needsMinifiedByClosure && - // This will only exclude `unstable_server-external-runtime.js` artifact - // To start generating sourcemaps for it, we should stop manually copying it to `facebook-www` - // and force `react-dom` to include .map files in npm-package at the root level - bundleType !== BROWSER_SCRIPT && - !sourcemapPackageExcludes.includes(entry) && - !shouldStayReadable; - return [ // Keep dynamic imports as externals dynamicImports(), @@ -494,8 +469,9 @@ function getPlugins( // https://github.com/facebook/react/issues/10909 assume_function_wrapper: true, - // Don't rename symbols (variable names, functions, etc). This will - // be handled in a later step. + // Don't rename symbols (variable names, functions, etc). We leave + // this up to the application to handle, if they want. Otherwise gzip + // takes care of it. renaming: false, }), needsMinifiedByClosure && @@ -518,89 +494,6 @@ function getPlugins( ); }, }, - isProduction && - !shouldStayReadable && { - name: 'mangle-symbol-names', - async renderChunk(code, chunk, options, meta) { - // Minify the code by mangling symbol names. We already ran Closure - // on this code, so stuff like dead code elimination and inlining - // has already happened. This step is purely to rename the symbols, - // which we asked Closure to preserve. - // - // The only reason this is a separate step from Closure is so we - // can publish non-mangled versions of the code for easier debugging - // in production. We also publish sourcemaps that map back to the - // non-mangled code (*not* the pre-Closure code). - - const outputFolder = path.dirname(options.file); - - // Represent the "original" bundle as a file with no `.min` in the name - const filenameWithoutMin = filename.replace('.min', ''); - // There's _one_ artifact where the incoming filename actually contains - // a folder name: "use-sync-external-store-shim/with-selector.production.js". - // The output path already has the right structure, but we need to strip this - // down to _just_ the JS filename. - const preMinifiedFilename = path.basename(filenameWithoutMin); - const preMinifiedBundlePath = path.join( - outputFolder, - preMinifiedFilename - ); - - // Use a path like `node_modules/react/cjs/react.production.min.js.map` for the sourcemap file - const finalSourcemapPath = options.file.replace('.js', '.js.map'); - const finalSourcemapFilename = path.basename(finalSourcemapPath); - - const terserOptions = { - // Don't bother compressing. Closure already did that. - compress: false, - toplevel: true, - // Mangle the symbol names. - mangle: { - toplevel: true, - }, - }; - if (needsSourcemaps) { - terserOptions.sourceMap = { - // Used to set the `file` field in the sourcemap - filename: filename, - // Used to set `# sourceMappingURL=` in the compiled code - url: finalSourcemapFilename, - }; - } - - const minifiedResult = await minify( - {[preMinifiedFilename]: code}, - terserOptions - ); - - // Create the directory if it doesn't already exist - fs.mkdirSync(outputFolder, {recursive: true}); - - if (needsSourcemaps) { - const sourcemapJSON = JSON.parse(minifiedResult.map); - - // All our code is considered "third-party" and should be ignored - // by default - sourcemapJSON.ignoreList = [0]; - - // Write the sourcemap to disk - fs.writeFileSync( - finalSourcemapPath, - JSON.stringify(sourcemapJSON) - ); - } - - // Write the original source to disk as a separate file - fs.writeFileSync(preMinifiedBundlePath, code); - - return { - code: minifiedResult.code, - // TODO: Maybe we should use Rollup's sourcemap feature instead - // of writing it to disk manually? - map: null, - }; - }, - }, // Record bundle size. sizes({ getSize: (size, gzip) => { diff --git a/scripts/rollup/bundles.js b/scripts/rollup/bundles.js index 08a47c6767aa9..f5b5b3a23e5ff 100644 --- a/scripts/rollup/bundles.js +++ b/scripts/rollup/bundles.js @@ -1098,17 +1098,17 @@ function getFilename(bundle, bundleType) { case BUN_DEV: return `${name}.development.js`; case BUN_PROD: - return `${name}.production.min.js`; + return `${name}.production.js`; case ESM_DEV: return `${name}.development.js`; case ESM_PROD: - return `${name}.production.min.js`; + return `${name}.production.js`; case NODE_DEV: return `${name}.development.js`; case NODE_PROD: - return `${name}.production.min.js`; + return `${name}.production.js`; case NODE_PROFILING: - return `${name}.profiling.min.js`; + return `${name}.profiling.js`; case FB_WWW_DEV: case RN_OSS_DEV: case RN_FB_DEV: diff --git a/yarn.lock b/yarn.lock index fd76ea8b5216a..3621445b8fe3b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2453,35 +2453,16 @@ "@jridgewell/sourcemap-codec" "^1.4.10" "@jridgewell/trace-mapping" "^0.3.9" -"@jridgewell/gen-mapping@^0.3.5": - version "0.3.5" - resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz#dcce6aff74bdf6dad1a95802b69b04a2fcb1fb36" - integrity sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg== - dependencies: - "@jridgewell/set-array" "^1.2.1" - "@jridgewell/sourcemap-codec" "^1.4.10" - "@jridgewell/trace-mapping" "^0.3.24" - "@jridgewell/resolve-uri@3.1.0": version "3.1.0" resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78" integrity sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w== -"@jridgewell/resolve-uri@^3.1.0": - version "3.1.2" - resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz#7a0ee601f60f99a20c7c7c5ff0c80388c1189bd6" - integrity sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw== - "@jridgewell/set-array@^1.0.0", "@jridgewell/set-array@^1.0.1": version "1.1.2" resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== -"@jridgewell/set-array@^1.2.1": - version "1.2.1" - resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.2.1.tgz#558fb6472ed16a4c850b889530e6b36438c49280" - integrity sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A== - "@jridgewell/source-map@^0.3.2": version "0.3.3" resolved "https://registry.yarnpkg.com/@jridgewell/source-map/-/source-map-0.3.3.tgz#8108265659d4c33e72ffe14e33d6cc5eb59f2fda" @@ -2490,20 +2471,12 @@ "@jridgewell/gen-mapping" "^0.3.0" "@jridgewell/trace-mapping" "^0.3.9" -"@jridgewell/source-map@^0.3.3": - version "0.3.6" - resolved "https://registry.yarnpkg.com/@jridgewell/source-map/-/source-map-0.3.6.tgz#9d71ca886e32502eb9362c9a74a46787c36df81a" - integrity sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ== - dependencies: - "@jridgewell/gen-mapping" "^0.3.5" - "@jridgewell/trace-mapping" "^0.3.25" - "@jridgewell/sourcemap-codec@1.4.14", "@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.13": version "1.4.14" resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24" integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== -"@jridgewell/sourcemap-codec@^1.4.14", "@jridgewell/sourcemap-codec@^1.4.15": +"@jridgewell/sourcemap-codec@^1.4.15": version "1.4.15" resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32" integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== @@ -2524,14 +2497,6 @@ "@jridgewell/resolve-uri" "3.1.0" "@jridgewell/sourcemap-codec" "1.4.14" -"@jridgewell/trace-mapping@^0.3.24", "@jridgewell/trace-mapping@^0.3.25": - version "0.3.25" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz#15f190e98895f3fc23276ee14bc76b675c2e50f0" - integrity sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ== - dependencies: - "@jridgewell/resolve-uri" "^3.1.0" - "@jridgewell/sourcemap-codec" "^1.4.14" - "@leichtgewicht/ip-codec@^2.0.1": version "2.0.4" resolved "https://registry.yarnpkg.com/@leichtgewicht/ip-codec/-/ip-codec-2.0.4.tgz#b2ac626d6cb9c8718ab459166d4bb405b8ffa78b" @@ -3724,11 +3689,6 @@ acorn@^8.1.0, acorn@^8.5.0, acorn@^8.7.1, acorn@^8.8.1: resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.2.tgz#1b2f25db02af965399b9776b0c2c391276d37c4a" integrity sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw== -acorn@^8.8.2: - version "8.11.3" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.11.3.tgz#71e0b14e13a4ec160724b38fb7b0f233b1b81d7a" - integrity sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg== - adbkit-logcat@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/adbkit-logcat/-/adbkit-logcat-1.1.0.tgz#01d7f9b0cef9093a30bcb3b007efff301508962f" @@ -15038,16 +14998,6 @@ terser@^5.16.8: commander "^2.20.0" source-map-support "~0.5.20" -terser@^5.30.3: - version "5.30.3" - resolved "https://registry.yarnpkg.com/terser/-/terser-5.30.3.tgz#f1bb68ded42408c316b548e3ec2526d7dd03f4d2" - integrity sha512-STdUgOUx8rLbMGO9IOwHLpCqolkDITFFQSMYYwKE1N2lY6MVSaeoi10z/EhWxRc6ybqoVmKSkhKYH/XUpl7vSA== - dependencies: - "@jridgewell/source-map" "^0.3.3" - acorn "^8.8.2" - commander "^2.20.0" - source-map-support "~0.5.20" - test-exclude@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-6.0.0.tgz#04a8698661d805ea6fa293b6cb9e63ac044ef15e"