-
Notifications
You must be signed in to change notification settings - Fork 49.3k
Add FB_WWW_MODERN bundle types #18009
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
Conversation
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:
|
Details of bundled changes.Comparing: 517de74...dc02c9e react-dom
ReactDOM: size: 0.0%, gzip: -0.1% Size changes (experimental) |
There was a problem hiding this 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
.
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. |
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. |
Might have been a misunderstanding. @sebmarkbage and I chatted offline. Let’s discuss at the meeting! |
Cool, no worries! Just want to make sure we agree 100% before I rewrite :-) |
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. |
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.