Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make router able to navigate between rsc pages (#35344)
### Bugfix Made some changes for the data register buffer flushing in #34631 and #34475 that tried to delete the buffer or flush them only once. But turns out it will break the navigation between RSC pages. ### Enhancements Simplify the inline response writer and inline response data for the initial render. Since they're only for the initial render, navigations will leverage the serialized data fetched from router and construct the react tree. ## Bug Fixes #35135 - [x] Related issues linked using `fixes #number` - [x] Integration tests added - [x] Errors have helpful link attached, see `contributing.md`
- Loading branch information
Showing
6 changed files
with
113 additions
and
70 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
23 changes: 23 additions & 0 deletions
23
test/integration/react-streaming-and-server-components/app/components/nav.server.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import Link from 'next/link' | ||
|
||
export default function Nav() { | ||
return ( | ||
<> | ||
<div> | ||
<Link href={'/next-api/link'}> | ||
<a id="goto-next-link">next link</a> | ||
</Link> | ||
</div> | ||
<div> | ||
<Link href={'/streaming-rsc'}> | ||
<a id="goto-streaming-rsc">streaming rsc</a> | ||
</Link> | ||
</div> | ||
<div> | ||
<Link href={'/'}> | ||
<a id="goto-home">home</a> | ||
</Link> | ||
</div> | ||
</> | ||
) | ||
} |
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
13 changes: 7 additions & 6 deletions
13
test/integration/react-streaming-and-server-components/app/pages/next-api/link.server.js
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