dillon1000/react
Commit
Browse files [Fizz] Don't handle errors in completeBoundary instruction (#33073)
Stacked on #33066 and #33068. Currently we're passing `errorDigest` to `completeBoundary` if there is a client side error (only CSS loading atm). This only exists because of `completeBoundaryWithStyles`. Normally if there's a server-side error we'd emit the `clientRenderBoundary` instruction instead. This adds unnecessary code to the common case where all styles are in the head. This is about to get worse with batching because client render shouldn't be throttled but complete should be. The first commit moves the client render logic inline into `completeBoundaryWithStyles` so we only pay for it when styles are used. However, the approach I went with in the second commit is to reuse the `$RX` instruction instead (`clientRenderBoundary`). That way if you have both it ends up being amortized. However, it does mean we have to emit the `$RX` (along with the `$RC` helper if any `completeBoundaryWithStyles` instruction is needed.
Changed paths5 files
First-parent comparisonpackages/react-dom-bindings/src/server/ReactFizzConfigDOM.js ModifiedM packages/react-dom-bindings/src/server/fizz-instruction-set/ReactDOMFizzInstructionSetInlineCodeStrings.js ModifiedM packages/react-dom-bindings/src/server/fizz-instruction-set/ReactDOMFizzInstructionSetShared.js ModifiedM packages/react-dom/src/__tests__/ReactDOMFizzStaticBrowser-test.js ModifiedM packages/react-dom/src/__tests__/ReactDOMFloat-test.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…