Skip to content

Rollup freeze: false#12879

Merged
bvaughn merged 2 commits into
react:masterfrom
bvaughn:dont-freeze-bundles
May 22, 2018
Merged

Rollup freeze: false#12879
bvaughn merged 2 commits into
react:masterfrom
bvaughn:dont-freeze-bundles

Conversation

@bvaughn

@bvaughn bvaughn commented May 22, 2018

Copy link
Copy Markdown
Contributor

Rollup freezes several imported modules in our current bundle. This doesn't really seem necessary, so I've updated the Rollup config to not freeze bundles for the production build.

react-dom.development.js diff

(no diff)

react-dom.production.min.js diff

After running both files through Prettier.

147c147
< var va = Object.freeze({
---
> var va = {
155c155
<   }),
---
>   },
247c247
< var Ka = Object.freeze({
---
> var Ka = {
252c252
<   }),
---
>   },
273c273
< var Qa = Object.freeze({
---
> var Qa = {
287c287
< });
---
> };
360c360
< var $a = Object.freeze({
---
> var $a = {
369c369
< });
---
> };
710c710
< var Rb = Object.freeze({
---
> var Rb = {
715c715
< });
---
> };
1780c1780
< var Md = Object.freeze({
---
> var Md = {
1791c1791
<   }),
---
>   },
2619c2619
< var We = Object.freeze({
---
> var We = {
2660c2660
<   }),
---
>   },
5336c5336
< var gi = Object.freeze({
---
> var gi = {
5373c5373
< });
---
> };
5610c5610
< var vi = Object.freeze({ default: qi }),
---
> var vi = { default: qi },

@gaearon gaearon left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine.

@gaearon

gaearon commented May 22, 2018

Copy link
Copy Markdown
Collaborator

I think maybe we could leave it on in development. This discourages our internal code from trying to override the modules that are currently exposed (but won't be in the future). Thus reducing the surface area for things we might need to clean up.

@bvaughn

bvaughn commented May 22, 2018

Copy link
Copy Markdown
Contributor Author

That seems reasonable. I'll update the diff.

@pull-bot

pull-bot commented May 22, 2018

Copy link
Copy Markdown

ReactDOM: size: -0.1%, gzip: -0.1%

Details of bundled changes.

Comparing: 60853f0...70d25b5

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom.production.min.js -0.1% -0.1% 93.76 KB 93.63 KB 30.34 KB 30.32 KB UMD_PROD
react-dom.production.min.js -0.1% -0.1% 92.26 KB 92.13 KB 29.33 KB 29.3 KB NODE_PROD
react-dom-test-utils.production.min.js -0.1% -0.3% 10.42 KB 10.4 KB 3.84 KB 3.83 KB UMD_PROD
react-dom-test-utils.production.min.js -0.2% -0.3% 9.7 KB 9.68 KB 3.62 KB 3.61 KB NODE_PROD
react-dom-unstable-native-dependencies.production.min.js -0.1% -0.3% 11.37 KB 11.35 KB 3.92 KB 3.91 KB UMD_PROD
react-dom-unstable-native-dependencies.production.min.js -0.2% -0.5% 10.71 KB 10.68 KB 3.67 KB 3.66 KB NODE_PROD
react-dom-server.browser.production.min.js -0.1% -0.2% 15.07 KB 15.06 KB 5.77 KB 5.76 KB UMD_PROD
react-dom-server.browser.production.min.js -0.1% -0.1% 14.44 KB 14.42 KB 5.52 KB 5.51 KB NODE_PROD
react-dom-server.node.production.min.js -0.1% -0.1% 15.24 KB 15.23 KB 5.81 KB 5.81 KB NODE_PROD
ReactDOM-prod.js -0.1% -0.1% 273.93 KB 273.62 KB 51.59 KB 51.53 KB FB_WWW_PROD
ReactDOMUnstableNativeDependencies-prod.js -0.4% -0.6% 26.35 KB 26.25 KB 5.37 KB 5.34 KB FB_WWW_PROD
ReactDOMServer-prod.js -0.1% -0.2% 31.42 KB 31.39 KB 7.73 KB 7.71 KB FB_WWW_PROD

Generated by 🚫 dangerJS

@bvaughn bvaughn merged commit 7c0aca2 into react:master May 22, 2018
@bvaughn bvaughn deleted the dont-freeze-bundles branch May 22, 2018 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants