dillon1000/react

Commit

[Fizz] Add FormatContext and Refactor Work (#21103)

* Add format context

* Let the Work node hold all working state for the recursive loop

Stacks are nice and all but there's a cost to maintaining each frame
both in terms of stack size usage and writing to it.

* Move current format context into work

* Synchronously render children of a Suspense boundary

We don't have to spawn work and snapshot the context. Instead we can try
to render the boundary immediately in case it works.

* Lazily create the fallback work

Instead of eagerly create the fallback work and then immediately abort it.
We can just avoid creating it if we finish synchronously.
Browse files
Changed paths7 files
First-parent comparison
M packages/react-dom/src/server/ReactDOMFizzServerBrowser.js ModifiedM packages/react-dom/src/server/ReactDOMFizzServerNode.js ModifiedM packages/react-dom/src/server/ReactDOMServerFormatConfig.js ModifiedM packages/react-native-renderer/src/server/ReactNativeServerFormatConfig.js ModifiedM packages/react-noop-renderer/src/ReactNoopServer.js ModifiedM packages/react-server/src/ReactFizzServer.js ModifiedM packages/react-server/src/forks/ReactServerFormatConfig.custom.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…