-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Based on #2968 This builds upon #2968 and @ForsakenHarmony's work on data routes to enable page data HMR. Page data HMR is a bit more clever than it is in Next.js as we won't re-render a Node.js result for each page file update. Instead, thanks to the `StripPageDefaultExport` transform, there are three versions of the page chunks: * client-side (strips page data exports); * server-side (full); * data server-side (strips page default export). Instead of subscribing to the full server-side result, on hydration, the client-side page separately subscribes to: * client-side updates (already the case); * data server-side updates (new). This means that updating something that only affects the page component will only cause a client-side update and **no Node.js re-rendering**, while updating something that only affects the data will only cause a server-side update. ~~I'm marking this as a draft for now as there are still a few areas to test/investigate:~~ - [x] When something that is used in both the default page export and data exports is changed, this will cause *two* HMR updates: one data update, and one client-side chunk update. **The same case breaks in Next.js, where we will receive a client-side update, but no server-side update, ending up with an incorrect result.** - [x] Differences between `getStaticProps/getServerSideProps`, as well as `getInitialProps` (need to talk with @timneutkens about this) (see vercel/next.js#44523) Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
- Loading branch information
1 parent
5b5632a
commit 8d16580
Showing
17 changed files
with
451 additions
and
121 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pub mod transforms; |
Oops, something went wrong.