Skip to content

Conversation

@RiskyMH
Copy link
Contributor

@RiskyMH RiskyMH commented Aug 13, 2025

Summary

fixes remix-run/react-router#12568, fixes #33612

The custom bun export condition seems to be missing some of the newer apis that normal node one has, so this PR adds the missing exports so that users of bun don't have errors.

How did you test this change?

used the built output and verified the functions are now present in the bun bundles

@meta-cla
Copy link

meta-cla bot commented Aug 13, 2025

Hi @RiskyMH!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@meta-cla meta-cla bot added the CLA Signed label Aug 13, 2025
@react-sizebot
Copy link

react-sizebot commented Aug 13, 2025

Comparing: 1d68bce...f4fe9ed

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.68 kB 6.68 kB = 1.83 kB 1.83 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 605.42 kB 605.42 kB = 107.21 kB 107.21 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.69 kB 6.69 kB = 1.83 kB 1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 664.39 kB 664.39 kB = 117.09 kB 117.09 kB
facebook-www/ReactDOM-prod.classic.js = 688.26 kB 688.26 kB = 121.13 kB 121.13 kB
facebook-www/ReactDOM-prod.modern.js = 678.69 kB 678.69 kB = 119.48 kB 119.48 kB
oss-experimental/react-dom/server.bun.js +21.11% 0.56 kB 0.68 kB +5.28% 0.25 kB 0.26 kB
oss-stable-semver/react-dom/server.bun.js +21.11% 0.56 kB 0.68 kB +5.28% 0.25 kB 0.26 kB
oss-stable/react-dom/server.bun.js +21.11% 0.56 kB 0.68 kB +5.28% 0.25 kB 0.26 kB
oss-stable-semver/react-dom/cjs/react-dom-server.bun.production.js +7.29% 259.62 kB 278.56 kB +3.82% 47.14 kB 48.94 kB
oss-stable/react-dom/cjs/react-dom-server.bun.production.js +7.29% 259.70 kB 278.64 kB +3.82% 47.17 kB 48.97 kB
oss-experimental/react-dom/cjs/react-dom-server.bun.production.js +6.85% 276.52 kB 295.45 kB +3.64% 49.57 kB 51.37 kB
oss-stable-semver/react-dom/cjs/react-dom-server.bun.development.js +5.22% 364.32 kB 383.34 kB +2.47% 70.80 kB 72.55 kB
oss-stable/react-dom/cjs/react-dom-server.bun.development.js +5.22% 364.39 kB 383.41 kB +2.46% 70.83 kB 72.58 kB
oss-experimental/react-dom/cjs/react-dom-server.bun.development.js +4.94% 385.15 kB 404.17 kB +2.39% 73.76 kB 75.52 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
oss-experimental/react-dom/server.bun.js +21.11% 0.56 kB 0.68 kB +5.28% 0.25 kB 0.26 kB
oss-stable-semver/react-dom/server.bun.js +21.11% 0.56 kB 0.68 kB +5.28% 0.25 kB 0.26 kB
oss-stable/react-dom/server.bun.js +21.11% 0.56 kB 0.68 kB +5.28% 0.25 kB 0.26 kB
oss-stable-semver/react-dom/cjs/react-dom-server.bun.production.js +7.29% 259.62 kB 278.56 kB +3.82% 47.14 kB 48.94 kB
oss-stable/react-dom/cjs/react-dom-server.bun.production.js +7.29% 259.70 kB 278.64 kB +3.82% 47.17 kB 48.97 kB
oss-experimental/react-dom/cjs/react-dom-server.bun.production.js +6.85% 276.52 kB 295.45 kB +3.64% 49.57 kB 51.37 kB
oss-stable-semver/react-dom/cjs/react-dom-server.bun.development.js +5.22% 364.32 kB 383.34 kB +2.47% 70.80 kB 72.55 kB
oss-stable/react-dom/cjs/react-dom-server.bun.development.js +5.22% 364.39 kB 383.41 kB +2.46% 70.83 kB 72.58 kB
oss-experimental/react-dom/cjs/react-dom-server.bun.development.js +4.94% 385.15 kB 404.17 kB +2.39% 73.76 kB 75.52 kB

Generated by 🚫 dangerJS against f4fe9ed

@RiskyMH
Copy link
Contributor Author

RiskyMH commented Sep 12, 2025

"207": "ReactDOMServer.renderToNodeStream(): The streaming API is not available in the browser. Use ReactDOMServer.renderToString() instead.",
"208": "ReactDOMServer.renderToStaticNodeStream(): The streaming API is not available in the browser. Use ReactDOMServer.renderToStaticMarkup() instead.",

i wonder if these can be removed/edited now that bun actually supports node:stream well and thus the same apis as node (just with extra perf in some web api cases).

…ct-dom

# Conflicts:
#	packages/react-dom/npm/server.bun.js
@RiskyMH RiskyMH requested a review from eps1lon October 7, 2025 19:44
@eps1lon
Copy link
Collaborator

eps1lon commented Oct 13, 2025

i wonder if these can be removed/edited now that bun actually supports node:stream well and thus the same apis as node (just with extra perf in some web api cases).

These codes need to work for older versions of React. It seems like this message is specific to browser builds not Bun builds.

@janhesters
Copy link

Thanks @RiskyMH for creating this!

@eps1lon eps1lon changed the title Update bun's condition of react-dom/server to have latest normal node functions [react-dom] Include all Node.js APIs in Bun entrypoint for /server Oct 27, 2025
Copy link
Collaborator

@eps1lon eps1lon left a comment

Choose a reason for hiding this comment

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

Thank you!

@eps1lon eps1lon merged commit b4455a6 into facebook:main Oct 27, 2025
240 of 241 checks passed
@RiskyMH RiskyMH deleted the riskymh/upd-bun-react-dom branch October 28, 2025 00:26
github-actions bot pushed a commit to rickhanlonii/react that referenced this pull request Oct 28, 2025
github-actions bot pushed a commit to rickhanlonii/react that referenced this pull request Oct 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

4 participants