-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Support HMR/HDR for Client Data #8189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
f4bb9f3 to
c6e9e1e
Compare
| } else if (theExports.includes("clientLoader")) { | ||
| contents = `export { clientLoader } from ${JSON.stringify( | ||
| `./${file}` | ||
| )};`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enable HDR for clientLoader by adapting the current tree shaking approach for fine-grained loader-change detection to also support clientLoader. Need these branches since esbuild will complain if we try to import a non-existent named export
| "HydrateFallback", | ||
| "action", | ||
| "clientAction", | ||
| "clientLoader", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Allow these to be exported from a route module
| "handle", | ||
| "meta", | ||
| "links", | ||
| "shouldRevalidate", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add non-component exports to accept for hot updates
Quick stab at duplicating the current loader HDR logic to apply toclientLoaderNo need to duplicate - can just check the exports slightly differently in the current plugin.
Vite HDR is working. HMR of
HydrateFallbackis not working currently - seeTODOcomment in the code