-
Notifications
You must be signed in to change notification settings - Fork 27.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[metadata] handle navigation API in streaming metadata (#76156)
### What When streaming metadata is enabled, the whole metadata result is under the suspense boundary and will be streamed to client if it takes some time. Right now we only had the metadata itself rendered under the suspense boundary. But we also need to deal with the errors, when there're errors of `notFound()` or `redirect()` it should still be thrown to trigger the proper error boundary. One special case needs to be taken care of is when we passing down the error caught during metadata from RSC layer to client layer, the `digest` property will be lost as it's not serialized by React now. Hence we also send both of the error itself and its digest to client and let client compose them when both present. In this way we can keep the original error digest of `notFound` and `redirect` navigation errors. We don't have this case in non-streaming metadata as the metatdata resolving was all done on the RSC side. When streaming metadata is disabled, we should not re-throw the errors on client, let everything works like before in the blocking way. The metadata re-throw strategy is called `StreamingMetadataOutlet` in the code, reviewers can focus on that. Closes NDX-847
- Loading branch information
Showing
11 changed files
with
226 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.