-
Notifications
You must be signed in to change notification settings - Fork 27k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
95 additions
and
6 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
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
4 changes: 4 additions & 0 deletions
4
packages/next-swc/crates/core/tests/errors/server-actions/12/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,4 @@ | ||
'use server' | ||
'use client' | ||
|
||
export async function foo() {} |
9 changes: 9 additions & 0 deletions
9
packages/next-swc/crates/core/tests/errors/server-actions/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,9 @@ | ||
/* __next_internal_client_entry_do_not_use__ foo auto */ /* __next_internal_action_entry_do_not_use__ foo */ export async function foo() {} | ||
import ensureServerEntryExports from "private-next-rsc-action-proxy"; | ||
ensureServerEntryExports([ | ||
foo | ||
]); | ||
foo.$$typeof = Symbol.for("react.server.reference"); | ||
foo.$$id = "ab21efdafbe611287bc25c0462b1e0510d13e48b"; | ||
foo.$$bound = []; | ||
foo.$$with_bound = false; |
7 changes: 7 additions & 0 deletions
7
packages/next-swc/crates/core/tests/errors/server-actions/12/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,7 @@ | ||
|
||
x It's not possible to have both `use client` and `use server` directives in the same file. | ||
,-[input.js:1:1] | ||
1 | 'use server' | ||
2 | 'use client' | ||
: ^^^^^^^^^^^^ | ||
`---- |
8 changes: 8 additions & 0 deletions
8
packages/next-swc/crates/core/tests/errors/server-actions/13/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' | ||
'use strict' | ||
|
||
// This is a comment. | ||
|
||
'use server' | ||
|
||
export async function foo() {} |
10 changes: 10 additions & 0 deletions
10
packages/next-swc/crates/core/tests/errors/server-actions/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,10 @@ | ||
/* __next_internal_client_entry_do_not_use__ foo auto */ /* __next_internal_action_entry_do_not_use__ foo */ 'use strict'; | ||
export async function foo() {} | ||
import ensureServerEntryExports from "private-next-rsc-action-proxy"; | ||
ensureServerEntryExports([ | ||
foo | ||
]); | ||
foo.$$typeof = Symbol.for("react.server.reference"); | ||
foo.$$id = "ab21efdafbe611287bc25c0462b1e0510d13e48b"; | ||
foo.$$bound = []; | ||
foo.$$with_bound = false; |
7 changes: 7 additions & 0 deletions
7
packages/next-swc/crates/core/tests/errors/server-actions/13/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,7 @@ | ||
|
||
x It's not possible to have both `use client` and `use server` directives in the same file. | ||
,-[input.js:5:1] | ||
5 | | ||
6 | 'use server' | ||
: ^^^^^^^^^^^^ | ||
`---- |
5 changes: 5 additions & 0 deletions
5
.../next-swc/crates/core/tests/fixture/react-server-components/client-graph/actions/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,5 @@ | ||
'use server' | ||
|
||
// It should be allowed to import server APIs here. | ||
import 'server-only' | ||
import { cookies } from 'next/headers' |
4 changes: 4 additions & 0 deletions
4
...next-swc/crates/core/tests/fixture/react-server-components/client-graph/actions/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,4 @@ | ||
'use server'; | ||
// It should be allowed to import server APIs here. | ||
import 'server-only'; | ||
import { cookies } from 'next/headers'; |