dillon1000/react
Commit
Browse files Add script to generate inline Fizz runtime (#25481)
* Move Fizz inline instructions to unified module Instead of a separate module per instruction, this exports all of them from a unified module. In the next step, I'll add a script to generate this new module. * Add script to generate inline Fizz runtime This adds a script to generate the inline Fizz runtime. Previously, the runtime source was in an inline comment, and a compiled version of the instructions were hardcoded as strings into the Fizz implementation, where they are injected into the HTML stream. I've moved the source for the instructions to a regular JavaScript module. A script compiles the instructions with Closure, then generates another module that exports the compiled instructions as strings. Then the Fizz runtime imports the instructions from the generated module. To build the instructions, run: yarn generate-inline-fizz-runtime In the next step, I'll add a CI check to verify that the generated files are up to date. * Check in CI if generated Fizz runtime is in sync The generated Fizz runtime is checked into source. In CI, we'll ensure it stays in sync by running the script and confirming nothing changed.
Changed paths14 files
First-parent comparison.circleci/config.yml ModifiedM package.json ModifiedM packages/react-dom-bindings/src/server/ReactDOMServerFormatConfig.js ModifiedA packages/react-dom-bindings/src/server/fizz-instruction-set/ReactDOMFizzInlineClientRenderBoundary.js AddedA packages/react-dom-bindings/src/server/fizz-instruction-set/ReactDOMFizzInlineCompleteBoundary.js AddedA packages/react-dom-bindings/src/server/fizz-instruction-set/ReactDOMFizzInlineCompleteBoundaryWithStyles.js AddedA packages/react-dom-bindings/src/server/fizz-instruction-set/ReactDOMFizzInlineCompleteSegment.js AddedA packages/react-dom-bindings/src/server/fizz-instruction-set/ReactDOMFizzInstructionSet.js AddedA packages/react-dom-bindings/src/server/fizz-instruction-set/ReactDOMFizzInstructionSetInlineCodeStrings.js AddedD packages/react-dom-bindings/src/server/fizz-instruction-set/clientRenderFunctionString.js DeletedD packages/react-dom-bindings/src/server/fizz-instruction-set/completeBoundaryFunctionString.js DeletedD packages/react-dom-bindings/src/server/fizz-instruction-set/completeSegmentFunctionString.js DeletedD packages/react-dom-bindings/src/server/fizz-instruction-set/styleInsertionFunctionString.js DeletedA scripts/rollup/generate-inline-fizz-runtime.js AddedPatch
Files changed
Rendering syntax-highlighted changes…