react/scripts
Sebastian Markbåge 93f1668045
[Fizz] Add Node Web Streams bundle for SSR (#33441)
We highly recommend using Node Streams in Node.js because it's much
faster and it is less likely to cause issues when chained in things like
compression algorithms that need explicit flushing which the Web Streams
ecosystem doesn't have a good solution for. However, that said, people
want to be able to use the worse option for various reasons.

The `.edge` builds aren't technically intended for Node.js. A Node.js
environments needs to be patched in various ways to support it. It's
also less optimal since it can't use [Node.js exclusive
features](https://github.com/facebook/react/pull/33388) and have to use
[the lowest common
denominator](https://github.com/facebook/react/pull/27399) such as JS
implementations instead of native.

This adds a Web Streams build of Fizz but exclusively for Node.js so
that in it we can rely on Node.js modules. The main difference compared
to Edge is that SSR now uses `createHash` from the `"crypto"` module and
imports `TextEncoder` from `"util"`. We use `setImmediate` instead of
`setTimeout`.

The public API is just `react-dom/server` which in Node.js automatically
imports `react-dom/server.node` which re-exports the legacy bundle, Node
Streams bundle and Node Web Streams bundle. The main downside is if your
bundler isn't smart to DCE this barrel file.

With Flight the difference is larger but that's a bigger lift.
2025-06-05 10:50:41 -04:00
..
babel [flags] remove enableRemoveConsolePatches (#32425) 2025-02-24 10:00:22 -05:00
bench Don't minify symbols in production builds (#28881) 2024-04-20 11:23:46 -04:00
ci [ci] Try to parallelize devtools builds (#32266) 2025-01-30 11:49:04 -05:00
devtools fix[scripts/devtools/publish-release]: parse version list instead of handling 404 (#31087) 2024-09-30 17:07:54 +01:00
error-codes Prevent errors from comment node roots with enableViewTransition (#33205) 2025-05-21 13:57:35 -04:00
eslint [Codemod] Update copyright header to Meta (#25315) 2022-10-18 11:19:24 -04:00
eslint-rules [tests] Remove to*Dev matchers (#31989) 2025-01-07 14:17:14 -05:00
flags Add --cleanup option to flags script to show groups of flags by status (#31762) 2024-12-13 15:49:06 -05:00
flow [mcp] Add MCP tool to print out the component tree of the currently open React App (#33305) 2025-06-02 21:42:34 -07:00
git Remove leftover env variable logic in pre-commit hook 2015-09-01 14:35:47 -07:00
jest [Flight] Track Awaits on I/O as Debug Info (#33388) 2025-06-03 14:14:40 -04:00
perf-counters [Codemod] Update copyright header to Meta (#25315) 2022-10-18 11:19:24 -04:00
prettier [prettier] Combine compiler and runtime configs 2024-06-21 12:05:29 -04:00
print-warnings Disable consoleWithStackDev Transform except in RN/WWW (#30313) 2024-07-12 14:39:38 -04:00
react-compiler [ci] Cache runtime and compiler only for test runs (#32608) 2025-03-13 22:21:35 -04:00
release [release] Don't lookup build-info.json when updating version numbers (#32778) 2025-03-28 14:35:29 -04:00
rollup [Fizz] Add Node Web Streams bundle for SSR (#33441) 2025-06-05 10:50:41 -04:00
shared [Fizz] Add Node Web Streams bundle for SSR (#33441) 2025-06-05 10:50:41 -04:00
tasks [ci] Cleanup more references to circleci 2024-07-29 19:18:03 -04:00