Skip to content

Add react-flight-server-fb package for Meta's internal bundler#36309

Merged
imdreamrunner merged 1 commit intofacebook:mainfrom
imdreamrunner:main
Apr 27, 2026
Merged

Add react-flight-server-fb package for Meta's internal bundler#36309
imdreamrunner merged 1 commit intofacebook:mainfrom
imdreamrunner:main

Conversation

@imdreamrunner
Copy link
Copy Markdown
Contributor

@imdreamrunner imdreamrunner commented Apr 17, 2026

Summary

  • Adds a new react-flight-server-fb package providing RSC Flight bindings for Meta's internal bundler stack
  • Unlike webpack/turbopack integrations, this uses no manifest. Module metadata is self-contained in ClientReference objects and sent over the wire as-is
  • Registers dom-browser-fb and dom-node-fb host configs for Rollup builds targeting FB_WWW_DEV and FB_WWW_PROD

Key design differences from other bundler

  • No build-time manifest
  • Module IDs use Haste module names (e.g. "MyComponent"), with named exports encoded as "Module#export", rather than file paths resolved through a manifest
  • Client-side loading uses Bootloader.handlePayload() + JSResource().load()
  • resolveClientReferenceMetadata and resolveClientReference are pass-throughs

How did you test this change?

E2E integration test is set up on Meta's internal system.

@meta-cla meta-cla Bot added the CLA Signed label Apr 17, 2026
@imdreamrunner imdreamrunner force-pushed the main branch 4 times, most recently from 38b6fd5 to 1d38154 Compare April 17, 2026 17:51
@imdreamrunner imdreamrunner marked this pull request as ready for review April 17, 2026 17:53
@imdreamrunner imdreamrunner force-pushed the main branch 5 times, most recently from cdc4d48 to 2814e1c Compare April 23, 2026 03:58
@react-sizebot
Copy link
Copy Markdown

react-sizebot commented Apr 23, 2026

Comparing: 561ed52...8895570

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.js = 6.84 kB 6.84 kB +0.16% 1.88 kB 1.88 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 612.85 kB 612.85 kB = 108.29 kB 108.29 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.84 kB 6.84 kB +0.11% 1.88 kB 1.89 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 678.78 kB 678.78 kB = 119.26 kB 119.26 kB
facebook-www/ReactDOM-prod.classic.js = 698.52 kB 698.52 kB = 122.73 kB 122.73 kB
facebook-www/ReactDOM-prod.modern.js = 688.83 kB 688.83 kB = 121.11 kB 121.11 kB
facebook-www/ReactFlightClient-dev.classic.js New file 0.00 kB 189.48 kB New file 0.00 kB 33.44 kB
facebook-www/ReactFlightClient-dev.modern.js New file 0.00 kB 189.48 kB New file 0.00 kB 33.44 kB
facebook-www/ReactFlightClient-prod.classic.js New file 0.00 kB 61.33 kB New file 0.00 kB 11.86 kB
facebook-www/ReactFlightClient-prod.modern.js New file 0.00 kB 61.33 kB New file 0.00 kB 11.86 kB
facebook-www/ReactFlightServer-dev.classic.js New file 0.00 kB 198.74 kB New file 0.00 kB 35.96 kB
facebook-www/ReactFlightServer-dev.modern.js New file 0.00 kB 198.74 kB New file 0.00 kB 35.96 kB
facebook-www/ReactFlightServer-prod.classic.js New file 0.00 kB 102.72 kB New file 0.00 kB 20.81 kB
facebook-www/ReactFlightServer-prod.modern.js New file 0.00 kB 102.72 kB New file 0.00 kB 20.81 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
facebook-www/ReactFlightClient-dev.classic.js New file 0.00 kB 189.48 kB New file 0.00 kB 33.44 kB
facebook-www/ReactFlightClient-dev.modern.js New file 0.00 kB 189.48 kB New file 0.00 kB 33.44 kB
facebook-www/ReactFlightClient-prod.classic.js New file 0.00 kB 61.33 kB New file 0.00 kB 11.86 kB
facebook-www/ReactFlightClient-prod.modern.js New file 0.00 kB 61.33 kB New file 0.00 kB 11.86 kB
facebook-www/ReactFlightServer-dev.classic.js New file 0.00 kB 198.74 kB New file 0.00 kB 35.96 kB
facebook-www/ReactFlightServer-dev.modern.js New file 0.00 kB 198.74 kB New file 0.00 kB 35.96 kB
facebook-www/ReactFlightServer-prod.classic.js New file 0.00 kB 102.72 kB New file 0.00 kB 20.81 kB
facebook-www/ReactFlightServer-prod.modern.js New file 0.00 kB 102.72 kB New file 0.00 kB 20.81 kB

Generated by 🚫 dangerJS against 8895570

@imdreamrunner imdreamrunner force-pushed the main branch 2 times, most recently from 58526df to 52ed8aa Compare April 24, 2026 20:29
@imdreamrunner
Copy link
Copy Markdown
Contributor Author

Cache version of GitHub Workflows was bump to set up symlink correctly https://gist.github.com/imdreamrunner/3f4b49cd662140c38e8bfdde57cb167f

@imdreamrunner imdreamrunner merged commit ad5dfc8 into facebook:main Apr 27, 2026
237 of 238 checks passed
github-actions Bot pushed a commit that referenced this pull request Apr 27, 2026
<!--
  Thanks for submitting a pull request!
We appreciate you spending the time to work on these changes. Please
provide enough information so that others can review your pull request.
The three fields below are mandatory.

Before submitting a pull request, please make sure the following is
done:

1. Fork [the repository](https://github.com/facebook/react) and create
your branch from `main`.
  2. Run `yarn` in the repository root.
3. If you've fixed a bug or added code that should be tested, add tests!
4. Ensure the test suite passes (`yarn test`). Tip: `yarn test --watch
TestName` is helpful in development.
5. Run `yarn test --prod` to test in the production environment. It
supports the same options as `yarn test`.
6. If you need a debugger, run `yarn test --debug --watch TestName`,
open `chrome://inspect`, and press "Inspect".
7. Format your code with
[prettier](https://github.com/prettier/prettier) (`yarn prettier`).
8. Make sure your code lints (`yarn lint`). Tip: `yarn linc` to only
check changed files.
  9. Run the [Flow](https://flowtype.org/) type checks (`yarn flow`).
  10. If you haven't already, complete the CLA.

Learn more about contributing:
https://reactjs.org/docs/how-to-contribute.html
-->

## Summary

<!--
Explain the **motivation** for making this change. What existing problem
does the pull request solve?
-->

- Adds a new react-flight-server-fb package providing RSC Flight
bindings for Meta's internal bundler stack
- Unlike webpack/turbopack integrations, this uses no manifest. Module
metadata is self-contained in ClientReference objects and sent over the
wire as-is
- Registers dom-browser-fb and dom-node-fb host configs for Rollup
builds targeting FB_WWW_DEV and FB_WWW_PROD

 Key design differences from other bundler

 - No build-time manifest
- Module IDs use Haste module names (e.g. `"MyComponent"`), with named
exports encoded as `"Module#export"`, rather than file paths resolved
through a manifest
- Client-side loading uses `Bootloader.handlePayload()` +
`JSResource().load()`
- `resolveClientReferenceMetadata` and `resolveClientReference` are
pass-throughs

## How did you test this change?

<!--
Demonstrate the code is solid. Example: The exact commands you ran and
their output, screenshots / videos if the pull request changes the user
interface.
How exactly did you verify that your PR solves the issue you wanted to
solve?
  If you leave this empty, your PR will very likely be closed.
-->

E2E integration test is set up on Meta's internal system.

DiffTrain build for [ad5dfc8](ad5dfc8)
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.

3 participants