-
Notifications
You must be signed in to change notification settings - Fork 47.2k
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
Enforce that the "react-server" build of "react" is used #27436
Conversation
6170ae5
to
f2a6b0d
Compare
I do this by simply renaming the secret export name in that bundle.
f2a6b0d
to
7051b54
Compare
d0e6f20
to
09eb851
Compare
Like ReactDebugCurrentFrame. So we preserve those simple cases on the old name while still moving dispatcher and cache to the separate one.
09eb851
to
d842bdd
Compare
I do this by simply renaming the secret export name in the "subset" bundle and this renamed version is what the FlightServer uses. This requires us to be more diligent about always using the correct instance of "react" in our tests so there's a bunch of clean up for that. DiffTrain build for [c7ba8c0](c7ba8c0)
React upstream changes: - facebook/react#27401 - facebook/react#27443 - facebook/react#27445 - facebook/react#27364 - facebook/react#27440 - facebook/react#27436
- facebook/react#27514 - facebook/react#27511 - facebook/react#27508 - facebook/react#27502 - facebook/react#27474 - facebook/react#26789 - facebook/react#27500 - facebook/react#27488 - facebook/react#27458 - facebook/react#27471 - facebook/react#27470 - facebook/react#27464 - facebook/react#27456 - facebook/react#27462 - facebook/react#27461 - facebook/react#27460 - facebook/react#27459 - facebook/react#27454 - facebook/react#27457 - facebook/react#27453 - facebook/react#27401 - facebook/react#27443 - facebook/react#27445 - facebook/react#27364 - facebook/react#27440 - facebook/react#27436
- facebook/react#27513 - facebook/react#27514 - facebook/react#27511 - facebook/react#27508 - facebook/react#27502 - facebook/react#27474 - facebook/react#26789 - facebook/react#27500 - facebook/react#27488 - facebook/react#27458 - facebook/react#27471 - facebook/react#27470 - facebook/react#27464 - facebook/react#27456 - facebook/react#27462 - facebook/react#27461 - facebook/react#27460 - facebook/react#27459 - facebook/react#27454 - facebook/react#27457 - facebook/react#27453 - facebook/react#27401 - facebook/react#27443 - facebook/react#27445 - facebook/react#27364 - facebook/react#27440 - facebook/react#27436
- facebook/react#27513 - facebook/react#27514 - facebook/react#27511 - facebook/react#27508 - facebook/react#27502 - facebook/react#27474 - facebook/react#26789 - facebook/react#27500 - facebook/react#27488 - facebook/react#27458 - facebook/react#27471 - facebook/react#27470 - facebook/react#27464 - facebook/react#27456 - facebook/react#27462 - facebook/react#27461 - facebook/react#27460 - facebook/react#27459 - facebook/react#27454 - facebook/react#27457 - facebook/react#27453 - facebook/react#27401 - facebook/react#27443 - facebook/react#27445 - facebook/react#27364 - facebook/react#27440 - facebook/react#27436
- facebook/react#27513 - facebook/react#27514 - facebook/react#27511 - facebook/react#27508 - facebook/react#27502 - facebook/react#27474 - facebook/react#26789 - facebook/react#27500 - facebook/react#27488 - facebook/react#27458 - facebook/react#27471 - facebook/react#27470 - facebook/react#27464 - facebook/react#27456 - facebook/react#27462 - facebook/react#27461 - facebook/react#27460 - facebook/react#27459 - facebook/react#27454 - facebook/react#27457 - facebook/react#27453 - facebook/react#27401 - facebook/react#27443 - facebook/react#27445 - facebook/react#27364 - facebook/react#27440 - facebook/react#27436
- facebook/react#27513 - facebook/react#27514 - facebook/react#27511 - facebook/react#27508 - facebook/react#27502 - facebook/react#27474 - facebook/react#26789 - facebook/react#27500 - facebook/react#27488 - facebook/react#27458 - facebook/react#27471 - facebook/react#27470 - facebook/react#27464 - facebook/react#27456 - facebook/react#27462 - facebook/react#27461 - facebook/react#27460 - facebook/react#27459 - facebook/react#27454 - facebook/react#27457 - facebook/react#27453 - facebook/react#27401 - facebook/react#27443 - facebook/react#27445 - facebook/react#27364 - facebook/react#27440 - facebook/react#27436
…experimental prefix for server action APIs (#56809) The latest React canary builds have a few changes that need to be adopted for compatability. 1. the `useFormState` and `useFormStatus` hooks in `react-dom` and the `formData` opiont in `react-dom/server` are no longer prefixed with `experimental_` 2. server content (an undocumented React feature) has been removed. Next only had trivial intenral use of this API and did not expose a coherent feature to Next users (no ability to seed context on refetches). It is still possible that some users used the React server context APIs which is why this should go into Next 14. ### React upstream changes - facebook/react#27513 - facebook/react#27514 - facebook/react#27511 - facebook/react#27508 - facebook/react#27502 - facebook/react#27474 - facebook/react#26789 - facebook/react#27500 - facebook/react#27488 - facebook/react#27458 - facebook/react#27471 - facebook/react#27470 - facebook/react#27464 - facebook/react#27456 - facebook/react#27462 - facebook/react#27461 - facebook/react#27460 - facebook/react#27459 - facebook/react#27454 - facebook/react#27457 - facebook/react#27453 - facebook/react#27401 - facebook/react#27443 - facebook/react#27445 - facebook/react#27364 - facebook/react#27440 - facebook/react#27436 --------- Co-authored-by: Zack Tanner <zacktanner@gmail.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> Co-authored-by: Jiachi Liu <inbox@huozhi.im>
Hey @sebmarkbage I've got a question about this PR. In my hobby RSC implementation (prior to this PR) I was rendering both the RSC tree and then the SSR tree in the same process. Something along the lines of: let rscStream = renderToReadableStream(
createElement(ServerComponent),
clientComponentMap
);
let rscTree = createFromReadableStream(rscStream);
let htmlStream = await ReactDom.renderToReadableStream(
createElement(SSRRouter, {
path: pathname,
rscTree: rscTree
})
});
return new Response(htmlStream); But if I use I'm guessing my prior approach was wrong and this PR means I should be doing the SSR render in something like a Node worker that doesn't use Thanks in advance :) |
## Summary After changes in #27436, UMD builds no longer expose Scheduler from ReactSharedInternals. This module is forked in rollup for UMD builds and the path no longer matches. This PR updates the path name to match the new module: ReactSharedInternalsClient. ## How did you test this change? - `yarn build` - Inspect `react.development.js` UMD build, observe `Scheduler: Scheduler` is set in `ReactSharedInternals`, matching [18.2.0](https://unpkg.com/react@18.2.0/umd/react.development.js) - ran attribute-behavior fixture app - Observe no more error `Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'unstable_cancelCallback')` Co-authored-by: Jack Pope <jackpope@meta.com>
I encountered a similar problem when I upgraded the react version from 18.3.0-next-1308e49a6-20230330 to 18.3.0-canary-1d5667a12-20240102. The wrong content is here: #27478 So I think. Two processes should be used to run the ssr service and rsc service. like this:
|
Want to see how CI reacts to upgrading to React canary. ~I may have over-upgraded (i.e. some fixtures and maybe the docs don't need to be upgraded), but let's see what happens.~ This upgrade was complicated by facebook/react#27436 which added a poisoned import to `react-server-dom-webpack/server`, meaning that if you tried to import from that entry point without the "react-server" condition, it would throw. In a much-earlier PR, Sebastian mentions there generally being two ways to do things: > Either you can have the server code prebundled using Webpack (what Next.js does in practice) or you can use an unbundled Node.js server (what the reference implementation does). See facebook/react#26172. This PR goes with the former, prebundling `react-server-dom-webpack/server` with the "react-server" condition so that we can avoid having to specify it at runtime. It's hard to tell if this the better option long-term, but since we're keen on getting rid of the worker right now, this moves us closer in that direction. The alternative solution was to move decoding the reply into the worker where the condition is specified. --------- Co-authored-by: Tobbe Lundberg <tobbe@tlundberg.com>
## Summary After changes in facebook#27436, UMD builds no longer expose Scheduler from ReactSharedInternals. This module is forked in rollup for UMD builds and the path no longer matches. This PR updates the path name to match the new module: ReactSharedInternalsClient. ## How did you test this change? - `yarn build` - Inspect `react.development.js` UMD build, observe `Scheduler: Scheduler` is set in `ReactSharedInternals`, matching [18.2.0](https://unpkg.com/react@18.2.0/umd/react.development.js) - ran attribute-behavior fixture app - Observe no more error `Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'unstable_cancelCallback')` Co-authored-by: Jack Pope <jackpope@meta.com>
I do this by simply renaming the secret export name in the "subset" bundle and this renamed version is what the FlightServer uses. This requires us to be more diligent about always using the correct instance of "react" in our tests so there's a bunch of clean up for that. DiffTrain build for commit c7ba8c0.
I do this by simply renaming the secret export name in the "subset" bundle and this renamed version is what the FlightServer uses.
This requires us to be more diligent about always using the correct instance of "react" in our tests so there's a bunch of clean up for that.