next.js
08ae81fa - [Instant] Fix loading.js not being counted as a suspense boundary (#90292)

Commit
2 days ago
[Instant] Fix loading.js not being counted as a suspense boundary (#90292) Fixes a bug where a loading.js isn't properly considered as providing a suspense boundary for a page. This is because we're placing the boundary around the segment component itself, but it should be rendered above the `LoadingBoundary` that is rendered around it (in `OuterLayoutRouter`). This PR reworks the boundary placement logic to insert the boundary above ErrorBoundary/LoadingBoundary (but below TemplateContext). It's a little bit tricky to communicate this from `instant-validation` to the client router. Instead of placing the boundary directly like before, we now add a context to the innermost parent segment (`PlaceValidationBoundaryBelowThisLevel`) and then the `OuterLayoutRouter`s for the segments below see this context value and add the validation boundary (`RenderValidationBoundaryAtThisLevel`)
Author
Parents
Loading