Unverified Commit c8f96d50 authored by Donny/강동윤's avatar Donny/강동윤 Committed by GitHub

perf(turbopack): Enable merging of export fragments (#72813)

### What?

Enable single-incoming-edge optimization for module fragments with `ModulePart::Export`. 

### Why?

It will reduce the number of modules greatly.



### How?

Closes PACK-3481
parent 2113aaca
...@@ -12,7 +12,10 @@ use swc_core::{ ...@@ -12,7 +12,10 @@ use swc_core::{
atoms::Atom, atoms::Atom,
common::comments::Comments, common::comments::Comments,
ecma::{ ecma::{
ast::{Decl, ExportSpecifier, Id, ModuleDecl, ModuleItem, Program}, ast::{
Decl, ExportSpecifier, Id, ModuleDecl, ModuleItem, ObjectLit, Program,
PropOrSpread::Prop,
},
utils::find_pat_ids, utils::find_pat_ids,
}, },
}; };
...@@ -310,11 +313,7 @@ async fn parse_actions(module: Vc<Box<dyn Module>>) -> Result<Vc<OptionActionMap ...@@ -310,11 +313,7 @@ async fn parse_actions(module: Vc<Box<dyn Module>>) -> Result<Vc<OptionActionMap
{ {
if matches!( if matches!(
&*module.await?.part.await?, &*module.await?.part.await?,
ModulePart::Evaluation ModulePart::Evaluation | ModulePart::Facade
| ModulePart::Exports
| ModulePart::Facade
| ModulePart::Internal(..)
| ModulePart::InternalEvaluation(..)
) { ) {
return Ok(OptionActionMap::none()); return Ok(OptionActionMap::none());
} }
...@@ -381,6 +380,10 @@ fn all_export_names(program: &Program) -> Vec<Atom> { ...@@ -381,6 +380,10 @@ fn all_export_names(program: &Program) -> Vec<Atom> {
_ => {} _ => {}
}, },
ModuleItem::ModuleDecl(ModuleDecl::ExportNamed(decl)) => { ModuleItem::ModuleDecl(ModuleDecl::ExportNamed(decl)) => {
if is_turbopack_internal_var(&decl.with) {
continue;
}
for s in decl.specifiers.iter() { for s in decl.specifiers.iter() {
match s { match s {
ExportSpecifier::Named(named) => { ExportSpecifier::Named(named) => {
...@@ -414,6 +417,26 @@ fn all_export_names(program: &Program) -> Vec<Atom> { ...@@ -414,6 +417,26 @@ fn all_export_names(program: &Program) -> Vec<Atom> {
} }
} }
fn is_turbopack_internal_var(with: &Option<Box<ObjectLit>>) -> bool {
with.as_deref()
.and_then(|v| {
v.props.iter().find_map(|p| match p {
Prop(prop) => match &**prop {
swc_core::ecma::ast::Prop::KeyValue(key_value_prop) => {
if key_value_prop.key.as_ident()?.sym == "__turbopack_var__" {
Some(key_value_prop.value.as_lit()?.as_bool()?.value)
} else {
None
}
}
_ => None,
},
_ => None,
})
})
.unwrap_or(false)
}
/// Converts our cached [parse_actions] call into a data type suitable for /// Converts our cached [parse_actions] call into a data type suitable for
/// collecting into a flat-mapped [FxIndexMap]. /// collecting into a flat-mapped [FxIndexMap].
async fn parse_actions_filter_map( async fn parse_actions_filter_map(
......
...@@ -390,7 +390,12 @@ impl<C: Comments> ServerActions<C> { ...@@ -390,7 +390,12 @@ impl<C: Comments> ServerActions<C> {
.push((action_name.to_string(), action_id.clone())); .push((action_name.to_string(), action_id.clone()));
let register_action_expr = bind_args_to_ref_expr( let register_action_expr = bind_args_to_ref_expr(
annotate_ident_as_server_reference(action_ident.clone(), action_id.clone(), arrow.span), annotate_ident_as_server_reference(
action_ident.clone(),
action_id.clone(),
arrow.span,
&self.comments,
),
ids_from_closure ids_from_closure
.iter() .iter()
.cloned() .cloned()
...@@ -532,6 +537,7 @@ impl<C: Comments> ServerActions<C> { ...@@ -532,6 +537,7 @@ impl<C: Comments> ServerActions<C> {
action_ident.clone(), action_ident.clone(),
action_id.clone(), action_id.clone(),
function.span, function.span,
&self.comments,
), ),
ids_from_closure ids_from_closure
.iter() .iter()
...@@ -716,6 +722,7 @@ impl<C: Comments> ServerActions<C> { ...@@ -716,6 +722,7 @@ impl<C: Comments> ServerActions<C> {
cache_ident.clone(), cache_ident.clone(),
reference_id.clone(), reference_id.clone(),
arrow.span, arrow.span,
&self.comments,
); );
// If there're any bound args from the closure, we need to hoist the // If there're any bound args from the closure, we need to hoist the
...@@ -788,6 +795,7 @@ impl<C: Comments> ServerActions<C> { ...@@ -788,6 +795,7 @@ impl<C: Comments> ServerActions<C> {
cache_ident.clone(), cache_ident.clone(),
reference_id.clone(), reference_id.clone(),
function.span, function.span,
&self.comments,
); );
function.body.visit_mut_with(&mut ClosureReplacer { function.body.visit_mut_with(&mut ClosureReplacer {
...@@ -1760,6 +1768,7 @@ impl<C: Comments> VisitMut for ServerActions<C> { ...@@ -1760,6 +1768,7 @@ impl<C: Comments> VisitMut for ServerActions<C> {
ident.clone(), ident.clone(),
ref_id.to_string(), ref_id.to_string(),
ident.span, ident.span,
&self.comments,
)), )),
})); }));
} }
...@@ -2166,7 +2175,19 @@ fn annotate_ident_as_server_reference( ...@@ -2166,7 +2175,19 @@ fn annotate_ident_as_server_reference(
ident: Ident, ident: Ident,
action_id: String, action_id: String,
original_span: Span, original_span: Span,
comments: &dyn Comments,
) -> Expr { ) -> Expr {
if !original_span.lo.is_dummy() {
comments.add_leading(
original_span.lo,
Comment {
kind: CommentKind::Block,
span: original_span,
text: "#__TURBOPACK_DISABLE_EXPORT_MERGING__".into(),
},
);
}
// registerServerReference(reference, id, null) // registerServerReference(reference, id, null)
Expr::Call(CallExpr { Expr::Call(CallExpr {
span: original_span, span: original_span,
......
/* __next_internal_action_entry_do_not_use__ {"00ab21efdafbe611287bc25c0462b1e0510d13e48b":"foo"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"00ab21efdafbe611287bc25c0462b1e0510d13e48b":"foo"} */ import { registerServerReference } from "private-next-rsc-server-reference";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
export function foo() {} export function /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ foo() {}
import { ensureServerEntryExports } from "private-next-rsc-action-validate"; import { ensureServerEntryExports } from "private-next-rsc-action-validate";
ensureServerEntryExports([ ensureServerEntryExports([
foo foo
......
/* __next_internal_action_entry_do_not_use__ {"803128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"803128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper";
export var $$RSC_SERVER_CACHE_0 = $$cache__("x", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, async function foo() { export var $$RSC_SERVER_CACHE_0 = $$cache__("x", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ async function foo() {
return 'data'; return 'data';
}); });
Object.defineProperty($$RSC_SERVER_CACHE_0, "name", { Object.defineProperty($$RSC_SERVER_CACHE_0, "name", {
......
/* __next_internal_action_entry_do_not_use__ {"803128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"803128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper";
export var $$RSC_SERVER_CACHE_0 = $$cache__("x", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, async function foo() { export var $$RSC_SERVER_CACHE_0 = $$cache__("x", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ async function foo() {
return 'data'; return 'data';
}); });
Object.defineProperty($$RSC_SERVER_CACHE_0, "name", { Object.defineProperty($$RSC_SERVER_CACHE_0, "name", {
......
/* __next_internal_action_entry_do_not_use__ {"00ac840dcaf5e8197cb02b7f3a43c119b7a770b272":"bar"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"00ac840dcaf5e8197cb02b7f3a43c119b7a770b272":"bar"} */ import { registerServerReference } from "private-next-rsc-server-reference";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
'use strict'; 'use strict';
export function bar() {} export function /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ bar() {}
import { ensureServerEntryExports } from "private-next-rsc-action-validate"; import { ensureServerEntryExports } from "private-next-rsc-action-validate";
ensureServerEntryExports([ ensureServerEntryExports([
bar bar
......
/* __next_internal_action_entry_do_not_use__ {"00c18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"00c18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default"} */ import { registerServerReference } from "private-next-rsc-server-reference";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
export default $$RSC_SERVER_ACTION_0 = ()=>{}; export default /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_0 = ()=>{};
var $$RSC_SERVER_ACTION_0; var $$RSC_SERVER_ACTION_0;
Object.defineProperty($$RSC_SERVER_ACTION_0, "name", { Object.defineProperty($$RSC_SERVER_ACTION_0, "name", {
"value": "default", "value": "default",
......
/* __next_internal_action_entry_do_not_use__ {"006a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"006a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0"} */ import { registerServerReference } from "private-next-rsc-server-reference";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
export const $$RSC_SERVER_ACTION_0 = async function foo() { export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_0 = async function foo() {
'use strict'; 'use strict';
}; };
const foo = registerServerReference($$RSC_SERVER_ACTION_0, "006a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null); const foo = registerServerReference($$RSC_SERVER_ACTION_0, "006a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
......
/* __next_internal_action_entry_do_not_use__ {"803128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"803128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper";
export var $$RSC_SERVER_CACHE_0 = $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, async function Page() { export var $$RSC_SERVER_CACHE_0 = $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ async function Page() {
return <p>hello world</p>; return <p>hello world</p>;
}); });
Object.defineProperty($$RSC_SERVER_CACHE_0, "name", { Object.defineProperty($$RSC_SERVER_CACHE_0, "name", {
......
/* __next_internal_action_entry_do_not_use__ {"803128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"803128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper";
export var $$RSC_SERVER_CACHE_0 = $$cache__("x", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, async function Page() { export var $$RSC_SERVER_CACHE_0 = $$cache__("x", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ async function Page() {
return <p>hello world</p>; return <p>hello world</p>;
}); });
Object.defineProperty($$RSC_SERVER_CACHE_0, "name", { Object.defineProperty($$RSC_SERVER_CACHE_0, "name", {
......
...@@ -3,7 +3,7 @@ import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc ...@@ -3,7 +3,7 @@ import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc
import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper";
import React from 'react'; import React from 'react';
import inter from '@next/font/google/target.css?{"path":"app/test.tsx","import":"Inter","arguments":[],"variableName":"inter"}'; import inter from '@next/font/google/target.css?{"path":"app/test.tsx","import":"Inter","arguments":[],"variableName":"inter"}';
export var $$RSC_SERVER_CACHE_0 = $$cache__("default", "c0dd5bb6fef67f5ab84327f5164ac2c3111a159337", 0, async function Cached({ children }) { export var $$RSC_SERVER_CACHE_0 = $$cache__("default", "c0dd5bb6fef67f5ab84327f5164ac2c3111a159337", 0, /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ async function Cached({ children }) {
return <div className={inter.className}>{children}</div>; return <div className={inter.className}>{children}</div>;
}); });
Object.defineProperty($$RSC_SERVER_CACHE_0, "name", { Object.defineProperty($$RSC_SERVER_CACHE_0, "name", {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
import React from 'react'; import React from 'react';
import inter from '@next/font/google/target.css?{"path":"app/test.tsx","import":"Inter","arguments":[],"variableName":"inter"}'; import inter from '@next/font/google/target.css?{"path":"app/test.tsx","import":"Inter","arguments":[],"variableName":"inter"}';
export async function myCoolServerAction() { export async function /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ myCoolServerAction() {
return <div className={inter.className}>Hello from server action</div>; return <div className={inter.className}>Hello from server action</div>;
} }
import { ensureServerEntryExports } from "private-next-rsc-action-validate"; import { ensureServerEntryExports } from "private-next-rsc-action-validate";
......
/* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0","4090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0","4090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1"} */ import { registerServerReference } from "private-next-rsc-server-reference";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
import deleteFromDb from 'db'; import deleteFromDb from 'db';
export const $$RSC_SERVER_ACTION_0 = async function deleteItem($$ACTION_CLOSURE_BOUND) { export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_0 = async function deleteItem($$ACTION_CLOSURE_BOUND) {
var [$$ACTION_ARG_0, $$ACTION_ARG_1] = await decryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0, $$ACTION_ARG_1] = await decryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND);
await deleteFromDb($$ACTION_ARG_0); await deleteFromDb($$ACTION_ARG_0);
await deleteFromDb($$ACTION_ARG_1); await deleteFromDb($$ACTION_ARG_1);
...@@ -13,7 +13,7 @@ export function Item({ id1, id2 }) { ...@@ -13,7 +13,7 @@ export function Item({ id1, id2 }) {
])); ]));
return <Button action={deleteItem}>Delete</Button>; return <Button action={deleteItem}>Delete</Button>;
} }
export const $$RSC_SERVER_ACTION_1 = async function action($$ACTION_CLOSURE_BOUND) { export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_1 = async function action($$ACTION_CLOSURE_BOUND) {
var [$$ACTION_ARG_0, $$ACTION_ARG_1] = await decryptActionBoundArgs("4090b5db271335765a4b0eab01f044b381b5ebd5cd", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0, $$ACTION_ARG_1] = await decryptActionBoundArgs("4090b5db271335765a4b0eab01f044b381b5ebd5cd", $$ACTION_CLOSURE_BOUND);
console.log($$ACTION_ARG_0); console.log($$ACTION_ARG_0);
console.log($$ACTION_ARG_1); console.log($$ACTION_ARG_1);
......
/* __next_internal_action_entry_do_not_use__ {"00c18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"00c18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default"} */ import { registerServerReference } from "private-next-rsc-server-reference";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
export default async function foo() {} export default async function /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ foo() {}
import { ensureServerEntryExports } from "private-next-rsc-action-validate"; import { ensureServerEntryExports } from "private-next-rsc-action-validate";
ensureServerEntryExports([ ensureServerEntryExports([
foo foo
......
/* __next_internal_action_entry_do_not_use__ {"00c18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"00c18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default"} */ import { registerServerReference } from "private-next-rsc-server-reference";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
export default async function $$RSC_SERVER_ACTION_0() {} export default /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ async function $$RSC_SERVER_ACTION_0() {}
Object.defineProperty($$RSC_SERVER_ACTION_0, "name", { Object.defineProperty($$RSC_SERVER_ACTION_0, "name", {
"value": "default", "value": "default",
"writable": false "writable": false
......
/* __next_internal_action_entry_do_not_use__ {"7fc18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"7fc18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default"} */ import { registerServerReference } from "private-next-rsc-server-reference";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
async function foo() {} async function foo() {}
export default foo; export default /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ foo;
import { ensureServerEntryExports } from "private-next-rsc-action-validate"; import { ensureServerEntryExports } from "private-next-rsc-action-validate";
ensureServerEntryExports([ ensureServerEntryExports([
foo foo
......
/* __next_internal_action_entry_do_not_use__ {"7fac840dcaf5e8197cb02b7f3a43c119b7a770b272":"bar","7fc18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"7fac840dcaf5e8197cb02b7f3a43c119b7a770b272":"bar","7fc18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default"} */ import { registerServerReference } from "private-next-rsc-server-reference";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
const foo = async function() {}; const foo = async function() {};
export default foo; export default /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ foo;
const bar = async function() {}; const bar = async function() {};
export { bar }; export { /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ bar };
import { ensureServerEntryExports } from "private-next-rsc-action-validate"; import { ensureServerEntryExports } from "private-next-rsc-action-validate";
ensureServerEntryExports([ ensureServerEntryExports([
foo, foo,
......
/* __next_internal_action_entry_do_not_use__ {"00ab21efdafbe611287bc25c0462b1e0510d13e48b":"foo"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"00ab21efdafbe611287bc25c0462b1e0510d13e48b":"foo"} */ import { registerServerReference } from "private-next-rsc-server-reference";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
export async function foo() { export async function /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ foo() {
async function bar() {} async function bar() {}
} }
import { ensureServerEntryExports } from "private-next-rsc-action-validate"; import { ensureServerEntryExports } from "private-next-rsc-action-validate";
......
/* __next_internal_action_entry_do_not_use__ {"60c18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"60c18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default"} */ import { registerServerReference } from "private-next-rsc-server-reference";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
export default $$RSC_SERVER_ACTION_0 = async (a, b)=>{ export default /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_0 = async (a, b)=>{
console.log(a, b); console.log(a, b);
}; };
var $$RSC_SERVER_ACTION_0; var $$RSC_SERVER_ACTION_0;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
import deleteFromDb from 'db'; import deleteFromDb from 'db';
const v1 = 'v1'; const v1 = 'v1';
export const $$RSC_SERVER_ACTION_0 = async function deleteItem($$ACTION_CLOSURE_BOUND) { export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_0 = async function deleteItem($$ACTION_CLOSURE_BOUND) {
var [$$ACTION_ARG_0, $$ACTION_ARG_1] = await decryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0, $$ACTION_ARG_1] = await decryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND);
await deleteFromDb($$ACTION_ARG_0); await deleteFromDb($$ACTION_ARG_0);
await deleteFromDb(v1); await deleteFromDb(v1);
...@@ -16,7 +16,7 @@ export function Item({ id1, id2 }) { ...@@ -16,7 +16,7 @@ export function Item({ id1, id2 }) {
])); ]));
return <Button action={deleteItem}>Delete</Button>; return <Button action={deleteItem}>Delete</Button>;
} }
export const $$RSC_SERVER_ACTION_1 = async function g($$ACTION_CLOSURE_BOUND, y, ...z) { export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_1 = async function g($$ACTION_CLOSURE_BOUND, y, ...z) {
var [$$ACTION_ARG_0] = await decryptActionBoundArgs("7f90b5db271335765a4b0eab01f044b381b5ebd5cd", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0] = await decryptActionBoundArgs("7f90b5db271335765a4b0eab01f044b381b5ebd5cd", $$ACTION_CLOSURE_BOUND);
return $$ACTION_ARG_0 + y + z[0]; return $$ACTION_ARG_0 + y + z[0];
}; };
...@@ -25,7 +25,7 @@ const f = (x)=>{ ...@@ -25,7 +25,7 @@ const f = (x)=>{
x x
])); ]));
}; };
export const $$RSC_SERVER_ACTION_2 = async function f($$ACTION_CLOSURE_BOUND, y, ...z) { export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_2 = async function f($$ACTION_CLOSURE_BOUND, y, ...z) {
var [$$ACTION_ARG_0] = await decryptActionBoundArgs("7f1c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0] = await decryptActionBoundArgs("7f1c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", $$ACTION_CLOSURE_BOUND);
return $$ACTION_ARG_0 + y + z[0]; return $$ACTION_ARG_0 + y + z[0];
}; };
......
/* __next_internal_action_entry_do_not_use__ {"7fab21efdafbe611287bc25c0462b1e0510d13e48b":"foo","7fac840dcaf5e8197cb02b7f3a43c119b7a770b272":"bar"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"7fab21efdafbe611287bc25c0462b1e0510d13e48b":"foo","7fac840dcaf5e8197cb02b7f3a43c119b7a770b272":"bar"} */ import { registerServerReference } from "private-next-rsc-server-reference";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
export const foo = async ()=>{}; export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ foo = async ()=>{};
const bar = async ()=>{}; const bar = async ()=>{};
export { bar }; export { /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ bar };
import { ensureServerEntryExports } from "private-next-rsc-action-validate"; import { ensureServerEntryExports } from "private-next-rsc-action-validate";
ensureServerEntryExports([ ensureServerEntryExports([
foo, foo,
......
...@@ -2,13 +2,13 @@ ...@@ -2,13 +2,13 @@
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
import deleteFromDb from 'db'; import deleteFromDb from 'db';
const v1 = 'v1'; const v1 = 'v1';
export const $$RSC_SERVER_ACTION_0 = async function action($$ACTION_CLOSURE_BOUND) { export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_0 = async function action($$ACTION_CLOSURE_BOUND) {
var [$$ACTION_ARG_0, $$ACTION_ARG_1] = await decryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0, $$ACTION_ARG_1] = await decryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND);
await deleteFromDb($$ACTION_ARG_0); await deleteFromDb($$ACTION_ARG_0);
await deleteFromDb(v1); await deleteFromDb(v1);
await deleteFromDb($$ACTION_ARG_1); await deleteFromDb($$ACTION_ARG_1);
}; };
export const $$RSC_SERVER_ACTION_1 = async function action($$ACTION_CLOSURE_BOUND) { export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_1 = async function action($$ACTION_CLOSURE_BOUND) {
var [$$ACTION_ARG_0, $$ACTION_ARG_1] = await decryptActionBoundArgs("4090b5db271335765a4b0eab01f044b381b5ebd5cd", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0, $$ACTION_ARG_1] = await decryptActionBoundArgs("4090b5db271335765a4b0eab01f044b381b5ebd5cd", $$ACTION_CLOSURE_BOUND);
await deleteFromDb($$ACTION_ARG_0); await deleteFromDb($$ACTION_ARG_0);
await deleteFromDb(v1); await deleteFromDb(v1);
......
/* __next_internal_action_entry_do_not_use__ {"606a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"606a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0"} */ import { registerServerReference } from "private-next-rsc-server-reference";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
export const $$RSC_SERVER_ACTION_0 = async function action($$ACTION_CLOSURE_BOUND, value2) { export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_0 = async function action($$ACTION_CLOSURE_BOUND, value2) {
var [$$ACTION_ARG_0] = await decryptActionBoundArgs("606a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0] = await decryptActionBoundArgs("606a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND);
return $$ACTION_ARG_0 * value2; return $$ACTION_ARG_0 * value2;
}; };
......
/* __next_internal_action_entry_do_not_use__ {"0090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1","706a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ /* __next_internal_action_entry_do_not_use__ {"0090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1","706a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0"} */ import { registerServerReference } from "private-next-rsc-server-reference";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
export const $$RSC_SERVER_ACTION_0 = async function myAction(a, b, c) { export const $$RSC_SERVER_ACTION_0 = async function myAction(a, b, c) {
console.log('a'); console.log('a');
...@@ -7,6 +7,6 @@ var myAction = registerServerReference($$RSC_SERVER_ACTION_0, "706a88810ecce4a4e ...@@ -7,6 +7,6 @@ var myAction = registerServerReference($$RSC_SERVER_ACTION_0, "706a88810ecce4a4e
export default function Page() { export default function Page() {
return <Button action={myAction}>Delete</Button>; return <Button action={myAction}>Delete</Button>;
} }
export const $$RSC_SERVER_ACTION_1 = async function() {}; export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_1 = async function() {};
// TODO: should use `action` as function name? // TODO: should use `action` as function name?
export const action = withValidate(registerServerReference($$RSC_SERVER_ACTION_1, "0090b5db271335765a4b0eab01f044b381b5ebd5cd", null)); export const action = withValidate(registerServerReference($$RSC_SERVER_ACTION_1, "0090b5db271335765a4b0eab01f044b381b5ebd5cd", null));
...@@ -3,7 +3,7 @@ import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc ...@@ -3,7 +3,7 @@ import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc
const [foo] = [ const [foo] = [
null null
]; ];
export default foo; export default /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ foo;
import { ensureServerEntryExports } from "private-next-rsc-action-validate"; import { ensureServerEntryExports } from "private-next-rsc-action-validate";
ensureServerEntryExports([ ensureServerEntryExports([
foo foo
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
import { validator, another } from 'auth'; import { validator, another } from 'auth';
const x = 1; const x = 1;
export const $$RSC_SERVER_ACTION_0 = async function($$ACTION_CLOSURE_BOUND, z) { export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_0 = async function($$ACTION_CLOSURE_BOUND, z) {
var [$$ACTION_ARG_0] = await decryptActionBoundArgs("606a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0] = await decryptActionBoundArgs("606a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND);
return x + $$ACTION_ARG_0 + z; return x + $$ACTION_ARG_0 + z;
}; };
...@@ -13,7 +13,7 @@ export default function Page() { ...@@ -13,7 +13,7 @@ export default function Page() {
y y
])))}/>; ])))}/>;
} }
export const $$RSC_SERVER_ACTION_1 = async function() {}; export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_1 = async function() {};
validator(registerServerReference($$RSC_SERVER_ACTION_1, "0090b5db271335765a4b0eab01f044b381b5ebd5cd", null)); validator(registerServerReference($$RSC_SERVER_ACTION_1, "0090b5db271335765a4b0eab01f044b381b5ebd5cd", null));
export const $$RSC_SERVER_ACTION_2 = async function() {}; export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_2 = async function() {};
another(validator(registerServerReference($$RSC_SERVER_ACTION_2, "001c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", null))); another(validator(registerServerReference($$RSC_SERVER_ACTION_2, "001c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", null)));
/* __next_internal_action_entry_do_not_use__ {"7fc18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default","7ff14702b5a021dd117f7ec7a3c838f397c2046d3b":"action"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"7fc18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default","7ff14702b5a021dd117f7ec7a3c838f397c2046d3b":"action"} */ import { registerServerReference } from "private-next-rsc-server-reference";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
import { validator } from 'auth'; import { validator } from 'auth';
export const action = validator(async ()=>{}); export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ action = validator(async ()=>{});
export default $$RSC_SERVER_ACTION_0 = validator(async ()=>{}); export default /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_0 = validator(async ()=>{});
var $$RSC_SERVER_ACTION_0; var $$RSC_SERVER_ACTION_0;
Object.defineProperty($$RSC_SERVER_ACTION_0, "name", { Object.defineProperty($$RSC_SERVER_ACTION_0, "name", {
"value": "default", "value": "default",
......
/* __next_internal_action_entry_do_not_use__ {"7c6a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0","7c90b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"7c6a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0","7c90b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1"} */ import { registerServerReference } from "private-next-rsc-server-reference";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
export const $$RSC_SERVER_ACTION_0 = async function action($$ACTION_CLOSURE_BOUND, a, b, c, d) { export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_0 = async function action($$ACTION_CLOSURE_BOUND, a, b, c, d) {
var [$$ACTION_ARG_0] = await decryptActionBoundArgs("7c6a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0] = await decryptActionBoundArgs("7c6a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND);
console.log(a, b, $$ACTION_ARG_0, c, d); console.log(a, b, $$ACTION_ARG_0, c, d);
}; };
export const $$RSC_SERVER_ACTION_1 = async function action2($$ACTION_CLOSURE_BOUND, a, b, c, d) { export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_1 = async function action2($$ACTION_CLOSURE_BOUND, a, b, c, d) {
var [$$ACTION_ARG_0] = await decryptActionBoundArgs("7c90b5db271335765a4b0eab01f044b381b5ebd5cd", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0] = await decryptActionBoundArgs("7c90b5db271335765a4b0eab01f044b381b5ebd5cd", $$ACTION_CLOSURE_BOUND);
console.log(a, b, $$ACTION_ARG_0, c, d); console.log(a, b, $$ACTION_ARG_0, c, d);
}; };
......
/* __next_internal_action_entry_do_not_use__ {"7c6a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"7c6a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0"} */ import { registerServerReference } from "private-next-rsc-server-reference";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
export const $$RSC_SERVER_ACTION_0 = async function action($$ACTION_CLOSURE_BOUND, a, b, c, { d }) { export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_0 = async function action($$ACTION_CLOSURE_BOUND, a, b, c, { d }) {
var [$$ACTION_ARG_0] = await decryptActionBoundArgs("7c6a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0] = await decryptActionBoundArgs("7c6a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND);
console.log(a, b, $$ACTION_ARG_0, d); console.log(a, b, $$ACTION_ARG_0, d);
}; };
......
/* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0","4090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0","4090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1"} */ import { registerServerReference } from "private-next-rsc-server-reference";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
import deleteFromDb from 'db'; import deleteFromDb from 'db';
export const $$RSC_SERVER_ACTION_0 = async function deleteItem($$ACTION_CLOSURE_BOUND) { export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_0 = async function deleteItem($$ACTION_CLOSURE_BOUND) {
var [$$ACTION_ARG_0, $$ACTION_ARG_1] = await decryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0, $$ACTION_ARG_1] = await decryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND);
await deleteFromDb($$ACTION_ARG_0); await deleteFromDb($$ACTION_ARG_0);
await deleteFromDb($$ACTION_ARG_1); await deleteFromDb($$ACTION_ARG_1);
...@@ -17,7 +17,7 @@ export function Item({ id1, id2 }) { ...@@ -17,7 +17,7 @@ export function Item({ id1, id2 }) {
id2 id2
])); ]));
} }
export const $$RSC_SERVER_ACTION_1 = async function deleteItem($$ACTION_CLOSURE_BOUND) { export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_1 = async function deleteItem($$ACTION_CLOSURE_BOUND) {
var [$$ACTION_ARG_0, $$ACTION_ARG_1] = await decryptActionBoundArgs("4090b5db271335765a4b0eab01f044b381b5ebd5cd", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0, $$ACTION_ARG_1] = await decryptActionBoundArgs("4090b5db271335765a4b0eab01f044b381b5ebd5cd", $$ACTION_CLOSURE_BOUND);
await deleteFromDb($$ACTION_ARG_0); await deleteFromDb($$ACTION_ARG_0);
await deleteFromDb($$ACTION_ARG_1); await deleteFromDb($$ACTION_ARG_1);
......
/* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0"} */ import { registerServerReference } from "private-next-rsc-server-reference";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
const noop = (action)=>action; const noop = (action)=>action;
export const $$RSC_SERVER_ACTION_0 = async function(data) { export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_0 = async function(data) {
console.log(data); console.log(data);
}; };
// TODO: should use `log` as function name? // TODO: should use `log` as function name?
......
// Rules here: // Rules here:
// 1. Each exported function should still be exported, but as a reference `registerServerReference(...)`. // 1. Each exported function should still be exported, but as a reference `registerServerReference(...)`.
// 2. Actual action functions should be renamed to `$$ACTION_...` and got exported. // 2. Actual action functions should be renamed to `$$ACTION_...` and got exported.
/* __next_internal_action_entry_do_not_use__ {"001c36b06e398c97abe5d5d7ae8c672bfddf4e1b91":"$$RSC_SERVER_ACTION_2","006a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0","0090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1","009ed0cc47abc4e1c64320cf42b74ae60b58c40f00":"$$RSC_SERVER_ACTION_3","00a9b2939c1f39073a6bed227fd20233064c8b7869":"$$RSC_SERVER_ACTION_4"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ /* __next_internal_action_entry_do_not_use__ {"001c36b06e398c97abe5d5d7ae8c672bfddf4e1b91":"$$RSC_SERVER_ACTION_2","006a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0","0090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1","009ed0cc47abc4e1c64320cf42b74ae60b58c40f00":"$$RSC_SERVER_ACTION_3","00a9b2939c1f39073a6bed227fd20233064c8b7869":"$$RSC_SERVER_ACTION_4"} */ import { registerServerReference } from "private-next-rsc-server-reference";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
export const $$RSC_SERVER_ACTION_0 = async function foo() { export const $$RSC_SERVER_ACTION_0 = async function foo() {
console.log(1); console.log(1);
}; };
var foo = registerServerReference($$RSC_SERVER_ACTION_0, "006a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null); var foo = registerServerReference($$RSC_SERVER_ACTION_0, "006a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
export { foo }; export { foo };
export const $$RSC_SERVER_ACTION_1 = async function bar() { export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_1 = async function bar() {
console.log(2); console.log(2);
}; };
export var bar = registerServerReference($$RSC_SERVER_ACTION_1, "0090b5db271335765a4b0eab01f044b381b5ebd5cd", null); export var bar = registerServerReference($$RSC_SERVER_ACTION_1, "0090b5db271335765a4b0eab01f044b381b5ebd5cd", null);
export const $$RSC_SERVER_ACTION_2 = async function baz() { export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_2 = async function baz() {
console.log(3); console.log(3);
}; };
export default registerServerReference($$RSC_SERVER_ACTION_2, "001c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", null); export default registerServerReference($$RSC_SERVER_ACTION_2, "001c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", null);
export const $$RSC_SERVER_ACTION_3 = async function qux() { export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_3 = async function qux() {
console.log(4); console.log(4);
}; };
export const qux = registerServerReference($$RSC_SERVER_ACTION_3, "009ed0cc47abc4e1c64320cf42b74ae60b58c40f00", null); export const qux = registerServerReference($$RSC_SERVER_ACTION_3, "009ed0cc47abc4e1c64320cf42b74ae60b58c40f00", null);
export const $$RSC_SERVER_ACTION_4 = async function quuux() { export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_4 = async function quuux() {
console.log(5); console.log(5);
}; };
export const quux = registerServerReference($$RSC_SERVER_ACTION_4, "00a9b2939c1f39073a6bed227fd20233064c8b7869", null); export const quux = registerServerReference($$RSC_SERVER_ACTION_4, "00a9b2939c1f39073a6bed227fd20233064c8b7869", null);
/* __next_internal_action_entry_do_not_use__ {"601c36b06e398c97abe5d5d7ae8c672bfddf4e1b91":"$$RSC_SERVER_ACTION_2","606a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0","6090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"601c36b06e398c97abe5d5d7ae8c672bfddf4e1b91":"$$RSC_SERVER_ACTION_2","606a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0","6090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1"} */ import { registerServerReference } from "private-next-rsc-server-reference";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
let a, f; let a, f;
export const $$RSC_SERVER_ACTION_0 = async function action2($$ACTION_CLOSURE_BOUND, e) { export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_0 = async function action2($$ACTION_CLOSURE_BOUND, e) {
var [$$ACTION_ARG_0, $$ACTION_ARG_1, $$ACTION_ARG_2, $$ACTION_ARG_3] = await decryptActionBoundArgs("606a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0, $$ACTION_ARG_1, $$ACTION_ARG_2, $$ACTION_ARG_3] = await decryptActionBoundArgs("606a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND);
console.log(a, $$ACTION_ARG_0, $$ACTION_ARG_1, e, $$ACTION_ARG_2, $$ACTION_ARG_3); console.log(a, $$ACTION_ARG_0, $$ACTION_ARG_1, e, $$ACTION_ARG_2, $$ACTION_ARG_3);
}; };
export const $$RSC_SERVER_ACTION_1 = async function action3($$ACTION_CLOSURE_BOUND, e) { export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_1 = async function action3($$ACTION_CLOSURE_BOUND, e) {
var [$$ACTION_ARG_0, $$ACTION_ARG_1, $$ACTION_ARG_2] = await decryptActionBoundArgs("6090b5db271335765a4b0eab01f044b381b5ebd5cd", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0, $$ACTION_ARG_1, $$ACTION_ARG_2] = await decryptActionBoundArgs("6090b5db271335765a4b0eab01f044b381b5ebd5cd", $$ACTION_CLOSURE_BOUND);
$$ACTION_ARG_0(e); $$ACTION_ARG_0(e);
console.log(a, $$ACTION_ARG_1, $$ACTION_ARG_2, e); console.log(a, $$ACTION_ARG_1, $$ACTION_ARG_2, e);
}; };
export const $$RSC_SERVER_ACTION_2 = async function action1($$ACTION_CLOSURE_BOUND, d) { export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_2 = async function action1($$ACTION_CLOSURE_BOUND, d) {
var [$$ACTION_ARG_0, $$ACTION_ARG_1, $$ACTION_ARG_2] = await decryptActionBoundArgs("601c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0, $$ACTION_ARG_1, $$ACTION_ARG_2] = await decryptActionBoundArgs("601c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", $$ACTION_CLOSURE_BOUND);
let f; let f;
console.log(...window, { console.log(...window, {
......
/* __next_internal_action_entry_do_not_use__ {"7f28baf972d345b86b747ad0df73d75a0088a42214":"dec","7fc18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"7f28baf972d345b86b747ad0df73d75a0088a42214":"dec","7fc18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default"} */ import { registerServerReference } from "private-next-rsc-server-reference";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
export const dec = async (value)=>{ export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ dec = async (value)=>{
return value - 1; return value - 1;
}; };
// Test case for https://github.com/vercel/next.js/issues/54655 // Test case for https://github.com/vercel/next.js/issues/54655
export default dec; export default /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ dec;
import { ensureServerEntryExports } from "private-next-rsc-action-validate"; import { ensureServerEntryExports } from "private-next-rsc-action-validate";
ensureServerEntryExports([ ensureServerEntryExports([
dec, dec,
......
// app/send.ts // app/send.ts
/* __next_internal_action_entry_do_not_use__ {"70e10665baac148856374b2789aceb970f66fec33e":"myAction"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"70e10665baac148856374b2789aceb970f66fec33e":"myAction"} */ import { registerServerReference } from "private-next-rsc-server-reference";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
export async function myAction(a, b, c) { export async function /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ myAction(a, b, c) {
console.log('a'); console.log('a');
} }
import { ensureServerEntryExports } from "private-next-rsc-action-validate"; import { ensureServerEntryExports } from "private-next-rsc-action-validate";
......
/* __next_internal_action_entry_do_not_use__ {"601c36b06e398c97abe5d5d7ae8c672bfddf4e1b91":"$$RSC_SERVER_ACTION_2","606a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0","6090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1","7f0090eaf4e1f08a2d94f6be401e54a2ded399b87c":"action0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"601c36b06e398c97abe5d5d7ae8c672bfddf4e1b91":"$$RSC_SERVER_ACTION_2","606a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0","6090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1","7f0090eaf4e1f08a2d94f6be401e54a2ded399b87c":"action0"} */ import { registerServerReference } from "private-next-rsc-server-reference";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
let a, f; let a, f;
export const $$RSC_SERVER_ACTION_0 = async function action2($$ACTION_CLOSURE_BOUND, e) { export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_0 = async function action2($$ACTION_CLOSURE_BOUND, e) {
var [$$ACTION_ARG_0, $$ACTION_ARG_1, $$ACTION_ARG_2, $$ACTION_ARG_3] = await decryptActionBoundArgs("606a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0, $$ACTION_ARG_1, $$ACTION_ARG_2, $$ACTION_ARG_3] = await decryptActionBoundArgs("606a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND);
console.log(a, $$ACTION_ARG_0, $$ACTION_ARG_1, e, $$ACTION_ARG_2, $$ACTION_ARG_3); console.log(a, $$ACTION_ARG_0, $$ACTION_ARG_1, e, $$ACTION_ARG_2, $$ACTION_ARG_3);
}; };
export const $$RSC_SERVER_ACTION_1 = async function action3($$ACTION_CLOSURE_BOUND, e) { export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_1 = async function action3($$ACTION_CLOSURE_BOUND, e) {
var [$$ACTION_ARG_0, $$ACTION_ARG_1, $$ACTION_ARG_2] = await decryptActionBoundArgs("6090b5db271335765a4b0eab01f044b381b5ebd5cd", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0, $$ACTION_ARG_1, $$ACTION_ARG_2] = await decryptActionBoundArgs("6090b5db271335765a4b0eab01f044b381b5ebd5cd", $$ACTION_CLOSURE_BOUND);
$$ACTION_ARG_0(e); $$ACTION_ARG_0(e);
console.log(a, $$ACTION_ARG_1, $$ACTION_ARG_2, e); console.log(a, $$ACTION_ARG_1, $$ACTION_ARG_2, e);
}; };
export const $$RSC_SERVER_ACTION_2 = async function action1($$ACTION_CLOSURE_BOUND, d) { export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_2 = async function action1($$ACTION_CLOSURE_BOUND, d) {
var [$$ACTION_ARG_0, $$ACTION_ARG_1, $$ACTION_ARG_2] = await decryptActionBoundArgs("601c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0, $$ACTION_ARG_1, $$ACTION_ARG_2] = await decryptActionBoundArgs("601c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", $$ACTION_CLOSURE_BOUND);
let f; let f;
console.log(...window, { console.log(...window, {
...@@ -32,7 +32,7 @@ export const $$RSC_SERVER_ACTION_2 = async function action1($$ACTION_CLOSURE_BOU ...@@ -32,7 +32,7 @@ export const $$RSC_SERVER_ACTION_2 = async function action1($$ACTION_CLOSURE_BOU
])) ]))
]; ];
}; };
export async function action0(b, c, ...g) { export async function /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ action0(b, c, ...g) {
return registerServerReference($$RSC_SERVER_ACTION_2, "601c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", null).bind(null, encryptActionBoundArgs("601c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", [ return registerServerReference($$RSC_SERVER_ACTION_2, "601c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", null).bind(null, encryptActionBoundArgs("601c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", [
b, b,
c, c,
......
/* __next_internal_action_entry_do_not_use__ {"7fabf760c735ba66c4c26a2913864dd7e28fb88a91":"action2","7ff14702b5a021dd117f7ec7a3c838f397c2046d3b":"action"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"7fabf760c735ba66c4c26a2913864dd7e28fb88a91":"action2","7ff14702b5a021dd117f7ec7a3c838f397c2046d3b":"action"} */ import { registerServerReference } from "private-next-rsc-server-reference";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
export const action = { export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ action = {
async f (x) { async f (x) {
; ;
(()=>{ (()=>{
...@@ -8,7 +8,7 @@ export const action = { ...@@ -8,7 +8,7 @@ export const action = {
})(); })();
} }
}.f; }.f;
export const action2 = new class X { export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ action2 = new class X {
async f(x) { async f(x) {
; ;
(()=>{ (()=>{
......
/* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0"} */ import { registerServerReference } from "private-next-rsc-server-reference";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
export const $$RSC_SERVER_ACTION_0 = async function action($$ACTION_CLOSURE_BOUND) { export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_0 = async function action($$ACTION_CLOSURE_BOUND) {
var [$$ACTION_ARG_0, $$ACTION_ARG_1, $$ACTION_ARG_2] = await decryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0, $$ACTION_ARG_1, $$ACTION_ARG_2] = await decryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND);
console.log($$ACTION_ARG_0.at(1), $$ACTION_ARG_1, $$ACTION_ARG_1.current); console.log($$ACTION_ARG_0.at(1), $$ACTION_ARG_1, $$ACTION_ARG_1.current);
console.log($$ACTION_ARG_2.push.call($$ACTION_ARG_2, 5)); console.log($$ACTION_ARG_2.push.call($$ACTION_ARG_2, 5));
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper";
const v = 'world'; const v = 'world';
export var $$RSC_SERVER_CACHE_0 = $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, async function fn() { export var $$RSC_SERVER_CACHE_0 = $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ async function fn() {
return 'hello, ' + v; return 'hello, ' + v;
}); });
Object.defineProperty($$RSC_SERVER_CACHE_0, "name", { Object.defineProperty($$RSC_SERVER_CACHE_0, "name", {
......
...@@ -8,9 +8,9 @@ Object.defineProperty($$RSC_SERVER_CACHE_0, "name", { ...@@ -8,9 +8,9 @@ Object.defineProperty($$RSC_SERVER_CACHE_0, "name", {
"value": "foo", "value": "foo",
"writable": false "writable": false
}); });
const foo = registerServerReference($$RSC_SERVER_CACHE_0, "803128060c414d59f8552e4788b846c0d2b7f74743", null); const foo = /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ registerServerReference($$RSC_SERVER_CACHE_0, "803128060c414d59f8552e4788b846c0d2b7f74743", null);
export { bar }; export { bar };
export var $$RSC_SERVER_CACHE_1 = $$cache__("default", "80951c375b4a6a6e89d67b743ec5808127cfde405d", 0, async function bar() { export var $$RSC_SERVER_CACHE_1 = $$cache__("default", "80951c375b4a6a6e89d67b743ec5808127cfde405d", 0, /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ async function bar() {
return 'bar'; return 'bar';
}); });
Object.defineProperty($$RSC_SERVER_CACHE_1, "name", { Object.defineProperty($$RSC_SERVER_CACHE_1, "name", {
...@@ -22,7 +22,7 @@ var bar = registerServerReference($$RSC_SERVER_CACHE_1, "80951c375b4a6a6e89d67b7 ...@@ -22,7 +22,7 @@ var bar = registerServerReference($$RSC_SERVER_CACHE_1, "80951c375b4a6a6e89d67b7
const qux = async function qux() { const qux = async function qux() {
return 'qux'; return 'qux';
}; };
export var $$RSC_SERVER_CACHE_2 = $$cache__("default", "8069348c79fce073bae2f70f139565a2fda1c74c74", 0, async function baz() { export var $$RSC_SERVER_CACHE_2 = $$cache__("default", "8069348c79fce073bae2f70f139565a2fda1c74c74", 0, /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ async function baz() {
return qux() + 'baz'; return qux() + 'baz';
}); });
Object.defineProperty($$RSC_SERVER_CACHE_2, "name", { Object.defineProperty($$RSC_SERVER_CACHE_2, "name", {
...@@ -37,6 +37,6 @@ Object.defineProperty($$RSC_SERVER_CACHE_3, "name", { ...@@ -37,6 +37,6 @@ Object.defineProperty($$RSC_SERVER_CACHE_3, "name", {
"value": "quux", "value": "quux",
"writable": false "writable": false
}); });
const quux = registerServerReference($$RSC_SERVER_CACHE_3, "8012a8d21b6362b4cc8f5b15560525095bc48dba80", null); const quux = /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ registerServerReference($$RSC_SERVER_CACHE_3, "8012a8d21b6362b4cc8f5b15560525095bc48dba80", null);
export { foo, baz }; export { foo, baz };
export default quux; export default quux;
...@@ -8,4 +8,4 @@ Object.defineProperty($$RSC_SERVER_CACHE_0, "name", { ...@@ -8,4 +8,4 @@ Object.defineProperty($$RSC_SERVER_CACHE_0, "name", {
"value": "my_fn", "value": "my_fn",
"writable": false "writable": false
}); });
export const my_fn = registerServerReference($$RSC_SERVER_CACHE_0, "803128060c414d59f8552e4788b846c0d2b7f74743", null); export const my_fn = /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ registerServerReference($$RSC_SERVER_CACHE_0, "803128060c414d59f8552e4788b846c0d2b7f74743", null);
/* __next_internal_action_entry_do_not_use__ {"8012a8d21b6362b4cc8f5b15560525095bc48dba80":"$$RSC_SERVER_CACHE_3","803128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0","80951c375b4a6a6e89d67b743ec5808127cfde405d":"$$RSC_SERVER_CACHE_1","c069348c79fce073bae2f70f139565a2fda1c74c74":"$$RSC_SERVER_CACHE_2"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"8012a8d21b6362b4cc8f5b15560525095bc48dba80":"$$RSC_SERVER_CACHE_3","803128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0","80951c375b4a6a6e89d67b743ec5808127cfde405d":"$$RSC_SERVER_CACHE_1","c069348c79fce073bae2f70f139565a2fda1c74c74":"$$RSC_SERVER_CACHE_2"} */ import { registerServerReference } from "private-next-rsc-server-reference";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper";
export var $$RSC_SERVER_CACHE_0 = $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, async function foo() { export var $$RSC_SERVER_CACHE_0 = $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ async function foo() {
return 'data A'; return 'data A';
}); });
Object.defineProperty($$RSC_SERVER_CACHE_0, "name", { Object.defineProperty($$RSC_SERVER_CACHE_0, "name", {
...@@ -9,7 +9,7 @@ Object.defineProperty($$RSC_SERVER_CACHE_0, "name", { ...@@ -9,7 +9,7 @@ Object.defineProperty($$RSC_SERVER_CACHE_0, "name", {
"writable": false "writable": false
}); });
export var foo = registerServerReference($$RSC_SERVER_CACHE_0, "803128060c414d59f8552e4788b846c0d2b7f74743", null); export var foo = registerServerReference($$RSC_SERVER_CACHE_0, "803128060c414d59f8552e4788b846c0d2b7f74743", null);
export var $$RSC_SERVER_CACHE_1 = $$cache__("default", "80951c375b4a6a6e89d67b743ec5808127cfde405d", 0, async function bar() { export var $$RSC_SERVER_CACHE_1 = $$cache__("default", "80951c375b4a6a6e89d67b743ec5808127cfde405d", 0, /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ async function bar() {
return 'data B'; return 'data B';
}); });
Object.defineProperty($$RSC_SERVER_CACHE_1, "name", { Object.defineProperty($$RSC_SERVER_CACHE_1, "name", {
...@@ -17,7 +17,7 @@ Object.defineProperty($$RSC_SERVER_CACHE_1, "name", { ...@@ -17,7 +17,7 @@ Object.defineProperty($$RSC_SERVER_CACHE_1, "name", {
"writable": false "writable": false
}); });
export var bar = registerServerReference($$RSC_SERVER_CACHE_1, "80951c375b4a6a6e89d67b743ec5808127cfde405d", null); export var bar = registerServerReference($$RSC_SERVER_CACHE_1, "80951c375b4a6a6e89d67b743ec5808127cfde405d", null);
export var $$RSC_SERVER_CACHE_2 = $$cache__("default", "c069348c79fce073bae2f70f139565a2fda1c74c74", 0, async function Cached({ children }) { export var $$RSC_SERVER_CACHE_2 = $$cache__("default", "c069348c79fce073bae2f70f139565a2fda1c74c74", 0, /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ async function Cached({ children }) {
return children; return children;
}); });
Object.defineProperty($$RSC_SERVER_CACHE_2, "name", { Object.defineProperty($$RSC_SERVER_CACHE_2, "name", {
...@@ -25,7 +25,7 @@ Object.defineProperty($$RSC_SERVER_CACHE_2, "name", { ...@@ -25,7 +25,7 @@ Object.defineProperty($$RSC_SERVER_CACHE_2, "name", {
"writable": false "writable": false
}); });
export default registerServerReference($$RSC_SERVER_CACHE_2, "c069348c79fce073bae2f70f139565a2fda1c74c74", null); export default registerServerReference($$RSC_SERVER_CACHE_2, "c069348c79fce073bae2f70f139565a2fda1c74c74", null);
export var $$RSC_SERVER_CACHE_3 = $$cache__("default", "8012a8d21b6362b4cc8f5b15560525095bc48dba80", 0, async function baz() { export var $$RSC_SERVER_CACHE_3 = $$cache__("default", "8012a8d21b6362b4cc8f5b15560525095bc48dba80", 0, /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ async function baz() {
return 'data C'; return 'data C';
}); });
Object.defineProperty($$RSC_SERVER_CACHE_3, "name", { Object.defineProperty($$RSC_SERVER_CACHE_3, "name", {
......
/* __next_internal_action_entry_do_not_use__ {"803128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"803128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper";
export var $$RSC_SERVER_CACHE_0 = $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, async function fn() { export var $$RSC_SERVER_CACHE_0 = $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ async function fn() {
return 'foo'; return 'foo';
}); });
Object.defineProperty($$RSC_SERVER_CACHE_0, "name", { Object.defineProperty($$RSC_SERVER_CACHE_0, "name", {
......
/* __next_internal_action_entry_do_not_use__ {"803128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"803128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper";
export var $$RSC_SERVER_CACHE_0 = $$cache__("x", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, async function foo() { export var $$RSC_SERVER_CACHE_0 = $$cache__("x", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ async function foo() {
return 'data'; return 'data';
}); });
Object.defineProperty($$RSC_SERVER_CACHE_0, "name", { Object.defineProperty($$RSC_SERVER_CACHE_0, "name", {
......
/* __next_internal_action_entry_do_not_use__ {"c03128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"c03128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper";
export var $$RSC_SERVER_CACHE_0 = $$cache__("default", "c03128060c414d59f8552e4788b846c0d2b7f74743", 2, async function fn([$$ACTION_ARG_0, $$ACTION_ARG_1]) { export var $$RSC_SERVER_CACHE_0 = $$cache__("default", "c03128060c414d59f8552e4788b846c0d2b7f74743", 2, /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ async function fn([$$ACTION_ARG_0, $$ACTION_ARG_1]) {
console.log($$ACTION_ARG_0); console.log($$ACTION_ARG_0);
return { return {
foo: $$ACTION_ARG_1 foo: $$ACTION_ARG_1
......
/* __next_internal_action_entry_do_not_use__ {"001ab723c80dcca470e0410b4b2a2fc2bf21f41476":"c","006a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0","006e7bc104e4d6e7fda190c4a51be969cfd0be6d6d":"a","00d1f7eb64271d7c601dfef7d4d7053de1c2ca4338":"b"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"001ab723c80dcca470e0410b4b2a2fc2bf21f41476":"c","006a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0","006e7bc104e4d6e7fda190c4a51be969cfd0be6d6d":"a","00d1f7eb64271d7c601dfef7d4d7053de1c2ca4338":"b"} */ import { registerServerReference } from "private-next-rsc-server-reference";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
export async function a() {} export async function /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ a() {}
export async function b() {} export async function /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ b() {}
export async function c() {} export async function /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ c() {}
function d() {} function d() {}
export const $$RSC_SERVER_ACTION_0 = async function e() {}; export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_0 = async function e() {};
function Foo() { function Foo() {
var e = registerServerReference($$RSC_SERVER_ACTION_0, "006a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null); var e = registerServerReference($$RSC_SERVER_ACTION_0, "006a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
} }
......
/* __next_internal_action_entry_do_not_use__ {"601c36b06e398c97abe5d5d7ae8c672bfddf4e1b91":"$$RSC_SERVER_ACTION_2","e03128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"601c36b06e398c97abe5d5d7ae8c672bfddf4e1b91":"$$RSC_SERVER_ACTION_2","e03128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper";
export var $$RSC_SERVER_CACHE_0 = $$cache__("default", "e03128060c414d59f8552e4788b846c0d2b7f74743", 2, async function cache([$$ACTION_ARG_0, $$ACTION_ARG_1], e) { export var $$RSC_SERVER_CACHE_0 = $$cache__("default", "e03128060c414d59f8552e4788b846c0d2b7f74743", 2, /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ async function cache([$$ACTION_ARG_0, $$ACTION_ARG_1], e) {
const f = $$ACTION_ARG_0 + e; const f = $$ACTION_ARG_0 + e;
return [ return [
f, f,
...@@ -14,7 +14,7 @@ Object.defineProperty($$RSC_SERVER_CACHE_0, "name", { ...@@ -14,7 +14,7 @@ Object.defineProperty($$RSC_SERVER_CACHE_0, "name", {
"value": "cache", "value": "cache",
"writable": false "writable": false
}); });
export const $$RSC_SERVER_ACTION_2 = async function action($$ACTION_CLOSURE_BOUND, c) { export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_2 = async function action($$ACTION_CLOSURE_BOUND, c) {
var [$$ACTION_ARG_0, $$ACTION_ARG_1] = await decryptActionBoundArgs("601c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0, $$ACTION_ARG_1] = await decryptActionBoundArgs("601c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", $$ACTION_CLOSURE_BOUND);
const d = $$ACTION_ARG_0 + $$ACTION_ARG_1 + c; const d = $$ACTION_ARG_0 + $$ACTION_ARG_1 + c;
var cache = $$RSC_SERVER_REF_1.bind(null, encryptActionBoundArgs("e03128060c414d59f8552e4788b846c0d2b7f74743", [ var cache = $$RSC_SERVER_REF_1.bind(null, encryptActionBoundArgs("e03128060c414d59f8552e4788b846c0d2b7f74743", [
......
/* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0","c0951c375b4a6a6e89d67b743ec5808127cfde405d":"$$RSC_SERVER_CACHE_1"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0","c0951c375b4a6a6e89d67b743ec5808127cfde405d":"$$RSC_SERVER_CACHE_1"} */ import { registerServerReference } from "private-next-rsc-server-reference";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper";
export const $$RSC_SERVER_ACTION_0 = async function fn($$ACTION_CLOSURE_BOUND) { export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_0 = async function fn($$ACTION_CLOSURE_BOUND) {
var [$$ACTION_ARG_0, $$ACTION_ARG_1] = await decryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0, $$ACTION_ARG_1] = await decryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND);
console.log($$ACTION_ARG_0); console.log($$ACTION_ARG_0);
return { return {
foo: $$ACTION_ARG_1 foo: $$ACTION_ARG_1
}; };
}; };
export var $$RSC_SERVER_CACHE_1 = $$cache__("default", "c0951c375b4a6a6e89d67b743ec5808127cfde405d", 0, async function Component({ foo }) { export var $$RSC_SERVER_CACHE_1 = $$cache__("default", "c0951c375b4a6a6e89d67b743ec5808127cfde405d", 0, /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ async function Component({ foo }) {
const a = 123; const a = 123;
var fn = registerServerReference($$RSC_SERVER_ACTION_0, "406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null).bind(null, encryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", [ var fn = registerServerReference($$RSC_SERVER_ACTION_0, "406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null).bind(null, encryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", [
a, a,
......
...@@ -20,4 +20,4 @@ async function Component({ foo }) { ...@@ -20,4 +20,4 @@ async function Component({ foo }) {
const data = await fn(); const data = await fn();
return <div>{data}</div>; return <div>{data}</div>;
} }
var $$RSC_SERVER_REF_1 = registerServerReference($$RSC_SERVER_CACHE_0, "c03128060c414d59f8552e4788b846c0d2b7f74743", null); var $$RSC_SERVER_REF_1 = /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ registerServerReference($$RSC_SERVER_CACHE_0, "c03128060c414d59f8552e4788b846c0d2b7f74743", null);
...@@ -3,11 +3,11 @@ import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc ...@@ -3,11 +3,11 @@ import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc
import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper";
import { Foo } from './client'; import { Foo } from './client';
const secret = 'my password is qwerty123'; const secret = 'my password is qwerty123';
export const $$RSC_SERVER_ACTION_0 = async function action($$ACTION_CLOSURE_BOUND) { export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_0 = async function action($$ACTION_CLOSURE_BOUND) {
var [$$ACTION_ARG_0] = await decryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0] = await decryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND);
console.log(secret, $$ACTION_ARG_0); console.log(secret, $$ACTION_ARG_0);
}; };
export var $$RSC_SERVER_CACHE_1 = $$cache__("default", "e0951c375b4a6a6e89d67b743ec5808127cfde405d", 0, async function getCachedRandom(x, children) { export var $$RSC_SERVER_CACHE_1 = $$cache__("default", "e0951c375b4a6a6e89d67b743ec5808127cfde405d", 0, /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ async function getCachedRandom(x, children) {
return { return {
x, x,
y: Math.random(), y: Math.random(),
......
/* __next_internal_action_entry_do_not_use__ {"001c36b06e398c97abe5d5d7ae8c672bfddf4e1b91":"$$RSC_SERVER_ACTION_2","006a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0","0090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1","009ed0cc47abc4e1c64320cf42b74ae60b58c40f00":"$$RSC_SERVER_ACTION_3","00a9b2939c1f39073a6bed227fd20233064c8b7869":"$$RSC_SERVER_ACTION_4"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"001c36b06e398c97abe5d5d7ae8c672bfddf4e1b91":"$$RSC_SERVER_ACTION_2","006a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0","0090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1","009ed0cc47abc4e1c64320cf42b74ae60b58c40f00":"$$RSC_SERVER_ACTION_3","00a9b2939c1f39073a6bed227fd20233064c8b7869":"$$RSC_SERVER_ACTION_4"} */ import { registerServerReference } from "private-next-rsc-server-reference";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
import { Form } from './form'; import { Form } from './form';
export const $$RSC_SERVER_ACTION_0 = async function foo() { export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_0 = async function foo() {
return 'declarator arrow function expression'; return 'declarator arrow function expression';
}; };
export const $$RSC_SERVER_ACTION_1 = async function bar() { export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_1 = async function bar() {
return 'function declaration'; return 'function declaration';
}; };
export const $$RSC_SERVER_ACTION_2 = async function action() { export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_2 = async function action() {
return 'arrow function expression'; return 'arrow function expression';
}; };
export const $$RSC_SERVER_ACTION_3 = async function action() { export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_3 = async function action() {
return 'anonymous function expression'; return 'anonymous function expression';
}; };
export const $$RSC_SERVER_ACTION_4 = async function baz() { export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_4 = async function baz() {
return 'named function expression'; return 'named function expression';
}; };
export default function Page() { export default function Page() {
......
...@@ -7,7 +7,7 @@ function Foo() { ...@@ -7,7 +7,7 @@ function Foo() {
console.log(v); console.log(v);
return v; return v;
} }
export var $$RSC_SERVER_CACHE_0 = $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, async function bar() { export var $$RSC_SERVER_CACHE_0 = $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ async function bar() {
return <Foo/>; return <Foo/>;
}); });
Object.defineProperty($$RSC_SERVER_CACHE_0, "name", { Object.defineProperty($$RSC_SERVER_CACHE_0, "name", {
......
// This is for testing the "information byte" of Server Action / Cache IDs. // This is for testing the "information byte" of Server Action / Cache IDs.
// Should be 1 110000 0, which is "e0" in hex. // Should be 1 110000 0, which is "e0" in hex.
/* __next_internal_action_entry_do_not_use__ {"6090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1","7c9ed0cc47abc4e1c64320cf42b74ae60b58c40f00":"$$RSC_SERVER_ACTION_3","7ea9b2939c1f39073a6bed227fd20233064c8b7869":"$$RSC_SERVER_ACTION_4","e03128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0","ff471a5eb0be1c31686dd4ba938a80328b80b1615d":"$$RSC_SERVER_CACHE_5","ff69348c79fce073bae2f70f139565a2fda1c74c74":"$$RSC_SERVER_CACHE_2"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ /* __next_internal_action_entry_do_not_use__ {"6090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1","7c9ed0cc47abc4e1c64320cf42b74ae60b58c40f00":"$$RSC_SERVER_ACTION_3","7ea9b2939c1f39073a6bed227fd20233064c8b7869":"$$RSC_SERVER_ACTION_4","e03128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0","ff471a5eb0be1c31686dd4ba938a80328b80b1615d":"$$RSC_SERVER_CACHE_5","ff69348c79fce073bae2f70f139565a2fda1c74c74":"$$RSC_SERVER_CACHE_2"} */ import { registerServerReference } from "private-next-rsc-server-reference";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper";
export var $$RSC_SERVER_CACHE_0 = $$cache__("default", "e03128060c414d59f8552e4788b846c0d2b7f74743", 0, async function f1(a, b) { export var $$RSC_SERVER_CACHE_0 = $$cache__("default", "e03128060c414d59f8552e4788b846c0d2b7f74743", 0, async function f1(a, b) {
...@@ -15,7 +15,7 @@ Object.defineProperty($$RSC_SERVER_CACHE_0, "name", { ...@@ -15,7 +15,7 @@ Object.defineProperty($$RSC_SERVER_CACHE_0, "name", {
}); });
var f1 = registerServerReference($$RSC_SERVER_CACHE_0, "e03128060c414d59f8552e4788b846c0d2b7f74743", null); var f1 = registerServerReference($$RSC_SERVER_CACHE_0, "e03128060c414d59f8552e4788b846c0d2b7f74743", null);
export const // Should be 0 110000 0, which is "60" in hex. export const // Should be 0 110000 0, which is "60" in hex.
$$RSC_SERVER_ACTION_1 = async function f2(a, b) { /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_1 = async function f2(a, b) {
return [ return [
a, a,
b b
...@@ -23,7 +23,7 @@ $$RSC_SERVER_ACTION_1 = async function f2(a, b) { ...@@ -23,7 +23,7 @@ $$RSC_SERVER_ACTION_1 = async function f2(a, b) {
}; };
var f2 = registerServerReference($$RSC_SERVER_ACTION_1, "6090b5db271335765a4b0eab01f044b381b5ebd5cd", null); var f2 = registerServerReference($$RSC_SERVER_ACTION_1, "6090b5db271335765a4b0eab01f044b381b5ebd5cd", null);
export var $$RSC_SERVER_CACHE_2 = $$cache__("default", "ff69348c79fce073bae2f70f139565a2fda1c74c74", 0, // Should be 1 111111 1, which is "ff" in hex. export var $$RSC_SERVER_CACHE_2 = $$cache__("default", "ff69348c79fce073bae2f70f139565a2fda1c74c74", 0, // Should be 1 111111 1, which is "ff" in hex.
async function f3(a, b, ...rest) { /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ async function f3(a, b, ...rest) {
return [ return [
a, a,
b, b,
...@@ -36,7 +36,7 @@ Object.defineProperty($$RSC_SERVER_CACHE_2, "name", { ...@@ -36,7 +36,7 @@ Object.defineProperty($$RSC_SERVER_CACHE_2, "name", {
}); });
var f3 = registerServerReference($$RSC_SERVER_CACHE_2, "ff69348c79fce073bae2f70f139565a2fda1c74c74", null); var f3 = registerServerReference($$RSC_SERVER_CACHE_2, "ff69348c79fce073bae2f70f139565a2fda1c74c74", null);
export const // Should be 0 111110 0, which is "7c" in hex. export const // Should be 0 111110 0, which is "7c" in hex.
$$RSC_SERVER_ACTION_3 = async function f4(a, b, c, d, e) { /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_3 = async function f4(a, b, c, d, e) {
return [ return [
a, a,
b, b,
...@@ -47,7 +47,7 @@ $$RSC_SERVER_ACTION_3 = async function f4(a, b, c, d, e) { ...@@ -47,7 +47,7 @@ $$RSC_SERVER_ACTION_3 = async function f4(a, b, c, d, e) {
}; };
var f4 = registerServerReference($$RSC_SERVER_ACTION_3, "7c9ed0cc47abc4e1c64320cf42b74ae60b58c40f00", null); var f4 = registerServerReference($$RSC_SERVER_ACTION_3, "7c9ed0cc47abc4e1c64320cf42b74ae60b58c40f00", null);
export const // Should be 0 111111 0, which is "7e" in hex. export const // Should be 0 111111 0, which is "7e" in hex.
$$RSC_SERVER_ACTION_4 = async function f4(a, b, c, d, e, f) { /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_4 = async function f4(a, b, c, d, e, f) {
return [ return [
a, a,
b, b,
...@@ -59,7 +59,7 @@ $$RSC_SERVER_ACTION_4 = async function f4(a, b, c, d, e, f) { ...@@ -59,7 +59,7 @@ $$RSC_SERVER_ACTION_4 = async function f4(a, b, c, d, e, f) {
}; };
var f4 = registerServerReference($$RSC_SERVER_ACTION_4, "7ea9b2939c1f39073a6bed227fd20233064c8b7869", null); var f4 = registerServerReference($$RSC_SERVER_ACTION_4, "7ea9b2939c1f39073a6bed227fd20233064c8b7869", null);
export var $$RSC_SERVER_CACHE_5 = $$cache__("default", "ff471a5eb0be1c31686dd4ba938a80328b80b1615d", 0, // Should be 1 111111 1, which is "ff" in hex. export var $$RSC_SERVER_CACHE_5 = $$cache__("default", "ff471a5eb0be1c31686dd4ba938a80328b80b1615d", 0, // Should be 1 111111 1, which is "ff" in hex.
async function f5(a, b, c, d, e, f, g) { /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ async function f5(a, b, c, d, e, f, g) {
return [ return [
a, a,
b, b,
......
/* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0"} */ import { registerServerReference } from "private-next-rsc-server-reference";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
import { redirect } from 'next/navigation'; import { redirect } from 'next/navigation';
export const $$RSC_SERVER_ACTION_0 = async function action(formData) { export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_0 = async function action(formData) {
redirect('/header?name=' + formData.get('name') + '&hidden-info=' + formData.get('hidden-info')); redirect('/header?name=' + formData.get('name') + '&hidden-info=' + formData.get('hidden-info'));
}; };
var action = registerServerReference($$RSC_SERVER_ACTION_0, "406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null); var action = registerServerReference($$RSC_SERVER_ACTION_0, "406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper";
// Should be 0 111000 0, which is "70" in hex. // Should be 0 111000 0, which is "70" in hex.
export async function action(a, b, c) { export async function /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ action(a, b, c) {
return <div> return <div>
{a} {a}
{b} {b}
...@@ -10,7 +10,7 @@ export async function action(a, b, c) { ...@@ -10,7 +10,7 @@ export async function action(a, b, c) {
</div>; </div>;
} }
// Should be 0 111111 1, which is "7f" in hex. // Should be 0 111111 1, which is "7f" in hex.
export default async function action2(a, b, ...c) { export default async function /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ action2(a, b, ...c) {
return <div> return <div>
{a} {a}
{b} {b}
...@@ -18,13 +18,13 @@ export default async function action2(a, b, ...c) { ...@@ -18,13 +18,13 @@ export default async function action2(a, b, ...c) {
</div>; </div>;
} }
// Should be 0 111111 1, which is "60" in hex. // Should be 0 111111 1, which is "60" in hex.
export async function action3(a, b) { export async function /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ action3(a, b) {
return <div> return <div>
{a} {a}
{b} {b}
</div>; </div>;
} }
export var $$RSC_SERVER_CACHE_0 = $$cache__("default", "e03128060c414d59f8552e4788b846c0d2b7f74743", 0, async function cache(a, b) { export var $$RSC_SERVER_CACHE_0 = $$cache__("default", "e03128060c414d59f8552e4788b846c0d2b7f74743", 0, /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ async function cache(a, b) {
return <div> return <div>
{a} {a}
{b} {b}
......
...@@ -8,4 +8,4 @@ export var $$RSC_SERVER_CACHE_0 = $$cache__("default", "f03128060c414d59f8552e47 ...@@ -8,4 +8,4 @@ export var $$RSC_SERVER_CACHE_0 = $$cache__("default", "f03128060c414d59f8552e47
{c} {c}
</div>; </div>;
}); });
export default registerServerReference($$RSC_SERVER_CACHE_0, "f03128060c414d59f8552e4788b846c0d2b7f74743", null); export default /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ registerServerReference($$RSC_SERVER_CACHE_0, "f03128060c414d59f8552e4788b846c0d2b7f74743", null);
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
import deleteFromDb from 'db'; import deleteFromDb from 'db';
const v1 = 'v1'; const v1 = 'v1';
export const $$RSC_SERVER_ACTION_0 = async function deleteItem($$ACTION_CLOSURE_BOUND) { export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_0 = async function deleteItem($$ACTION_CLOSURE_BOUND) {
var [$$ACTION_ARG_0, $$ACTION_ARG_1, $$ACTION_ARG_2, $$ACTION_ARG_3] = await decryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0, $$ACTION_ARG_1, $$ACTION_ARG_2, $$ACTION_ARG_3] = await decryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND);
await deleteFromDb($$ACTION_ARG_0); await deleteFromDb($$ACTION_ARG_0);
await deleteFromDb(v1); await deleteFromDb(v1);
......
/* __next_internal_action_entry_do_not_use__ {"f03128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"f03128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper";
export var $$RSC_SERVER_CACHE_0 = $$cache__("default", "f03128060c414d59f8552e4788b846c0d2b7f74743", 0, async function(a, b, c) { export var $$RSC_SERVER_CACHE_0 = $$cache__("default", "f03128060c414d59f8552e4788b846c0d2b7f74743", 0, /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ async function(a, b, c) {
return <div> return <div>
{a} {a}
{b} {b}
......
/* __next_internal_action_entry_do_not_use__ {"601c36b06e398c97abe5d5d7ae8c672bfddf4e1b91":"$$RSC_SERVER_ACTION_2","609ed0cc47abc4e1c64320cf42b74ae60b58c40f00":"$$RSC_SERVER_ACTION_3","7090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"601c36b06e398c97abe5d5d7ae8c672bfddf4e1b91":"$$RSC_SERVER_ACTION_2","609ed0cc47abc4e1c64320cf42b74ae60b58c40f00":"$$RSC_SERVER_ACTION_3","7090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1"} */ import { registerServerReference } from "private-next-rsc-server-reference";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper";
export const $$RSC_SERVER_ACTION_1 = async function $$RSC_SERVER_ACTION_0(a, b, c) { export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_1 = async function $$RSC_SERVER_ACTION_0(a, b, c) {
return <div> return <div>
{a} {a}
{b} {b}
...@@ -13,14 +13,14 @@ Object.defineProperty($$RSC_SERVER_ACTION_0, "name", { ...@@ -13,14 +13,14 @@ Object.defineProperty($$RSC_SERVER_ACTION_0, "name", {
"value": "default", "value": "default",
"writable": false "writable": false
}); });
export const $$RSC_SERVER_ACTION_2 = async function foo(a, b) { export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_2 = async function foo(a, b) {
return <div> return <div>
{a} {a}
{b} {b}
</div>; </div>;
}; };
export var foo = registerServerReference($$RSC_SERVER_ACTION_2, "601c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", null); export var foo = registerServerReference($$RSC_SERVER_ACTION_2, "601c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", null);
export const $$RSC_SERVER_ACTION_3 = async function bar(a, b) { export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_3 = async function bar(a, b) {
return <div> return <div>
{a} {a}
{b} {b}
......
...@@ -8,7 +8,7 @@ Object.defineProperty($$RSC_SERVER_CACHE_0, "name", { ...@@ -8,7 +8,7 @@ Object.defineProperty($$RSC_SERVER_CACHE_0, "name", {
"value": "fn1", "value": "fn1",
"writable": false "writable": false
}); });
export var $$RSC_SERVER_CACHE_2 = $$cache__("default", "c069348c79fce073bae2f70f139565a2fda1c74c74", 2, async function // Should be 1 100000 0, which is "c0" in hex (counts as one param, export var $$RSC_SERVER_CACHE_2 = $$cache__("default", "c069348c79fce073bae2f70f139565a2fda1c74c74", 2, /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ async function // Should be 1 100000 0, which is "c0" in hex (counts as one param,
// because of the encrypted bound args param) // because of the encrypted bound args param)
fn2([$$ACTION_ARG_0, $$ACTION_ARG_1]) { fn2([$$ACTION_ARG_0, $$ACTION_ARG_1]) {
return $$ACTION_ARG_0 + $$ACTION_ARG_1; return $$ACTION_ARG_0 + $$ACTION_ARG_1;
...@@ -17,13 +17,13 @@ Object.defineProperty($$RSC_SERVER_CACHE_2, "name", { ...@@ -17,13 +17,13 @@ Object.defineProperty($$RSC_SERVER_CACHE_2, "name", {
"value": "fn2", "value": "fn2",
"writable": false "writable": false
}); });
export const $$RSC_SERVER_ACTION_4 = async function // Should be 0 110000 0, which is "60" in hex (counts as two params, export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_4 = async function // Should be 0 110000 0, which is "60" in hex (counts as two params,
// because of the encrypted bound args param) // because of the encrypted bound args param)
fn3($$ACTION_CLOSURE_BOUND, c) { fn3($$ACTION_CLOSURE_BOUND, c) {
var [$$ACTION_ARG_0, $$ACTION_ARG_1] = await decryptActionBoundArgs("60a9b2939c1f39073a6bed227fd20233064c8b7869", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0, $$ACTION_ARG_1] = await decryptActionBoundArgs("60a9b2939c1f39073a6bed227fd20233064c8b7869", $$ACTION_CLOSURE_BOUND);
return $$ACTION_ARG_0 + $$ACTION_ARG_1 + c; return $$ACTION_ARG_0 + $$ACTION_ARG_1 + c;
}; };
export const $$RSC_SERVER_ACTION_5 = async function // Should be 0 100000 0, which is "40" in hex (counts as one param, export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_5 = async function // Should be 0 100000 0, which is "40" in hex (counts as one param,
// because of the encrypted bound args param) // because of the encrypted bound args param)
fn4($$ACTION_CLOSURE_BOUND) { fn4($$ACTION_CLOSURE_BOUND) {
var [$$ACTION_ARG_0, $$ACTION_ARG_1] = await decryptActionBoundArgs("409651a98a9dccd7ffbe72ff5cf0f38546ca1252ab", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0, $$ACTION_ARG_1] = await decryptActionBoundArgs("409651a98a9dccd7ffbe72ff5cf0f38546ca1252ab", $$ACTION_CLOSURE_BOUND);
...@@ -47,5 +47,5 @@ export async function Component(a) { ...@@ -47,5 +47,5 @@ export async function Component(a) {
b b
]))}/>; ]))}/>;
} }
var $$RSC_SERVER_REF_1 = registerServerReference($$RSC_SERVER_CACHE_0, "e03128060c414d59f8552e4788b846c0d2b7f74743", null); var $$RSC_SERVER_REF_1 = /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ registerServerReference($$RSC_SERVER_CACHE_0, "e03128060c414d59f8552e4788b846c0d2b7f74743", null);
var $$RSC_SERVER_REF_3 = registerServerReference($$RSC_SERVER_CACHE_2, "c069348c79fce073bae2f70f139565a2fda1c74c74", null); var $$RSC_SERVER_REF_3 = registerServerReference($$RSC_SERVER_CACHE_2, "c069348c79fce073bae2f70f139565a2fda1c74c74", null);
/* __next_internal_action_entry_do_not_use__ {"0090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1","803128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"0090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1","803128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper";
export var $$RSC_SERVER_CACHE_0 = $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, async function foo() {}); export var $$RSC_SERVER_CACHE_0 = $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ async function foo() {});
Object.defineProperty($$RSC_SERVER_CACHE_0, "name", { Object.defineProperty($$RSC_SERVER_CACHE_0, "name", {
"value": "foo", "value": "foo",
"writable": false "writable": false
}); });
export const $$RSC_SERVER_ACTION_1 = async function bar() {}; export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_1 = async function bar() {};
export const obj = { export const obj = {
foo: registerServerReference($$RSC_SERVER_CACHE_0, "803128060c414d59f8552e4788b846c0d2b7f74743", null), foo: registerServerReference($$RSC_SERVER_CACHE_0, "803128060c414d59f8552e4788b846c0d2b7f74743", null),
bar: registerServerReference($$RSC_SERVER_ACTION_1, "0090b5db271335765a4b0eab01f044b381b5ebd5cd", null) bar: registerServerReference($$RSC_SERVER_ACTION_1, "0090b5db271335765a4b0eab01f044b381b5ebd5cd", null)
......
/* __next_internal_action_entry_do_not_use__ {"401c36b06e398c97abe5d5d7ae8c672bfddf4e1b91":"$$RSC_SERVER_ACTION_2","c03128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"401c36b06e398c97abe5d5d7ae8c672bfddf4e1b91":"$$RSC_SERVER_ACTION_2","c03128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper";
export var $$RSC_SERVER_CACHE_0 = $$cache__("default", "c03128060c414d59f8552e4788b846c0d2b7f74743", 2, async function foo([$$ACTION_ARG_0, $$ACTION_ARG_1]) { export var $$RSC_SERVER_CACHE_0 = $$cache__("default", "c03128060c414d59f8552e4788b846c0d2b7f74743", 2, /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ async function foo([$$ACTION_ARG_0, $$ACTION_ARG_1]) {
return $$ACTION_ARG_0 * $$ACTION_ARG_1; return $$ACTION_ARG_0 * $$ACTION_ARG_1;
}); });
Object.defineProperty($$RSC_SERVER_CACHE_0, "name", { Object.defineProperty($$RSC_SERVER_CACHE_0, "name", {
"value": "foo", "value": "foo",
"writable": false "writable": false
}); });
export const $$RSC_SERVER_ACTION_2 = async function bar($$ACTION_CLOSURE_BOUND) { export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_2 = async function bar($$ACTION_CLOSURE_BOUND) {
var [$$ACTION_ARG_0] = await decryptActionBoundArgs("401c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0] = await decryptActionBoundArgs("401c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", $$ACTION_CLOSURE_BOUND);
console.log($$ACTION_ARG_0); console.log($$ACTION_ARG_0);
}; };
......
/* __next_internal_action_entry_do_not_use__ {"803128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"803128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper";
export var $$RSC_SERVER_CACHE_0 = $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, async function fetch1() { export var $$RSC_SERVER_CACHE_0 = $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ async function fetch1() {
return fetch('https://example.com').then((res)=>res.json()); return fetch('https://example.com').then((res)=>res.json());
}); });
Object.defineProperty($$RSC_SERVER_CACHE_0, "name", { Object.defineProperty($$RSC_SERVER_CACHE_0, "name", {
......
...@@ -12,7 +12,7 @@ function x() { ...@@ -12,7 +12,7 @@ function x() {
const f2 = 1; const f2 = 1;
const g201 = 1; const g201 = 1;
} }
export const $$RSC_SERVER_ACTION_0 = async function action($$ACTION_CLOSURE_BOUND) { export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_0 = async function action($$ACTION_CLOSURE_BOUND) {
var [$$ACTION_ARG_0, $$ACTION_ARG_1, $$ACTION_ARG_2, $$ACTION_ARG_3, $$ACTION_ARG_4, $$ACTION_ARG_5] = await decryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0, $$ACTION_ARG_1, $$ACTION_ARG_2, $$ACTION_ARG_3, $$ACTION_ARG_4, $$ACTION_ARG_5] = await decryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND);
const f17 = 1; const f17 = 1;
if (true) { if (true) {
......
/* __next_internal_action_entry_do_not_use__ {"401c36b06e398c97abe5d5d7ae8c672bfddf4e1b91":"$$RSC_SERVER_ACTION_2","406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0","4090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1","409ed0cc47abc4e1c64320cf42b74ae60b58c40f00":"$$RSC_SERVER_ACTION_3"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"401c36b06e398c97abe5d5d7ae8c672bfddf4e1b91":"$$RSC_SERVER_ACTION_2","406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0","4090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1","409ed0cc47abc4e1c64320cf42b74ae60b58c40f00":"$$RSC_SERVER_ACTION_3"} */ import { registerServerReference } from "private-next-rsc-server-reference";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
import deleteFromDb from 'db'; import deleteFromDb from 'db';
export const $$RSC_SERVER_ACTION_0 = async function deleteItem1($$ACTION_CLOSURE_BOUND) { export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_0 = async function deleteItem1($$ACTION_CLOSURE_BOUND) {
var [$$ACTION_ARG_0, $$ACTION_ARG_1, $$ACTION_ARG_2] = await decryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0, $$ACTION_ARG_1, $$ACTION_ARG_2] = await decryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND);
await deleteFromDb($$ACTION_ARG_0.id, $$ACTION_ARG_0?.foo, $$ACTION_ARG_0.bar.baz, $$ACTION_ARG_0[$$ACTION_ARG_1, $$ACTION_ARG_2]); await deleteFromDb($$ACTION_ARG_0.id, $$ACTION_ARG_0?.foo, $$ACTION_ARG_0.bar.baz, $$ACTION_ARG_0[$$ACTION_ARG_1, $$ACTION_ARG_2]);
}; };
...@@ -13,7 +13,7 @@ export function Item1(product, foo, bar) { ...@@ -13,7 +13,7 @@ export function Item1(product, foo, bar) {
])); ]));
return <Button action={a}>Delete</Button>; return <Button action={a}>Delete</Button>;
} }
export const $$RSC_SERVER_ACTION_1 = async function deleteItem2($$ACTION_CLOSURE_BOUND) { export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_1 = async function deleteItem2($$ACTION_CLOSURE_BOUND) {
var [$$ACTION_ARG_0, $$ACTION_ARG_1, $$ACTION_ARG_2] = await decryptActionBoundArgs("4090b5db271335765a4b0eab01f044b381b5ebd5cd", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0, $$ACTION_ARG_1, $$ACTION_ARG_2] = await decryptActionBoundArgs("4090b5db271335765a4b0eab01f044b381b5ebd5cd", $$ACTION_CLOSURE_BOUND);
await deleteFromDb($$ACTION_ARG_0.id, $$ACTION_ARG_0?.foo, $$ACTION_ARG_0.bar.baz, $$ACTION_ARG_0[$$ACTION_ARG_1, $$ACTION_ARG_2]); await deleteFromDb($$ACTION_ARG_0.id, $$ACTION_ARG_0?.foo, $$ACTION_ARG_0.bar.baz, $$ACTION_ARG_0[$$ACTION_ARG_1, $$ACTION_ARG_2]);
}; };
...@@ -25,7 +25,7 @@ export function Item2(product, foo, bar) { ...@@ -25,7 +25,7 @@ export function Item2(product, foo, bar) {
])); ]));
return <Button action={deleteItem2}>Delete</Button>; return <Button action={deleteItem2}>Delete</Button>;
} }
export const $$RSC_SERVER_ACTION_2 = async function deleteItem3($$ACTION_CLOSURE_BOUND) { export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_2 = async function deleteItem3($$ACTION_CLOSURE_BOUND) {
var [$$ACTION_ARG_0, $$ACTION_ARG_1, $$ACTION_ARG_2] = await decryptActionBoundArgs("401c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0, $$ACTION_ARG_1, $$ACTION_ARG_2] = await decryptActionBoundArgs("401c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", $$ACTION_CLOSURE_BOUND);
await deleteFromDb($$ACTION_ARG_0.id, $$ACTION_ARG_0?.foo, $$ACTION_ARG_0.bar.baz, $$ACTION_ARG_0[$$ACTION_ARG_1, $$ACTION_ARG_2]); await deleteFromDb($$ACTION_ARG_0.id, $$ACTION_ARG_0?.foo, $$ACTION_ARG_0.bar.baz, $$ACTION_ARG_0[$$ACTION_ARG_1, $$ACTION_ARG_2]);
}; };
...@@ -37,7 +37,7 @@ export function Item3(product, foo, bar) { ...@@ -37,7 +37,7 @@ export function Item3(product, foo, bar) {
])); ]));
return <Button action={deleteItem3}>Delete</Button>; return <Button action={deleteItem3}>Delete</Button>;
} }
export const $$RSC_SERVER_ACTION_3 = async function deleteItem4($$ACTION_CLOSURE_BOUND) { export const /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ $$RSC_SERVER_ACTION_3 = async function deleteItem4($$ACTION_CLOSURE_BOUND) {
var [$$ACTION_ARG_0, $$ACTION_ARG_1, $$ACTION_ARG_2] = await decryptActionBoundArgs("409ed0cc47abc4e1c64320cf42b74ae60b58c40f00", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0, $$ACTION_ARG_1, $$ACTION_ARG_2] = await decryptActionBoundArgs("409ed0cc47abc4e1c64320cf42b74ae60b58c40f00", $$ACTION_CLOSURE_BOUND);
await deleteFromDb($$ACTION_ARG_0.id, $$ACTION_ARG_0?.foo, $$ACTION_ARG_0.bar.baz, $$ACTION_ARG_0[$$ACTION_ARG_1, $$ACTION_ARG_2]); await deleteFromDb($$ACTION_ARG_0.id, $$ACTION_ARG_0?.foo, $$ACTION_ARG_0.bar.baz, $$ACTION_ARG_0[$$ACTION_ARG_1, $$ACTION_ARG_2]);
}; };
......
/* __next_internal_action_entry_do_not_use__ {"706a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ /* __next_internal_action_entry_do_not_use__ {"706a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0"} */ import { registerServerReference } from "private-next-rsc-server-reference";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
export const $$RSC_SERVER_ACTION_0 = async function myAction(a, b, c) { export const $$RSC_SERVER_ACTION_0 = async function myAction(a, b, c) {
// comment // comment
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
/* __next_internal_action_entry_do_not_use__ {"7f050e3854b72b19e3c7e3966a67535543a90bf7e0":"baz","7fab21efdafbe611287bc25c0462b1e0510d13e48b":"foo","7fc18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"7f050e3854b72b19e3c7e3966a67535543a90bf7e0":"baz","7fab21efdafbe611287bc25c0462b1e0510d13e48b":"foo","7fc18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default"} */ import { registerServerReference } from "private-next-rsc-server-reference";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
async function foo() {} async function foo() {}
export { foo }; export { /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ foo };
async function bar() {} async function bar() {}
export { bar as baz }; export { /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ bar as baz };
async function qux() {} async function qux() {}
export { qux as default }; export { /*#__TURBOPACK_DISABLE_EXPORT_MERGING__*/ qux as default };
import { ensureServerEntryExports } from "private-next-rsc-action-validate"; import { ensureServerEntryExports } from "private-next-rsc-action-validate";
ensureServerEntryExports([ ensureServerEntryExports([
foo, foo,
......
...@@ -86,15 +86,34 @@ impl EcmascriptModulePartAsset { ...@@ -86,15 +86,34 @@ impl EcmascriptModulePartAsset {
/// of a pointer to the full module and the [ModulePart] pointing the part /// of a pointer to the full module and the [ModulePart] pointing the part
/// of the module. /// of the module.
#[turbo_tasks::function] #[turbo_tasks::function]
pub fn new( pub async fn new(
module: ResolvedVc<EcmascriptModuleAsset>, module: ResolvedVc<EcmascriptModuleAsset>,
part: ResolvedVc<ModulePart>, part: ResolvedVc<ModulePart>,
) -> Vc<Self> { ) -> Result<Vc<Self>> {
EcmascriptModulePartAsset { if matches!(
&*part.await?,
ModulePart::Internal(..)
| ModulePart::InternalEvaluation(..)
| ModulePart::Facade
| ModulePart::Exports
| ModulePart::Evaluation
) {
return Ok(EcmascriptModulePartAsset {
full_module: module, full_module: module,
part, part,
} }
.cell() .cell());
}
// This is a workaround to avoid creating duplicate assets for internal parts.
let split_result = split_module(*module).await?;
let part_id = get_part_id(&split_result, *part).await?;
Ok(EcmascriptModulePartAsset {
full_module: module,
part: ModulePart::internal(part_id).to_resolved().await?,
}
.cell())
} }
#[turbo_tasks::function] #[turbo_tasks::function]
......
...@@ -34,11 +34,12 @@ use super::{ ...@@ -34,11 +34,12 @@ use super::{
}; };
use crate::{magic_identifier, tree_shake::optimizations::GraphOptimizer}; use crate::{magic_identifier, tree_shake::optimizations::GraphOptimizer};
const FLAG_DISABLE_EXPORT_MERGING: &str = "TURBOPACK_DISABLE_EXPORT_MERGING";
/// The id of an item /// The id of an item
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] #[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub(crate) enum ItemId { pub(crate) enum ItemId {
Group(ItemIdGroupKind),
Item { index: usize, kind: ItemIdItemKind }, Item { index: usize, kind: ItemIdItemKind },
Group(ItemIdGroupKind),
} }
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
...@@ -126,6 +127,9 @@ pub(crate) struct ItemData { ...@@ -126,6 +127,9 @@ pub(crate) struct ItemData {
/// See https://github.com/vercel/next.js/pull/71234#issuecomment-2409810084 for the problematic /// See https://github.com/vercel/next.js/pull/71234#issuecomment-2409810084 for the problematic
/// test case. /// test case.
pub explicit_deps: Vec<ItemId>, pub explicit_deps: Vec<ItemId>,
/// Server actions breaks when we merge exports.
pub disable_export_merging: bool,
} }
impl fmt::Debug for ItemData { impl fmt::Debug for ItemData {
...@@ -160,6 +164,7 @@ impl Default for ItemData { ...@@ -160,6 +164,7 @@ impl Default for ItemData {
export: Default::default(), export: Default::default(),
binding_source: Default::default(), binding_source: Default::default(),
explicit_deps: Default::default(), explicit_deps: Default::default(),
disable_export_merging: Default::default(),
} }
} }
} }
...@@ -706,6 +711,7 @@ impl DepGraph { ...@@ -706,6 +711,7 @@ impl DepGraph {
let optimizer = GraphOptimizer { let optimizer = GraphOptimizer {
graph_ix: &self.g.graph_ix, graph_ix: &self.g.graph_ix,
data,
}; };
loop { loop {
if !optimizer.merge_single_incoming_nodes(&mut condensed) { if !optimizer.merge_single_incoming_nodes(&mut condensed) {
...@@ -794,13 +800,23 @@ impl DepGraph { ...@@ -794,13 +800,23 @@ impl DepGraph {
match item { match item {
ModuleDecl::ExportDecl(item) => match &item.decl { ModuleDecl::ExportDecl(item) => match &item.decl {
Decl::Fn(FnDecl { ident, .. }) | Decl::Class(ClassDecl { ident, .. }) => { Decl::Fn(FnDecl { ident, .. }) | Decl::Class(ClassDecl { ident, .. }) => {
exports.push((ident.to_id(), ident.sym.clone())); exports.push((
ident.to_id(),
ident.sym.clone(),
comments.has_flag(ident.span().lo, FLAG_DISABLE_EXPORT_MERGING),
));
} }
Decl::Var(v) => { Decl::Var(v) => {
for decl in &v.decls { for decl in &v.decls {
let disable_export_merging = comments
.has_flag(decl.name.span().lo, FLAG_DISABLE_EXPORT_MERGING)
|| decl.init.as_deref().map_or(false, |e| {
comments.has_flag(e.span().lo, FLAG_DISABLE_EXPORT_MERGING)
});
let ids: Vec<Id> = find_pat_ids(&decl.name); let ids: Vec<Id> = find_pat_ids(&decl.name);
for id in ids { for id in ids {
exports.push((id.clone(), id.0)); exports.push((id.clone(), id.0, disable_export_merging));
} }
} }
} }
...@@ -871,7 +887,7 @@ impl DepGraph { ...@@ -871,7 +887,7 @@ impl DepGraph {
local = local.into_private(); local = local.into_private();
} }
exports.push((local.to_id(), exported.atom().clone())); exports.push((local.to_id(), exported.atom().clone(), false));
if let Some(src) = &item.src { if let Some(src) = &item.src {
let id = ItemId::Item { let id = ItemId::Item {
...@@ -988,7 +1004,7 @@ impl DepGraph { ...@@ -988,7 +1004,7 @@ impl DepGraph {
items.insert(id, data); items.insert(id, data);
} }
exports.push((default_var.to_id(), "default".into())); exports.push((default_var.to_id(), "default".into(), false));
} }
ModuleDecl::ExportDefaultExpr(export) => { ModuleDecl::ExportDefaultExpr(export) => {
let default_var = let default_var =
...@@ -1047,7 +1063,7 @@ impl DepGraph { ...@@ -1047,7 +1063,7 @@ impl DepGraph {
{ {
// For export default __TURBOPACK__default__export__ // For export default __TURBOPACK__default__export__
exports.push((default_var.to_id(), "default".into())); exports.push((default_var.to_id(), "default".into(), false));
} }
} }
...@@ -1243,6 +1259,7 @@ impl DepGraph { ...@@ -1243,6 +1259,7 @@ impl DepGraph {
}); });
vars.write.extend(decl_ids.iter().cloned()); vars.write.extend(decl_ids.iter().cloned());
let content = ModuleItem::Stmt(Stmt::Decl(Decl::Var(var_decl))); let content = ModuleItem::Stmt(Stmt::Decl(Decl::Var(var_decl)));
items.insert( items.insert(
id, id,
ItemData { ItemData {
...@@ -1365,7 +1382,7 @@ impl DepGraph { ...@@ -1365,7 +1382,7 @@ impl DepGraph {
); );
} }
for (local, export_name) in exports { for (local, export_name, disable_export_merging) in exports {
let id = ItemId::Group(ItemIdGroupKind::Export(local.clone(), export_name.clone())); let id = ItemId::Group(ItemIdGroupKind::Export(local.clone(), export_name.clone()));
ids.push(id.clone()); ids.push(id.clone());
items.insert( items.insert(
...@@ -1389,6 +1406,7 @@ impl DepGraph { ...@@ -1389,6 +1406,7 @@ impl DepGraph {
})), })),
read_vars: [local.clone()].into_iter().collect(), read_vars: [local.clone()].into_iter().collect(),
export: Some(export_name), export: Some(export_name),
disable_export_merging,
..Default::default() ..Default::default()
}, },
); );
......
use std::ops::Index; use std::ops::Index;
use petgraph::{visit::EdgeRef, Direction, Graph}; use petgraph::{visit::EdgeRef, Direction, Graph};
use rustc_hash::FxHashMap;
use turbo_tasks::FxIndexSet; use turbo_tasks::FxIndexSet;
use crate::tree_shake::graph::{Dependency, ItemId, ItemIdGroupKind, ItemIdItemKind}; use crate::tree_shake::graph::{Dependency, ItemData, ItemId, ItemIdGroupKind, ItemIdItemKind};
pub(super) struct GraphOptimizer<'a> { pub(super) struct GraphOptimizer<'a> {
pub graph_ix: &'a FxIndexSet<ItemId>, pub graph_ix: &'a FxIndexSet<ItemId>,
pub data: &'a FxHashMap<ItemId, ItemData>,
} }
impl Index<u32> for GraphOptimizer<'_> { impl Index<u32> for GraphOptimizer<'_> {
...@@ -25,19 +27,20 @@ impl GraphOptimizer<'_> { ...@@ -25,19 +27,20 @@ impl GraphOptimizer<'_> {
{ {
let item_id = &self[*item]; let item_id = &self[*item];
// Currently we don't merge import bindings or exports because of workarounds we are using. // Currently we don't merge import bindings because of workarounds we are using.
// //
// See graph.rs for actual workarounds. ImportBinding workaround is about using direct // See graph.rs for actual workarounds. ImportBinding workaround is about using direct
// imports for import bindings so the static code analysis pass can detect imports like // imports for import bindings so the static code analysis pass can detect imports like
// 'next/dynamic', and the export workaround is about adding an import for $$RSC_SERVER for // 'next/dynamic'.
// server actions.
matches!( (matches!(
item_id, item_id,
ItemId::Item { ItemId::Item {
kind: ItemIdItemKind::ImportBinding(..), kind: ItemIdItemKind::ImportBinding(..),
.. ..
} | ItemId::Group(ItemIdGroupKind::Export(..)) }
) )) || (matches!(item_id, ItemId::Group(ItemIdGroupKind::Export(..)))
&& self.data[item_id].disable_export_merging)
} }
fn should_not_merge_iter<N>(&self, items: &[N]) -> bool fn should_not_merge_iter<N>(&self, items: &[N]) -> bool
......
...@@ -81,7 +81,7 @@ graph TD ...@@ -81,7 +81,7 @@ graph TD
# Final # Final
```mermaid ```mermaid
graph TD graph TD
N0["Items: [ItemId(ModuleEvaluation), ItemId(0, Normal), ItemId(1, Normal), ItemId(2, Normal)]"]; N0["Items: [ItemId(0, Normal), ItemId(1, Normal), ItemId(2, Normal), ItemId(ModuleEvaluation)]"];
``` ```
# Entrypoints # Entrypoints
...@@ -96,10 +96,10 @@ graph TD ...@@ -96,10 +96,10 @@ graph TD
# Modules (dev) # Modules (dev)
## Part 0 ## Part 0
```js ```js
"module evaluation";
a = ()=>{}; a = ()=>{};
function a() {} function a() {}
console.log(a); console.log(a);
"module evaluation";
export { a as a } from "__TURBOPACK_VAR__" assert { export { a as a } from "__TURBOPACK_VAR__" assert {
__turbopack_var__: true __turbopack_var__: true
}; };
...@@ -111,10 +111,10 @@ export { a as a } from "__TURBOPACK_VAR__" assert { ...@@ -111,10 +111,10 @@ export { a as a } from "__TURBOPACK_VAR__" assert {
``` ```
## Merged (module eval) ## Merged (module eval)
```js ```js
"module evaluation";
a = ()=>{}; a = ()=>{};
function a() {} function a() {}
console.log(a); console.log(a);
"module evaluation";
export { a as a } from "__TURBOPACK_VAR__" assert { export { a as a } from "__TURBOPACK_VAR__" assert {
__turbopack_var__: true __turbopack_var__: true
}; };
...@@ -133,10 +133,10 @@ export { a as a } from "__TURBOPACK_VAR__" assert { ...@@ -133,10 +133,10 @@ export { a as a } from "__TURBOPACK_VAR__" assert {
# Modules (prod) # Modules (prod)
## Part 0 ## Part 0
```js ```js
"module evaluation";
a = ()=>{}; a = ()=>{};
function a() {} function a() {}
console.log(a); console.log(a);
"module evaluation";
export { a as a } from "__TURBOPACK_VAR__" assert { export { a as a } from "__TURBOPACK_VAR__" assert {
__turbopack_var__: true __turbopack_var__: true
}; };
...@@ -148,10 +148,10 @@ export { a as a } from "__TURBOPACK_VAR__" assert { ...@@ -148,10 +148,10 @@ export { a as a } from "__TURBOPACK_VAR__" assert {
``` ```
## Merged (module eval) ## Merged (module eval)
```js ```js
"module evaluation";
a = ()=>{}; a = ()=>{};
function a() {} function a() {}
console.log(a); console.log(a);
"module evaluation";
export { a as a } from "__TURBOPACK_VAR__" assert { export { a as a } from "__TURBOPACK_VAR__" assert {
__turbopack_var__: true __turbopack_var__: true
}; };
......
...@@ -77,17 +77,17 @@ graph TD ...@@ -77,17 +77,17 @@ graph TD
# Final # Final
```mermaid ```mermaid
graph TD graph TD
N0["Items: [ItemId(ModuleEvaluation), ItemId(2, Normal)]"]; N0["Items: [ItemId(0, Normal)]"];
N1["Items: [ItemId(0, Normal)]"]; N1["Items: [ItemId(1, VarDeclarator(0))]"];
N2["Items: [ItemId(1, VarDeclarator(0))]"]; N2["Items: [ItemId(2, Normal), ItemId(ModuleEvaluation)]"];
N1 --> N2; N0 --> N1;
N0 --> N2; N2 --> N1;
``` ```
# Entrypoints # Entrypoints
``` ```
{ {
ModuleEvaluation: 0, ModuleEvaluation: 2,
Exports: 3, Exports: 3,
} }
``` ```
...@@ -97,26 +97,26 @@ graph TD ...@@ -97,26 +97,26 @@ graph TD
## Part 0 ## Part 0
```js ```js
import { a as a } from "__TURBOPACK_PART__" assert { import { a as a } from "__TURBOPACK_PART__" assert {
__turbopack_part__: -2 __turbopack_part__: -1
}; };
"module evaluation"; a = 1;
console.log(a);
``` ```
## Part 1 ## Part 1
```js ```js
import { a as a } from "__TURBOPACK_PART__" assert { var a;
__turbopack_part__: -2 export { a as a } from "__TURBOPACK_VAR__" assert {
__turbopack_var__: true
}; };
a = 1;
``` ```
## Part 2 ## Part 2
```js ```js
var a; import { a as a } from "__TURBOPACK_PART__" assert {
export { a as a } from "__TURBOPACK_VAR__" assert { __turbopack_part__: -1
__turbopack_var__: true
}; };
console.log(a);
"module evaluation";
``` ```
## Part 3 ## Part 3
...@@ -126,17 +126,17 @@ export { a as a } from "__TURBOPACK_VAR__" assert { ...@@ -126,17 +126,17 @@ export { a as a } from "__TURBOPACK_VAR__" assert {
## Merged (module eval) ## Merged (module eval)
```js ```js
import { a as a } from "__TURBOPACK_PART__" assert { import { a as a } from "__TURBOPACK_PART__" assert {
__turbopack_part__: -2 __turbopack_part__: -1
}; };
"module evaluation";
console.log(a); console.log(a);
"module evaluation";
``` ```
# Entrypoints # Entrypoints
``` ```
{ {
ModuleEvaluation: 0, ModuleEvaluation: 2,
Exports: 3, Exports: 3,
} }
``` ```
...@@ -146,26 +146,26 @@ console.log(a); ...@@ -146,26 +146,26 @@ console.log(a);
## Part 0 ## Part 0
```js ```js
import { a as a } from "__TURBOPACK_PART__" assert { import { a as a } from "__TURBOPACK_PART__" assert {
__turbopack_part__: -2 __turbopack_part__: -1
}; };
"module evaluation"; a = 1;
console.log(a);
``` ```
## Part 1 ## Part 1
```js ```js
import { a as a } from "__TURBOPACK_PART__" assert { var a;
__turbopack_part__: -2 export { a as a } from "__TURBOPACK_VAR__" assert {
__turbopack_var__: true
}; };
a = 1;
``` ```
## Part 2 ## Part 2
```js ```js
var a; import { a as a } from "__TURBOPACK_PART__" assert {
export { a as a } from "__TURBOPACK_VAR__" assert { __turbopack_part__: -1
__turbopack_var__: true
}; };
console.log(a);
"module evaluation";
``` ```
## Part 3 ## Part 3
...@@ -175,9 +175,9 @@ export { a as a } from "__TURBOPACK_VAR__" assert { ...@@ -175,9 +175,9 @@ export { a as a } from "__TURBOPACK_VAR__" assert {
## Merged (module eval) ## Merged (module eval)
```js ```js
import { a as a } from "__TURBOPACK_PART__" assert { import { a as a } from "__TURBOPACK_PART__" assert {
__turbopack_part__: -2 __turbopack_part__: -1
}; };
"module evaluation";
console.log(a); console.log(a);
"module evaluation";
``` ```
...@@ -79,20 +79,16 @@ graph TD ...@@ -79,20 +79,16 @@ graph TD
# Final # Final
```mermaid ```mermaid
graph TD graph TD
N0["Items: [ItemId(Export((&quot;a&quot;, #2), &quot;a&quot;))]"]; N0["Items: [ItemId(0, VarDeclarator(0)), ItemId(Export((&quot;a&quot;, #2), &quot;a&quot;))]"];
N1["Items: [ItemId(Export((&quot;b&quot;, #2), &quot;b&quot;))]"]; N1["Items: [ItemId(1, VarDeclarator(0)), ItemId(Export((&quot;b&quot;, #2), &quot;b&quot;))]"];
N2["Items: [ItemId(0, VarDeclarator(0))]"]; N2["Items: [ItemId(ModuleEvaluation)]"];
N3["Items: [ItemId(1, VarDeclarator(0))]"];
N4["Items: [ItemId(ModuleEvaluation)]"];
N0 --> N2;
N1 --> N3;
``` ```
# Entrypoints # Entrypoints
``` ```
{ {
ModuleEvaluation: 4, ModuleEvaluation: 2,
Exports: 5, Exports: 3,
Export( Export(
"b", "b",
): 1, ): 1,
...@@ -106,42 +102,28 @@ graph TD ...@@ -106,42 +102,28 @@ graph TD
# Modules (dev) # Modules (dev)
## Part 0 ## Part 0
```js ```js
import { a as a } from "__TURBOPACK_PART__" assert {
__turbopack_part__: -2
};
export { a };
```
## Part 1
```js
import { b as b } from "__TURBOPACK_PART__" assert {
__turbopack_part__: -3
};
export { b };
```
## Part 2
```js
const a = "a"; const a = "a";
export { a };
export { a as a } from "__TURBOPACK_VAR__" assert { export { a as a } from "__TURBOPACK_VAR__" assert {
__turbopack_var__: true __turbopack_var__: true
}; };
``` ```
## Part 3 ## Part 1
```js ```js
const b = "b"; const b = "b";
export { b };
export { b as b } from "__TURBOPACK_VAR__" assert { export { b as b } from "__TURBOPACK_VAR__" assert {
__turbopack_var__: true __turbopack_var__: true
}; };
``` ```
## Part 4 ## Part 2
```js ```js
"module evaluation"; "module evaluation";
``` ```
## Part 5 ## Part 3
```js ```js
export { a } from "__TURBOPACK_PART__" assert { export { a } from "__TURBOPACK_PART__" assert {
__turbopack_part__: "export a" __turbopack_part__: "export a"
...@@ -160,8 +142,8 @@ export { b } from "__TURBOPACK_PART__" assert { ...@@ -160,8 +142,8 @@ export { b } from "__TURBOPACK_PART__" assert {
``` ```
{ {
ModuleEvaluation: 4, ModuleEvaluation: 2,
Exports: 5, Exports: 3,
Export( Export(
"b", "b",
): 1, ): 1,
...@@ -175,42 +157,28 @@ export { b } from "__TURBOPACK_PART__" assert { ...@@ -175,42 +157,28 @@ export { b } from "__TURBOPACK_PART__" assert {
# Modules (prod) # Modules (prod)
## Part 0 ## Part 0
```js ```js
import { a as a } from "__TURBOPACK_PART__" assert {
__turbopack_part__: -2
};
export { a };
```
## Part 1
```js
import { b as b } from "__TURBOPACK_PART__" assert {
__turbopack_part__: -3
};
export { b };
```
## Part 2
```js
const a = "a"; const a = "a";
export { a };
export { a as a } from "__TURBOPACK_VAR__" assert { export { a as a } from "__TURBOPACK_VAR__" assert {
__turbopack_var__: true __turbopack_var__: true
}; };
``` ```
## Part 3 ## Part 1
```js ```js
const b = "b"; const b = "b";
export { b };
export { b as b } from "__TURBOPACK_VAR__" assert { export { b as b } from "__TURBOPACK_VAR__" assert {
__turbopack_var__: true __turbopack_var__: true
}; };
``` ```
## Part 4 ## Part 2
```js ```js
"module evaluation"; "module evaluation";
``` ```
## Part 5 ## Part 3
```js ```js
export { a } from "__TURBOPACK_PART__" assert { export { a } from "__TURBOPACK_PART__" assert {
__turbopack_part__: "export a" __turbopack_part__: "export a"
......
...@@ -80,18 +80,18 @@ graph TD ...@@ -80,18 +80,18 @@ graph TD
# Final # Final
```mermaid ```mermaid
graph TD graph TD
N0["Items: [ItemId(ModuleEvaluation), ItemId(1, Normal)]"]; N0["Items: [ItemId(0, ImportOfModule)]"];
N1["Items: [ItemId(0, ImportOfModule)]"]; N1["Items: [ItemId(0, ImportBinding(0))]"];
N2["Items: [ItemId(0, ImportBinding(0))]"]; N2["Items: [ItemId(1, Normal), ItemId(ModuleEvaluation)]"];
N0 --> N1; N2 --> N0;
N0 --> N2;
N2 --> N1; N2 --> N1;
N1 --> N0;
``` ```
# Entrypoints # Entrypoints
``` ```
{ {
ModuleEvaluation: 0, ModuleEvaluation: 2,
Exports: 3, Exports: 3,
} }
``` ```
...@@ -100,33 +100,33 @@ graph TD ...@@ -100,33 +100,33 @@ graph TD
# Modules (dev) # Modules (dev)
## Part 0 ## Part 0
```js ```js
import "__TURBOPACK_PART__" assert { import './module';
__turbopack_part__: 1
};
import { baz } from './module';
import "__TURBOPACK_PART__" assert {
__turbopack_part__: 1
};
"module evaluation";
if (1 + 1 == 3) {
baz();
}
``` ```
## Part 1 ## Part 1
```js ```js
import './module'; import "__TURBOPACK_PART__" assert {
__turbopack_part__: 0
};
import { baz } from './module';
export { baz as a } from "__TURBOPACK_VAR__" assert {
__turbopack_var__: true
};
``` ```
## Part 2 ## Part 2
```js ```js
import "__TURBOPACK_PART__" assert { import "__TURBOPACK_PART__" assert {
__turbopack_part__: 1 __turbopack_part__: 0
}; };
import { baz } from './module'; import { baz } from './module';
export { baz as a } from "__TURBOPACK_VAR__" assert { import "__TURBOPACK_PART__" assert {
__turbopack_var__: true __turbopack_part__: 0
}; };
if (1 + 1 == 3) {
baz();
}
"module evaluation";
``` ```
## Part 3 ## Part 3
...@@ -136,20 +136,20 @@ export { baz as a } from "__TURBOPACK_VAR__" assert { ...@@ -136,20 +136,20 @@ export { baz as a } from "__TURBOPACK_VAR__" assert {
## Merged (module eval) ## Merged (module eval)
```js ```js
import "__TURBOPACK_PART__" assert { import "__TURBOPACK_PART__" assert {
__turbopack_part__: 1 __turbopack_part__: 0
}; };
import { baz } from './module'; import { baz } from './module';
"module evaluation";
if (1 + 1 == 3) { if (1 + 1 == 3) {
baz(); baz();
} }
"module evaluation";
``` ```
# Entrypoints # Entrypoints
``` ```
{ {
ModuleEvaluation: 0, ModuleEvaluation: 2,
Exports: 3, Exports: 3,
} }
``` ```
...@@ -158,33 +158,33 @@ if (1 + 1 == 3) { ...@@ -158,33 +158,33 @@ if (1 + 1 == 3) {
# Modules (prod) # Modules (prod)
## Part 0 ## Part 0
```js ```js
import "__TURBOPACK_PART__" assert { import './module';
__turbopack_part__: 1
};
import { baz } from './module';
import "__TURBOPACK_PART__" assert {
__turbopack_part__: 1
};
"module evaluation";
if (1 + 1 == 3) {
baz();
}
``` ```
## Part 1 ## Part 1
```js ```js
import './module'; import "__TURBOPACK_PART__" assert {
__turbopack_part__: 0
};
import { baz } from './module';
export { baz as a } from "__TURBOPACK_VAR__" assert {
__turbopack_var__: true
};
``` ```
## Part 2 ## Part 2
```js ```js
import "__TURBOPACK_PART__" assert { import "__TURBOPACK_PART__" assert {
__turbopack_part__: 1 __turbopack_part__: 0
}; };
import { baz } from './module'; import { baz } from './module';
export { baz as a } from "__TURBOPACK_VAR__" assert { import "__TURBOPACK_PART__" assert {
__turbopack_var__: true __turbopack_part__: 0
}; };
if (1 + 1 == 3) {
baz();
}
"module evaluation";
``` ```
## Part 3 ## Part 3
...@@ -194,12 +194,12 @@ export { baz as a } from "__TURBOPACK_VAR__" assert { ...@@ -194,12 +194,12 @@ export { baz as a } from "__TURBOPACK_VAR__" assert {
## Merged (module eval) ## Merged (module eval)
```js ```js
import "__TURBOPACK_PART__" assert { import "__TURBOPACK_PART__" assert {
__turbopack_part__: 1 __turbopack_part__: 0
}; };
import { baz } from './module'; import { baz } from './module';
"module evaluation";
if (1 + 1 == 3) { if (1 + 1 == 3) {
baz(); baz();
} }
"module evaluation";
``` ```
...@@ -43,7 +43,7 @@ graph TD ...@@ -43,7 +43,7 @@ graph TD
# Final # Final
```mermaid ```mermaid
graph TD graph TD
N0["Items: [ItemId(ModuleEvaluation), ItemId(0, Normal)]"]; N0["Items: [ItemId(0, Normal), ItemId(ModuleEvaluation)]"];
``` ```
# Entrypoints # Entrypoints
...@@ -58,8 +58,8 @@ graph TD ...@@ -58,8 +58,8 @@ graph TD
# Modules (dev) # Modules (dev)
## Part 0 ## Part 0
```js ```js
"module evaluation";
process.turbopack = {}; process.turbopack = {};
"module evaluation";
``` ```
## Part 1 ## Part 1
...@@ -68,8 +68,8 @@ process.turbopack = {}; ...@@ -68,8 +68,8 @@ process.turbopack = {};
``` ```
## Merged (module eval) ## Merged (module eval)
```js ```js
"module evaluation";
process.turbopack = {}; process.turbopack = {};
"module evaluation";
``` ```
# Entrypoints # Entrypoints
...@@ -85,8 +85,8 @@ process.turbopack = {}; ...@@ -85,8 +85,8 @@ process.turbopack = {};
# Modules (prod) # Modules (prod)
## Part 0 ## Part 0
```js ```js
"module evaluation";
process.turbopack = {}; process.turbopack = {};
"module evaluation";
``` ```
## Part 1 ## Part 1
...@@ -95,7 +95,7 @@ process.turbopack = {}; ...@@ -95,7 +95,7 @@ process.turbopack = {};
``` ```
## Merged (module eval) ## Merged (module eval)
```js ```js
"module evaluation";
process.turbopack = {}; process.turbopack = {};
"module evaluation";
``` ```
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment