-
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
Merged
hi-ogawa
merged 11 commits into
main
from
06-22-fix_tolerate_internal_client_boundary_of_server_package
Jun 22, 2025
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
e392697
fix: tolerate internal client boundary of server package
hi-ogawa b8f0276
test: add test
hi-ogawa 36cd24b
chore: cleanup
hi-ogawa aed0851
test: tweak
hi-ogawa fb3de79
fix: avoid stale hash
hi-ogawa a4db8f2
fix: fix client-package-proxy virtual
hi-ogawa 29d631e
fix: use client-in-server-package-proxy
hi-ogawa 767831b
test: tewak
hi-ogawa aff7276
chore: lint
hi-ogawa 148d188
chore: comment
hi-ogawa ad7212e
chore: comment
hi-ogawa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
8 changes: 8 additions & 0 deletions
8
packages/rsc/examples/basic/src/routes/client-in-server/client.tsx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| "use client"; | ||
|
|
||
| // @ts-ignore | ||
| import { TestContextValue } from "@vitejs/test-dep-client-in-server2/client"; | ||
|
|
||
| export function TestContextValueIndirect() { | ||
| return <TestContextValue />; | ||
| } |
22 changes: 22 additions & 0 deletions
22
packages/rsc/examples/basic/src/routes/client-in-server/server.tsx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| // @ts-ignore | ||
| import { TestClientInServerDep } from "@vitejs/test-dep-client-in-server/server"; | ||
| // @ts-ignore | ||
| import { TestContextProviderInServer } from "@vitejs/test-dep-client-in-server2/server"; | ||
| import { TestContextValueIndirect } from "./client"; | ||
|
|
||
| export function TestClientInServer() { | ||
| return ( | ||
| <div> | ||
| <div data-testid="client-in-server"> | ||
| [test-client-in-server-dep: <TestClientInServerDep />] | ||
| </div> | ||
| <div data-testid="provider-in-server"> | ||
| [test-provider-in-server-dep:{" "} | ||
| <TestContextProviderInServer value={true}> | ||
| <TestContextValueIndirect /> | ||
| </TestContextProviderInServer> | ||
| ] | ||
| </div> | ||
| </div> | ||
| ); | ||
| } |
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
8 changes: 8 additions & 0 deletions
8
packages/rsc/examples/basic/test-dep/client-in-server/client.js
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| "use client"; | ||
|
|
||
| import React from "react"; | ||
|
|
||
| export function TestClient() { | ||
| const [ok] = React.useState(() => true); | ||
| return React.createElement("span", null, String(ok)); | ||
| } |
11 changes: 11 additions & 0 deletions
11
packages/rsc/examples/basic/test-dep/client-in-server/package.json
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| { | ||
| "name": "@vitejs/test-dep-client-in-server", | ||
| "private": true, | ||
| "type": "module", | ||
| "exports": { | ||
| "./server": "./server.js" | ||
| }, | ||
| "peerDependencies": { | ||
| "react": "*" | ||
| } | ||
| } |
6 changes: 6 additions & 0 deletions
6
packages/rsc/examples/basic/test-dep/client-in-server/server.js
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| import React from "react"; | ||
| import { TestClient } from "./client.js"; | ||
|
|
||
| export async function TestClientInServerDep() { | ||
| return React.createElement(TestClient); | ||
| } |
18 changes: 18 additions & 0 deletions
18
packages/rsc/examples/basic/test-dep/client-in-server2/client.js
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| "use client"; | ||
|
|
||
| import React from "react"; | ||
|
|
||
| const testContext = React.createContext(); | ||
|
|
||
| export function TestContextProvider(props) { | ||
| return React.createElement( | ||
| testContext.Provider, | ||
| { value: props.value }, | ||
| props.children, | ||
| ); | ||
| } | ||
|
|
||
| export function TestContextValue() { | ||
| const value = React.useContext(testContext); | ||
| return React.createElement("span", null, String(value)); | ||
| } |
12 changes: 12 additions & 0 deletions
12
packages/rsc/examples/basic/test-dep/client-in-server2/package.json
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| { | ||
| "name": "@vitejs/test-dep-client-in-server2", | ||
| "private": true, | ||
| "type": "module", | ||
| "exports": { | ||
| "./server": "./server.js", | ||
| "./client": "./client.js" | ||
| }, | ||
| "peerDependencies": { | ||
| "react": "*" | ||
| } | ||
| } |
10 changes: 10 additions & 0 deletions
10
packages/rsc/examples/basic/test-dep/client-in-server2/server.js
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| import React from "react"; | ||
| import { TestContextProvider } from "./client.js"; | ||
|
|
||
| export function TestContextProviderInServer(props) { | ||
| return React.createElement( | ||
| TestContextProvider, | ||
| { value: props.value }, | ||
| props.children, | ||
| ); | ||
| } |
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.