-
Notifications
You must be signed in to change notification settings - Fork 27.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reorganize the test cases a bit by separating server/client graphs. And make sure that using `'use server'` inside a Client Component will result in a compilation error.
- Loading branch information
Showing
45 changed files
with
66 additions
and
22 deletions.
There are no files selected for viewing
This file contains 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
9 changes: 0 additions & 9 deletions
9
packages/next-swc/crates/core/tests/errors/server-actions/12/output.js
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
packages/next-swc/crates/core/tests/errors/server-actions/13/output.js
This file was deleted.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
packages/next-swc/crates/core/tests/errors/server-actions/client-graph/1/input.js
This file contains 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' | ||
|
||
export default function App() { | ||
async function fn() { | ||
'use server' | ||
} | ||
return <div>App</div> | ||
} |
10 changes: 10 additions & 0 deletions
10
packages/next-swc/crates/core/tests/errors/server-actions/client-graph/1/output.js
This file contains 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 @@ | ||
/* __next_internal_client_entry_do_not_use__ default auto */ /* __next_internal_action_entry_do_not_use__ $$ACTION_0 */ export default function App() { | ||
async function fn() { | ||
return $$ACTION_0(fn.$$bound); | ||
} | ||
fn.$$typeof = Symbol.for("react.server.reference"); | ||
fn.$$id = "6d53ce510b2e36499b8f56038817b9bad86cabb4"; | ||
fn.$$bound = null; | ||
return <div>App</div>; | ||
} | ||
export async function $$ACTION_0(closure) {} |
9 changes: 9 additions & 0 deletions
9
packages/next-swc/crates/core/tests/errors/server-actions/client-graph/1/output.stderr
This file contains 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,9 @@ | ||
|
||
x "use server" functions are not allowed in client components. You can import them from a "use server" file instead. | ||
,-[input.js:3:1] | ||
3 | export default function App() { | ||
4 | ,-> async function fn() { | ||
5 | | 'use server' | ||
6 | `-> } | ||
7 | return <div>App</div> | ||
`---- |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions
2
packages/next-swc/crates/core/tests/errors/server-actions/server-graph/12/output.js
This file contains 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,2 @@ | ||
/* __next_internal_client_entry_do_not_use__ foo auto */ const { createProxy } = require("private-next-rsc-mod-ref-proxy"); | ||
module.exports = createProxy("/app/item.js"); |
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions
2
packages/next-swc/crates/core/tests/errors/server-actions/server-graph/13/output.js
This file contains 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,2 @@ | ||
/* __next_internal_client_entry_do_not_use__ foo auto */ const { createProxy } = require("private-next-rsc-mod-ref-proxy"); | ||
module.exports = createProxy("/app/item.js"); |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.