forked from wakujs/waku
-
Notifications
You must be signed in to change notification settings - Fork 0
feat: deployment adapters #8
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
Merged
Merged
Conversation
This file contains hidden or 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
Owner
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
This was referenced Jun 27, 2025
Closed
Merged
28f1d0d to
6f6f452
Compare
4dff8ef to
3943b3d
Compare
Merged
dai-shi
pushed a commit
to wakujs/waku
that referenced
this pull request
Aug 3, 2025
(EDIT: see also blog post for the summary #1564) This PR replaces Waku's `vite` and `react-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. ```sh pnpm -C examples/01_template dev --experimental-legacy-cli ``` 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 - new `{ vite: ... }` config in `waku.config.ts` - this replaces custom `vite.config.ts` and `unstable_viteConfigs` in `waku.config.ts` - custom plugin can access environment API configuration and plugin system - https://vite.dev/guide/api-environment.html - https://vite.dev/guide/api-environment-plugins.html ```js // waku.config.ts import { defineConfig } from "waku/config" export default defineConfig({ vite: { plugins: [ ... ], environments: { client: { ... }, ssr: { ... }, rsc: { ... }, } } }) ``` - `ssr` environment (previously "main server ssr") doesn't externalize server deps by default, but transform all react deps. - This means if there's cjs dependency (directly or transitively) used in client component, SSR might fail during dev. For example, `swr` (esm) package uses `use-sync-external-store` (cjs) internally. This can be mitigated by `environments.ssr.optimizeDeps.include: ["swr"]`. - See also vitejs/vite-plugin-react#610 ## e2e status Run it locally e.g. by ```js TEST_VITE_RSC=1 pnpm exec playwright test --project=chromium-dev e2e/rsc-basic.spec.ts pnpm -C e2e/fixtures/rsc-basic dev --experimental-vite-rsc ``` - [x] broken-links - [x] create-pages - [x] define-router - [x] fs-router - [x] hot-reload - [x] monorepo - [x] multi-platform - [x] partial-build - [x] render-type - [x] rsc-asset - [x] rsc-basic - [x] rsc-css-modules - [x] ssg-performance - [x] ssg-wildcard - [x] ssr-basic - [x] ssr-catch-error - [x] ssr-context-provider - [x] ssr-redirect - [x] ssr-swr - [x] ssr-target-bundle - [x] use-router - [x] examples-smoke - [x] 11_fs-router (build) - [x] 12_nossr (build) - [x] 36_form (see #1534) - [x] 38_cookies (build) - [x] website ## todo - [x] test: `waitForHydration` or not? #1493 (comment) - [x] reduce diff - [ ] announcement #1564 - [ ] discuss dependency structure (dep vs peer-dep, `@hiogawa/vite-plugin` or wait for it to move to vitejs org) - [ ] replace completely hi-ogawa#20 - [x] test: fix windows ci fail hi-ogawa#11 - [x] deployment adapter hi-ogawa#8 - vercel example https://waku-vite-rsc-01-template.vercel.app - [x] "use client" transform with `allowServer` hi-ogawa/vite-plugins#1078 - [x] improve waku.config support hi-ogawa#5 - [x] polish middleware hi-ogawa#7 - [x] integrate hono hi-ogawa#6 - [ ] check if any known issues will be fixed by this change. (if it's still not working, check if it's also reproduce with https://github.com/hi-ogawa/vite-plugins/tree/main/packages/rsc and raise it as an upstream issue)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

For now, don't try to introduce
@vercel/nftand aim for one-to-one port.