-
-
Notifications
You must be signed in to change notification settings - Fork 163
feat: use @vitejs/plugin-rsc
#1493
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
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
Cool. Very nice work. So excited to see this will land once it's finished.
Really our goal is gradually add changes as much as possible and make the final PR as minimal as possible. |
I extracted a change from #1493. I found these two since my plugin rejects non async function with "use server".
Extracted from #1493. This for-loop seems redundant since DEV / PROD runs are already split as playwright projects.
9307c73
to
732864f
Compare
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.
some minor notes
This adds a test case for fallback index.html as discussed in #1493 (comment)
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.
I'll continue reviewing and refactoring after merging too.
congrats! |
Thank you! |
This PR adds a blog post to accompany with #1493. Used lots of AI 😅 --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Daishi Kato <dai-shi@users.noreply.github.com>
(EDIT: see also blog post for the summary #1564)
This PR replaces Waku's
vite
andreact-server-dom-webpack
internals with@vitejs/plugin-rsc
.The new code path is split in
waku/src/vite-rsc/...
but Waku's core routing logic is reused internally. Previously implementation is still preserved and can be enabled via a flag--experimental-legacy-cli
e.g.The goal is to achieve the switch with as little breaking change as possible. There are still missing pieces as I wrote in todo at the bottom, but the overall shape is mostly established, so I'm opening a PR here to start to gather feedback. Thanks!
known changes
{ vite: ... }
config inwaku.config.ts
vite.config.ts
andunstable_viteConfigs
inwaku.config.ts
ssr
environment (previously "main server ssr") doesn't externalize server deps by default, but transform all react deps.swr
(esm) package usesuse-sync-external-store
(cjs) internally. This can be mitigated byenvironments.ssr.optimizeDeps.include: ["swr"]
.optimizeDeps.include
heuristics to ensure popular cjs packages to be automatically optimized vitejs/vite-plugin-react#610e2e status
Run it locally e.g. by
todo
waitForHydration
or not? feat: use@vitejs/plugin-rsc
#1493 (comment)@vitejs/plugin-rsc
migration #1564@hiogawa/vite-plugin
or wait for it to move to vitejs org)allowServer
feat(rsc, transforms): support preserving client reference original value hi-ogawa/vite-plugins#1078