next.js
5bf4f831 - refactor: clean up places that needlessly list all RenderStages (#96907)

Commit
59 days ago
refactor: clean up places that needlessly list all RenderStages (#96907) pure refactor, no behavioral changes are expected. removes a couple of places that we had to touch when we add/remove stages: - `AccumulatedStreamChunks` unnecessarily used names like `staticChunks`/`runtimeChunks`/... instead of just using `RenderStage.Static`/`RenderStage.Runtime`/... like we do elsewhere - `collectStageChunk` had to do a switch over stages to map `RenderStage.Static` to `staticChunks` etc. after removing this, we can replace the switch with a loop over `RENDER_STAGE_ADVANCE_ORDER` - in `StagedRenderingController`, we were unnecessarily listing out all the stages when initializing `triggers`. replaced with a loop over `RENDER_STAGE_ADVANCE_ORDER` - in `StagedRenderingController.shouldTrackSyncInterrupt`, using a range of stages is a better way to express intent than a `switch`
Author
Parents
Loading