Commit c57f93e
committed
Run Closure on non-minified prod builds, too (#28827)
In #26446 we started publishing non-minified versions of our production
build artifacts, along with source maps, for easier debugging of React
when running in production mode.
The way it's currently set up is that these builds are generated
*before* Closure compiler has run. Which means it's missing many of the
optimizations that are in the final build, like dead code elimination.
This PR changes the build process to run Closure on the non-minified
production builds, too, by moving the sourcemap generation to later in
the pipeline.
The non-minified builds will still preserve the original symbol names,
and we'll use Prettier to add back whitespace. This is the exact same
approach we've been using for years to generate production builds for
Meta.
The idea is that the only difference between the minified and non-
minified builds is whitespace and symbol mangling. The semantic
structure of the program should be identical.
To implement this, I disabled symbol mangling when running Closure
compiler. Then, in a later step, the symbols are mangled by Terser. This
is when the source maps are generated.
DiffTrain build for commit 0e0b693.1 parent 9fbfbd2 commit c57f93e
File tree
10 files changed
+72396
-86095
lines changed- compiled-rn/facebook-fbsource/xplat/js
- RKJSModules/vendor
- react-is/cjs
- react-test-renderer/cjs
- react/cjs
- scheduler/cjs
- react-native-github/Libraries/Renderer
- implementations
10 files changed
+72396
-86095
lines changedLines changed: 185 additions & 210 deletions
Large diffs are not rendered by default.
Lines changed: 19994 additions & 23849 deletions
Large diffs are not rendered by default.
Lines changed: 1257 additions & 1428 deletions
Large diffs are not rendered by default.
Lines changed: 1283 additions & 1466 deletions
Large diffs are not rendered by default.
Lines changed: 2948 additions & 3399 deletions
Large diffs are not rendered by default.
Lines changed: 530 additions & 526 deletions
Large diffs are not rendered by default.
Lines changed: 594 additions & 606 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
0 commit comments