Skip to content

Conversation

gaearon
Copy link
Collaborator

@gaearon gaearon commented Feb 10, 2020

So that we can start testing slimmer builds internally.

Currently these are 100% matching the FB_WWW classic builds. I verified by building both modes and diffing them. In a follow-up PR, I will fork the feature flags and make some other changes for them.

@facebook-github-bot facebook-github-bot added the React Core Team Opened by a member of the React Core Team label Feb 10, 2020
@codesandbox-ci
Copy link

codesandbox-ci bot commented Feb 10, 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 dc02c9e:

Sandbox Source
proud-glitter-sqfzu Configuration

@sizebot
Copy link

sizebot commented Feb 10, 2020

No significant bundle size changes to report.

Size changes (stable)

Generated by 🚫 dangerJS against dc02c9e

@sizebot
Copy link

sizebot commented Feb 10, 2020

Details of bundled changes.

Comparing: 517de74...dc02c9e

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom.profiling.min.js 0.0% -0.0% 123.58 KB 123.58 KB 39.57 KB 39.57 KB UMD_PROFILING
react-dom-test-utils.production.min.js 0.0% -0.1% 10.99 KB 10.99 KB 4.1 KB 4.1 KB NODE_PROD
react-dom.development.js 0.0% -0.0% 959.23 KB 959.23 KB 215.41 KB 215.4 KB NODE_DEV
ReactDOMTesting-dev.js 0.0% -0.0% 985.25 KB 985.25 KB 217.47 KB 217.47 KB FB_WWW_DEV
ReactDOMModern-dev.js n/a n/a 0 B 986.73 KB 0 B 218.2 KB FB_WWW_MODERN_DEV
react-dom-unstable-native-dependencies.development.js 0.0% -0.0% 60.93 KB 60.93 KB 16.08 KB 16.07 KB UMD_DEV
react-dom-server.node.production.min.js 0.0% -0.0% 20.79 KB 20.79 KB 7.62 KB 7.62 KB NODE_PROD
ReactDOMModern-prod.js n/a n/a 0 B 393.59 KB 0 B 71.93 KB FB_WWW_MODERN_PROD
react-dom-unstable-native-dependencies.production.min.js 0.0% -0.1% 10.25 KB 10.25 KB 3.47 KB 3.47 KB UMD_PROD
react-dom-server.browser.development.js 0.0% -0.0% 135.26 KB 135.26 KB 35.92 KB 35.91 KB NODE_DEV
ReactDOMModern-profiling.js n/a n/a 0 B 404.84 KB 0 B 74.09 KB FB_WWW_MODERN_PROFILING
react-dom-server.browser.production.min.js 0.0% -0.0% 20.39 KB 20.39 KB 7.47 KB 7.47 KB NODE_PROD
react-dom-unstable-native-dependencies.development.js 0.0% -0.0% 60.63 KB 60.63 KB 16 KB 16 KB NODE_DEV
react-dom-testing.development.js 0.0% -0.0% 962.56 KB 962.56 KB 216.1 KB 216.09 KB UMD_DEV
react-dom-unstable-native-dependencies.production.min.js 0.0% -0.1% 9.99 KB 9.99 KB 3.38 KB 3.38 KB NODE_PROD
react-dom-testing.production.min.js 0.0% -0.0% 117.6 KB 117.6 KB 37.9 KB 37.9 KB UMD_PROD
react-dom-test-utils.development.js 0.0% -0.0% 55.39 KB 55.39 KB 15.59 KB 15.59 KB UMD_DEV
react-dom-testing.profiling.min.js 0.0% -0.0% 121.12 KB 121.12 KB 39.04 KB 39.04 KB UMD_PROFILING
react-dom-test-utils.production.min.js 0.0% -0.0% 11.21 KB 11.21 KB 4.17 KB 4.16 KB UMD_PROD
react-dom-testing.development.js 0.0% -0.0% 956.65 KB 956.65 KB 214.4 KB 214.4 KB NODE_DEV
ReactDOMServer-dev.js 0.0% -0.0% 140.42 KB 140.42 KB 35.55 KB 35.55 KB FB_WWW_DEV
react-dom.development.js 0.0% -0.0% 965.14 KB 965.14 KB 217.07 KB 217.07 KB UMD_DEV
react-dom-testing.production.min.js 0.0% -0.0% 117.69 KB 117.69 KB 37.25 KB 37.25 KB NODE_PROD
ReactDOMServer-prod.js 0.0% -0.0% 48.99 KB 48.99 KB 11.18 KB 11.18 KB FB_WWW_PROD
react-dom.production.min.js 0.0% -0.0% 119.94 KB 119.94 KB 38.42 KB 38.41 KB UMD_PROD
react-dom-test-utils.development.js 0.0% -0.0% 53.66 KB 53.66 KB 15.27 KB 15.27 KB NODE_DEV
react-dom-testing.profiling.min.js 0.0% -0.0% 121.37 KB 121.37 KB 38.36 KB 38.36 KB NODE_PROFILING
react-dom.production.min.js 0.0% -0.0% 120.03 KB 120.03 KB 37.66 KB 37.66 KB NODE_PROD
ReactDOMTesting-prod.js 0.0% -0.0% 340.91 KB 340.91 KB 62.23 KB 62.23 KB FB_WWW_PROD
react-dom.profiling.min.js 0.0% -0.0% 123.81 KB 123.81 KB 38.77 KB 38.77 KB NODE_PROFILING
ReactDOMTesting-profiling.js 0.0% -0.0% 351.69 KB 351.69 KB 64.18 KB 64.18 KB FB_WWW_PROFILING
react-dom-unstable-fizz.browser.development.js 0.0% -0.1% 3.88 KB 3.88 KB 1.55 KB 1.55 KB UMD_DEV
react-dom-unstable-fizz.browser.production.min.js 0.0% -0.3% 1.21 KB 1.21 KB 711 B 709 B UMD_PROD
react-dom-unstable-fizz.node.development.js 0.0% -0.1% 4.42 KB 4.42 KB 1.65 KB 1.65 KB NODE_DEV
react-dom-unstable-fizz.node.production.min.js 0.0% -0.3% 1.21 KB 1.21 KB 698 B 696 B NODE_PROD
ReactDOM-dev.js 0.0% -0.0% 986.73 KB 986.73 KB 218.2 KB 218.2 KB FB_WWW_DEV
react-dom-unstable-fizz.browser.development.js 0.0% -0.1% 3.71 KB 3.71 KB 1.5 KB 1.5 KB NODE_DEV
ReactDOM-prod.js 0.0% 0.0% 393.59 KB 393.59 KB 71.93 KB 71.93 KB FB_WWW_PROD
react-dom-server.browser.development.js 0.0% -0.0% 139.32 KB 139.32 KB 36.94 KB 36.94 KB UMD_DEV
react-dom-unstable-fizz.browser.production.min.js 0.0% -0.3% 1.05 KB 1.05 KB 642 B 640 B NODE_PROD
ReactDOM-profiling.js 0.0% -0.0% 404.84 KB 404.84 KB 74.09 KB 74.09 KB FB_WWW_PROFILING
react-dom-server.node.development.js 0.0% -0.0% 136.37 KB 136.37 KB 36.15 KB 36.14 KB NODE_DEV

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

Size changes (experimental)

Generated by 🚫 dangerJS against dc02c9e

Copy link
Collaborator

@acdlite acdlite left a comment

Choose a reason for hiding this comment

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

When we eventually publish Modern builds to npm, the plan is to publish them as separate versions: 18.x versus 17.x. So unlike¹ the dev, prod, and profiling builds, the Modern and Classic builds aren't "side-by-side" artifacts that you switch between with build configuration (i.e. replacing process.env.NODE_ENV for dev versus prod, or using a Webpack alias for profiling). The way you switch between them is by installing a different version.

This is already how the Experimental builds work. So we can reuse that concept instead of adding a new one. There's no such thing as a Stable www build currently — we always pull from Experimental. Let's change it so that Stable in www represents the Classic build and Experimental represents the Modern build.

We'll need to update the sync script to pull both types of artifacts. We can copy the Stable artifacts into one subdirectory, and the Experimental ones into another. The names of all the files are identical except for which subdirectory they live in.

The feature flags in ReactFeatureFlags.www.js that are currently set to __EXPERIMENTAL__ should be set to true. Any new features meant for the modern builds will be set to __EXPERIMENTAL__.

¹ Although it occurs to me as I write this that we actually could publish separate versions for dev, prod, and profiling; e.g. 17.0.0 gives you a dev bundle and 17.0.0-prod gives you a prod bundle. Something to consider as an alternative to process.env.NODE_ENV.

@gaearon
Copy link
Collaborator Author

gaearon commented Feb 11, 2020

That was exactly what I suggested to Seb, but he said he wants another feature flag file instead. Either I misunderstood what he was proposing, or we might want to chat about this all together.

@gaearon
Copy link
Collaborator Author

gaearon commented Feb 11, 2020

That said, I find the idea of “experimental” meaning different things in fbsource and WWW scary. That’s why I scoped it to clearly be a WWW only thing.

@acdlite
Copy link
Collaborator

acdlite commented Feb 11, 2020

Might have been a misunderstanding. @sebmarkbage and I chatted offline. Let’s discuss at the meeting!

@gaearon
Copy link
Collaborator Author

gaearon commented Feb 11, 2020

Cool, no worries! Just want to make sure we agree 100% before I rewrite :-)

@gaearon
Copy link
Collaborator Author

gaearon commented Feb 12, 2020

The names of all the files are identical except for which subdirectory they live in.

We'll have to enable Haste packages for this to work, right? I guess you need to either way because of the "two Reacts" thing.

@gaearon gaearon closed this Feb 12, 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.

5 participants