Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move remaining things to named exports #18165

Merged
merged 2 commits into from
Feb 28, 2020

Conversation

sebmarkbage
Copy link
Collaborator

The interesting case here is the noop renderers. The wrappers around the reconciler now changed to use a local export that gets mutated.

ReactNoop and ReactNoopPersistent now have to destructure the object to list out the names it's going to export. We should probably refactor ReactNoop away from createReactNoop. Especially since it's also not Flow typed.

@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Feb 27, 2020
@codesandbox-ci
Copy link

codesandbox-ci bot commented Feb 27, 2020

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 1bcfdef:

Sandbox Source
ecstatic-curran-i145q Configuration

@sizebot
Copy link

sizebot commented Feb 27, 2020

Details of bundled changes.

Comparing: 739f20b...1bcfdef

react-flight-dom-webpack

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-flight-dom-webpack-server.browser.development.js -3.0% -4.1% 8.56 KB 8.31 KB 2.8 KB 2.68 KB NODE_DEV
react-flight-dom-webpack-server.browser.production.min.js -1.0% -1.7% 2.61 KB 2.59 KB 1.24 KB 1.22 KB NODE_PROD
react-flight-dom-webpack.development.js -2.6% -4.0% 8.78 KB 8.55 KB 2.46 KB 2.36 KB UMD_DEV
react-flight-dom-webpack.production.min.js -0.4% -0.4% 2.86 KB 2.85 KB 1.32 KB 1.32 KB UMD_PROD
react-flight-dom-webpack.development.js -2.9% -5.1% 8.05 KB 7.81 KB 2.38 KB 2.26 KB NODE_DEV
react-flight-dom-webpack.production.min.js -0.4% -1.8% 2.68 KB 2.67 KB 1.25 KB 1.23 KB NODE_PROD
react-flight-dom-webpack-server.node.development.js -2.6% -3.6% 9.49 KB 9.25 KB 3.06 KB 2.95 KB NODE_DEV
react-flight-dom-webpack-server.node.production.min.js -1.0% -1.9% 2.77 KB 2.75 KB 1.26 KB 1.24 KB NODE_PROD
react-flight-dom-webpack-server.browser.development.js -2.6% -3.1% 9.37 KB 9.13 KB 2.9 KB 2.8 KB UMD_DEV
react-flight-dom-webpack-server.browser.production.min.js -0.5% -0.8% 2.82 KB 2.81 KB 1.32 KB 1.31 KB UMD_PROD

react-noop-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-noop-renderer-flight-client.production.min.js -4.5% -5.5% 537 B 513 B 398 B 376 B NODE_PROD
react-noop-renderer.development.js +9.0% +4.8% 26.87 KB 29.28 KB 5.5 KB 5.76 KB NODE_DEV
react-noop-renderer.production.min.js 🔺+11.3% 🔺+8.9% 10.78 KB 12 KB 3.28 KB 3.57 KB NODE_PROD
react-noop-renderer-server.development.js -11.8% -12.6% 1.81 KB 1.59 KB 854 B 746 B NODE_DEV
react-noop-renderer-server.production.min.js -2.8% -3.9% 864 B 840 B 488 B 469 B NODE_PROD
react-noop-renderer-flight-client.development.js -16.7% -15.2% 1.42 KB 1.18 KB 723 B 613 B NODE_DEV
react-noop-renderer-persistent.development.js +8.9% +4.8% 26.92 KB 29.33 KB 5.51 KB 5.77 KB NODE_DEV
react-noop-renderer-persistent.production.min.js 🔺+11.3% 🔺+8.8% 10.8 KB 12.02 KB 3.29 KB 3.58 KB NODE_PROD
react-noop-renderer-flight-server.development.js -12.3% -11.6% 1.98 KB 1.73 KB 905 B 800 B NODE_DEV
react-noop-renderer-flight-server.production.min.js -2.5% -3.3% 970 B 946 B 541 B 523 B NODE_PROD

react-reconciler

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-reconciler.development.js -0.1% -0.2% 553.49 KB 553.15 KB 116.95 KB 116.76 KB NODE_DEV
react-reconciler-reflection.development.js 0.0% -0.1% 16 KB 16 KB 4.89 KB 4.89 KB NODE_DEV
react-reconciler.production.min.js 🔺+0.1% -0.1% 73.47 KB 73.54 KB 21.72 KB 21.69 KB NODE_PROD
react-reconciler-reflection.production.min.js 0.0% -0.2% 2.8 KB 2.8 KB 1.2 KB 1.2 KB NODE_PROD
react-reconciler-persistent.development.js -0.1% -0.2% 552.17 KB 551.79 KB 116.81 KB 116.6 KB NODE_DEV
react-reconciler-persistent.production.min.js 🔺+0.1% -0.1% 73.48 KB 73.55 KB 21.73 KB 21.7 KB NODE_PROD

react-server

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-server.development.js -7.8% -10.8% 3.99 KB 3.68 KB 1.38 KB 1.23 KB NODE_DEV
react-server.production.min.js -6.7% -6.2% 1.22 KB 1.14 KB 675 B 633 B NODE_PROD
react-server-flight.development.js -3.2% -4.8% 9.45 KB 9.15 KB 2.92 KB 2.78 KB NODE_DEV
react-server-flight.production.min.js -3.5% -4.4% 2.89 KB 2.78 KB 1.31 KB 1.25 KB NODE_PROD

react-debug-tools

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-debug-tools.development.js -1.1% -1.8% 20.49 KB 20.27 KB 5.95 KB 5.84 KB NODE_DEV
react-debug-tools.production.min.js -0.5% -1.0% 6.26 KB 6.23 KB 2.46 KB 2.44 KB NODE_PROD

react-flight

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-flight.production.min.js -2.3% -2.8% 2.5 KB 2.45 KB 1.18 KB 1.15 KB NODE_PROD
react-flight.development.js -3.9% -6.1% 7.45 KB 7.16 KB 2.38 KB 2.23 KB NODE_DEV

Size changes (stable)

Generated by 🚫 dangerJS against 1bcfdef

@sizebot
Copy link

sizebot commented Feb 27, 2020

Details of bundled changes.

Comparing: 739f20b...1bcfdef

react-flight-dom-webpack

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-flight-dom-webpack-server.node.development.js -2.6% -3.5% 9.5 KB 9.26 KB 3.07 KB 2.96 KB NODE_DEV
react-flight-dom-webpack-server.node.production.min.js -1.0% -1.8% 2.79 KB 2.76 KB 1.27 KB 1.25 KB NODE_PROD
react-flight-dom-webpack-server.browser.development.js -2.6% -3.1% 9.38 KB 9.14 KB 2.9 KB 2.81 KB UMD_DEV
react-flight-dom-webpack-server.browser.production.min.js -0.5% -0.8% 2.83 KB 2.82 KB 1.33 KB 1.32 KB UMD_PROD
react-flight-dom-webpack-server.browser.development.js -3.0% -4.2% 8.58 KB 8.32 KB 2.81 KB 2.69 KB NODE_DEV
react-flight-dom-webpack-server.browser.production.min.js -1.0% -1.6% 2.63 KB 2.6 KB 1.25 KB 1.23 KB NODE_PROD
react-flight-dom-webpack.development.js -2.6% -4.0% 8.79 KB 8.57 KB 2.47 KB 2.37 KB UMD_DEV
react-flight-dom-webpack.production.min.js -0.4% -0.4% 2.87 KB 2.86 KB 1.33 KB 1.33 KB UMD_PROD
react-flight-dom-webpack.development.js -2.9% -5.1% 8.06 KB 7.82 KB 2.39 KB 2.26 KB NODE_DEV
react-flight-dom-webpack.production.min.js -0.4% -1.9% 2.69 KB 2.68 KB 1.26 KB 1.24 KB NODE_PROD

react-noop-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-noop-renderer-flight-server.development.js -12.2% -11.5% 1.99 KB 1.75 KB 915 B 810 B NODE_DEV
react-noop-renderer-flight-server.production.min.js -2.4% -3.3% 983 B 959 B 551 B 533 B NODE_PROD
react-noop-renderer-server.development.js -11.8% -12.5% 1.82 KB 1.61 KB 862 B 754 B NODE_DEV
react-noop-renderer-server.production.min.js -2.7% -3.8% 877 B 853 B 497 B 478 B NODE_PROD
react-noop-renderer-persistent.development.js +8.9% +4.7% 26.94 KB 29.34 KB 5.52 KB 5.78 KB NODE_DEV
react-noop-renderer-persistent.production.min.js 🔺+11.3% 🔺+8.8% 10.81 KB 12.04 KB 3.3 KB 3.59 KB NODE_PROD
react-noop-renderer.development.js +9.0% +4.8% 26.88 KB 29.3 KB 5.5 KB 5.77 KB NODE_DEV
react-noop-renderer-flight-client.development.js -16.5% -15.0% 1.43 KB 1.2 KB 732 B 622 B NODE_DEV
react-noop-renderer.production.min.js 🔺+11.3% 🔺+8.9% 10.79 KB 12.01 KB 3.29 KB 3.58 KB NODE_PROD
react-noop-renderer-flight-client.production.min.js -4.4% -5.4% 550 B 526 B 406 B 384 B NODE_PROD

react-server

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-server.development.js -7.8% -10.7% 4 KB 3.69 KB 1.38 KB 1.24 KB NODE_DEV
react-server.production.min.js -6.6% -6.0% 1.23 KB 1.15 KB 682 B 641 B NODE_PROD
react-server-flight.development.js -3.2% -4.8% 9.47 KB 9.17 KB 2.93 KB 2.79 KB NODE_DEV
react-server-flight.production.min.js -2.8% -3.3% 2.88 KB 2.8 KB 1.3 KB 1.26 KB NODE_PROD

react-reconciler

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-reconciler-persistent.development.js -0.1% -0.2% 552.18 KB 551.81 KB 116.82 KB 116.61 KB NODE_DEV
react-reconciler-reflection.development.js 0.0% -0.1% 16.01 KB 16.01 KB 4.9 KB 4.89 KB NODE_DEV
react-reconciler-persistent.production.min.js 🔺+0.1% -0.1% 73.5 KB 73.56 KB 21.73 KB 21.71 KB NODE_PROD
react-reconciler-reflection.production.min.js 0.0% -0.2% 2.81 KB 2.81 KB 1.21 KB 1.21 KB NODE_PROD
react-reconciler.development.js -0.1% -0.2% 574.25 KB 573.91 KB 120.84 KB 120.65 KB NODE_DEV
react-reconciler.production.min.js 🔺+0.1% -0.2% 76.25 KB 76.31 KB 22.4 KB 22.36 KB NODE_PROD

react-flight

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-flight.development.js -3.9% -6.0% 7.46 KB 7.17 KB 2.38 KB 2.24 KB NODE_DEV
react-flight.production.min.js -2.3% -2.8% 2.52 KB 2.46 KB 1.19 KB 1.16 KB NODE_PROD

react-debug-tools

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-debug-tools.development.js -1.1% -1.8% 20.5 KB 20.28 KB 5.96 KB 5.85 KB NODE_DEV
react-debug-tools.production.min.js -0.5% -0.9% 6.27 KB 6.24 KB 2.47 KB 2.45 KB NODE_PROD

Size changes (experimental)

Generated by 🚫 dangerJS against 1bcfdef

const Rectangle = require('./npm/Rectangle');

module.exports = Rectangle;
export {default} from './npm/Rectangle';
Copy link
Collaborator

Choose a reason for hiding this comment

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

How does this work? Aren’t they still CJS?

Copy link
Collaborator Author

@sebmarkbage sebmarkbage Feb 28, 2020

Choose a reason for hiding this comment

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

Yea, for now. But once ART switches to ES modules we can switch the inner implementation too. This change doesn't do much since this file isn't actually built anyway. Just gets us one step closer.

Verified

This commit was signed with the committer’s verified signature.
cwschilly Caleb Schilly
The interesting case here is the noop renderers. The wrappers around the
reconciler now changed to use a local export that gets mutated.

ReactNoop and ReactNoopPersistent now have to destructure the object to
list out the names it's going to export. We should probably refactor
ReactNoop away from createReactNoop. Especially since it's also not Flow
typed.
This will have esModule compatibility flag on them. They should ideally
export default instead.
@sebmarkbage sebmarkbage merged commit 549e418 into facebook:master Feb 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants