-
Notifications
You must be signed in to change notification settings - Fork 46.9k
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
[Fizz] Add FB specific streaming API and build #21337
Conversation
Comparing: c3cb2c2...05075f7 Critical size changesIncludes critical production bundles, as well as any change greater than 2%:
Significant size changesIncludes any change greater than 0.2%: Expand to show
|
Summary: This sync includes the following changes: - **[9a2591681](facebook/react@9a2591681 )**: Fix export //<Sebastian Markbage>// - **[4a8deb083](facebook/react@4a8deb083 )**: Switch the isPrimaryRender flag based on the stream config ([#21357](facebook/react#21357)) //<Sebastian Markbåge>// - **[bd4f056a3](facebook/react@bd4f056a3 )**: [Fizz] Implement lazy components and nodes ([#21355](facebook/react#21355)) //<Sebastian Markbåge>// - **[fc33f12bd](facebook/react@fc33f12bd )**: Remove unstable scheduler/tracing API ([#20037](facebook/react#20037)) //<Brian Vaughn>// - **[721238394](facebook/react@721238394 )**: Enable strict effects mode for React Native Facebook builds ([#21354](facebook/react#21354)) //<Brian Vaughn>// - **[48740429b](facebook/react@48740429b )**: Expiration: Do nothing except disable time slicing ([#21345](facebook/react#21345)) //<Andrew Clark>// - **[0f5ebf366](facebook/react@0f5ebf366 )**: Delete unreferenced type ([#21343](facebook/react#21343)) //<Andrew Clark>// - **[9cd52b27f](facebook/react@9cd52b27f )**: Restore context after an error happens ([#21341](facebook/react#21341)) //<Sebastian Markbåge>// - **[ad091759a](facebook/react@ad091759a )**: Revert "Emit reactroot attribute on the first element we discover ([#21154](facebook/react#21154))" ([#21340](facebook/react#21340)) //<Sebastian Markbåge>// - **[709f94841](facebook/react@709f94841 )**: [Fizz] Add FB specific streaming API and build ([#21337](facebook/react#21337)) //<Sebastian Markbåge>// - **[e8cdce40d](facebook/react@e8cdce40d )**: Don't flush sync at end of discreteUpdates ([#21327](facebook/react#21327)) //<Andrew Clark>// - **[a15586001](facebook/react@a15586001 )**: Fix: Don't flush discrete at end of batchedUpdates ([#21229](facebook/react#21229)) //<Andrew Clark>// - **[89847bf6e](facebook/react@89847bf6e )**: Continuous updates should interrupt transitions ([#21323](facebook/react#21323)) //<Andrew Clark>// - **[ef37d55b6](facebook/react@ef37d55b6 )**: Use performConcurrentWorkOnRoot for "sync default" ([#21322](facebook/react#21322)) //<Andrew Clark>// Changelog: [General][Changed] - React Native sync for revisions a632f7d...2a7bb41 jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D28063006 fbshipit-source-id: 7e3535f80961706863b6c2188ee44b5796b2f000
Add FB specific streaming API and build
I wonder how this PR was able to land given that react/scripts/rollup/packaging.js Lines 149 to 152 in 50263d3
The build script also throws if there's no react/scripts/rollup/packaging.js Lines 193 to 196 in 50263d3
Are we filtering out private packages somewhere? |
Seems we don’t get there if there wasn’t a node_modules built which there wouldn’t be for FB-only builds. Like if there’s no NODE_PROD. react/scripts/rollup/packaging.js Line 213 in cae6350
|
Hm. When I build all packages locally, |
We don't have either Browser nor Node streams at FB WWW. This adds a specific ServerStreamConfig and exported API for this purpose. It's not necessarily optimal. E.g. this doesn't take advantage of back pressure, sharing buffers with the underlying sink and doesn't support TypedArrays. It's just closest to what we already have but we can iterate on this independently.
We also happen to import React with custom builds instead of npm. So I build it separately without an entry point.
It's kinds of similar to what we do with Flight for Relay so I just added it under that folder and it's flow typed under the "dom-relay" flag to avoid having too many Flow passes.
I made a new build that builds to ReactDOMServer.js but only in EXPERIMENTAL which is actually "modern" builds. So the net effect will be that ReactDOMServer.modern.js is Fizz.
I plan on moving Fizz onto the main
react-dom/server
export but it's difficult because we need it to export multiple builds which goes against the grain of our system atm. But the idea is to export both and then remove legacy. So this is just jumping ahead to the last step for FB.This structure probably doesn't make much sense overall but it is what it is.