-
Notifications
You must be signed in to change notification settings - Fork 7
fix: correctly resolve client boundary created by server package during dev #1050
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
fix: correctly resolve client boundary created by server package during dev #1050
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
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.
Pull Request Overview
This PR adds a mechanism to detect and proxy “client boundary” imports created by server-only packages in development, emits a warning when they occur, and updates the basic example to exclude those packages and test the behavior.
- Detects
?v=imports without a known package source in dev, warns, and creates a virtual proxy module - Introduces a new inline plugin
rsc:virtual-client-in-server-packageto load proxied client modules - Updates the basic example config, local test dependencies, routes, and adds an E2E test for the client-in-server scenario
Reviewed Changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/rsc/src/plugin.ts | Add detection of unexpected client boundaries, emit warning, and register a virtual proxy plugin for ?v= imports in dev |
| packages/rsc/examples/basic/vite.config.ts | Recommend excluding client-in-server test packages via optimizeDeps.exclude |
| packages/rsc/examples/basic/test-dep/client-in-server* | Add local test packages (client-in-server and client-in-server2) simulating server-side imports of client modules |
| packages/rsc/examples/basic/src/routes/client-in-server/* | Add server and client components to exercise the client-in-server proxy in the example app |
| packages/rsc/examples/basic/src/routes/root.tsx | Render the new TestClientInServer component in the example app |
| packages/rsc/examples/basic/package.json | Include the two local test-dep packages |
| packages/rsc/examples/basic/e2e/basic.test.ts | Add an E2E test for verifying the client-in-server proxy behavior |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported

ai/rscpackage #1049This virtual trick might be a bit of novelty. But I'm not sure if this is guaranteed to work, so let's show a warning for now. (Also we should say such package should be in
optimizeDeps.exclude)todo
ai/rscpnpm -C e2e/fixtures/ssr-basic/ exec waku-vite-rsc