-
Notifications
You must be signed in to change notification settings - Fork 26.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow export decl with any init value in the actions compiler (#49600)
Because of the flexibility of export declarations, we can't know the exact export type of exported values so we should allow all of them. Especially when we already have runtime checks. fix #49378 fix NEXT-1137
- Loading branch information
Showing
3 changed files
with
14 additions
and
7 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
5 changes: 5 additions & 0 deletions
5
packages/next-swc/crates/core/tests/fixture/server-actions/client/3/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' | ||
|
||
export const { sampleFunction } = someObject | ||
export const { sampleFunction2 } = fn() | ||
export let { 0: sampleFunction3, 1: sampleFunction4 } = [g(), g()] |
6 changes: 6 additions & 0 deletions
6
packages/next-swc/crates/core/tests/fixture/server-actions/client/3/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,6 @@ | ||
/* __next_internal_action_entry_do_not_use__ sampleFunction,sampleFunction2,sampleFunction3,sampleFunction4 */ import __create_action_proxy__ from "private-next-rsc-action-proxy"; | ||
import createServerReference from "private-next-rsc-action-client-wrapper"; | ||
export const sampleFunction = createServerReference("bd336abe00c3c59da66acb696fc8e151d8e54ea4"); | ||
export const sampleFunction2 = createServerReference("a0c73dd6f5af839e3335c6b19262ecb86cca6af4"); | ||
export const sampleFunction3 = createServerReference("d4f2e95bc745b6500b439c0847003511748c8ece"); | ||
export const sampleFunction4 = createServerReference("f03b256ee88a51700367acee3082894e25e6e7d9"); |