react icon indicating copy to clipboard operation
react copied to clipboard

fix: react-dom/server hanging on Deno

Open fraidev opened this issue 3 months ago • 2 comments

Reopen of https://github.com/facebook/react/pull/30655

Solution for: https://github.com/facebook/react/issues/35231

fraidev avatar Nov 27 '25 15:11 fraidev

Hi @fraidev!

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[bot] avatar Nov 27 '25 15:11 meta-cla[bot]

Hey Bartek from the Deno team here - I wanted to provide additional context on this PR. We've had another report from users saying that apps using React hang in Deno. We traced down the culprit to a MessagePort that keeps the program alive - this makes sense in the browser, but in Deno we would definitely prefer to default to Node.js bundle - these days Deno behaves more like Node.js instance than a browser.

bartlomieju avatar Nov 28 '25 09:11 bartlomieju

Comparing: 0526c799d4df2815aed73912bfbd26fc0102ffc3...ed25ea1d89cf49e2e27d4903e9374ff9236787cd

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 = 1.88 kB 1.88 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 608.36 kB 608.36 kB = 107.68 kB 107.68 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.84 kB 6.84 kB = 1.88 kB 1.88 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 667.47 kB 667.47 kB = 117.57 kB 117.57 kB
facebook-www/ReactDOM-prod.classic.js = 693.67 kB 693.67 kB = 122.07 kB 122.06 kB
facebook-www/ReactDOM-prod.modern.js = 684.10 kB 684.10 kB = 120.45 kB 120.44 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by :no_entry_sign: dangerJS against ed25ea1d89cf49e2e27d4903e9374ff9236787cd

react-sizebot avatar Dec 04 '25 05:12 react-sizebot

@bartlomieju Thanks for confirming. I'm going to merge this. I double checked that Deno supports all the modules react-dom/server needs: async_hooks (only AsyncLocalStorage), crypto, stream, and util.

Notably, async_hooks wasn't listed in https://docs.deno.com/api/node/ which I checked first. Though it is listed in https://docs.deno.com/runtime/reference/node_apis/#node%3Aasync_hooks

eps1lon avatar Dec 04 '25 05:12 eps1lon

Thanks eps1lon

Yovach avatar Dec 04 '25 08:12 Yovach