mirror of
https://github.com/zebrajr/react.git
synced 2025-12-06 12:20:20 +01:00
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. |
||
|---|---|---|
| .. | ||
| __tests__ | ||
| evalToString.js | ||
| inlinedHostConfigs.js | ||
| listChangedFiles.js | ||
| pathsByLanguageVersion.js | ||