Unverified Commit b07fb864 authored by Hendrik Liebau's avatar Hendrik Liebau Committed by GitHub

Ensure user-space stack frame for `'use cache'` in page/layout component (#85519)

parent 30e1c0e1
...@@ -545,9 +545,6 @@ impl<C: Comments> ServerActions<C> { ...@@ -545,9 +545,6 @@ impl<C: Comments> ServerActions<C> {
..Default::default() ..Default::default()
}), }),
}, },
decorators: vec![],
span: DUMMY_SP,
is_generator: false,
is_async: true, is_async: true,
..Default::default() ..Default::default()
}), }),
...@@ -752,44 +749,49 @@ impl<C: Comments> ServerActions<C> { ...@@ -752,44 +749,49 @@ impl<C: Comments> ServerActions<C> {
}); });
} }
// Create the action export decl from the arrow function let inner_fn_body = match *arrow.body.take() {
// export var cache_ident = async function() {}
self.hoisted_extra_items
.push(ModuleItem::ModuleDecl(ModuleDecl::ExportDecl(ExportDecl {
span: DUMMY_SP,
decl: VarDecl {
span: DUMMY_SP,
kind: VarDeclKind::Var,
decls: vec![VarDeclarator {
span: arrow.span,
name: Pat::Ident(cache_ident.clone().into()),
init: Some(wrap_cache_expr(
Box::new(Expr::Fn(FnExpr {
ident: None,
function: Box::new(Function {
params: new_params,
body: match *arrow.body.take() {
BlockStmtOrExpr::BlockStmt(body) => Some(body), BlockStmtOrExpr::BlockStmt(body) => Some(body),
BlockStmtOrExpr::Expr(expr) => Some(BlockStmt { BlockStmtOrExpr::Expr(expr) => Some(BlockStmt {
span: DUMMY_SP,
stmts: vec![Stmt::Return(ReturnStmt { stmts: vec![Stmt::Return(ReturnStmt {
span: DUMMY_SP, span: DUMMY_SP,
arg: Some(expr), arg: Some(expr),
})], })],
..Default::default() ..Default::default()
}), }),
}, };
decorators: vec![],
span: DUMMY_SP, let inner_fn = Box::new(Expr::Fn(FnExpr {
ident: None,
function: Box::new(Function {
params: new_params.clone(),
body: inner_fn_body,
span: arrow.span,
is_generator: false, is_generator: false,
is_async: true, is_async: true,
..Default::default() ..Default::default()
}), }),
})), }));
&cache_kind,
&reference_id, // Wrap with $$reactCache__(function foo() { return $$cache__(...) })
let wrapper_fn = wrap_cache_expr(
cache_kind.as_str(),
reference_id.as_str(),
ids_from_closure.len(), ids_from_closure.len(),
)), inner_fn,
self.arrow_or_fn_expr_ident.clone(),
arrow.span,
);
// Create the export: export var $$RSC_SERVER_CACHE_0 = ...
self.hoisted_extra_items
.push(ModuleItem::ModuleDecl(ModuleDecl::ExportDecl(ExportDecl {
span: DUMMY_SP,
decl: VarDecl {
kind: VarDeclKind::Var,
decls: vec![VarDeclarator {
span: arrow.span,
name: Pat::Ident(cache_ident.clone().into()),
init: Some(wrapper_fn),
definite: false, definite: false,
}], }],
..Default::default() ..Default::default()
...@@ -866,28 +868,40 @@ impl<C: Comments> ServerActions<C> { ...@@ -866,28 +868,40 @@ impl<C: Comments> ServerActions<C> {
private_ctxt: self.private_ctxt, private_ctxt: self.private_ctxt,
}); });
// export var cache_ident = async function() {} let function_body = function.body.take();
let function_span = function.span;
let inner_fn = Box::new(Expr::Fn(FnExpr {
ident: fn_name.clone(),
function: Box::new(Function {
params: new_params.clone(),
body: function_body,
span: function_span,
is_async: true,
..function.take()
}),
}));
// Wrap with $$reactCache__(function foo() { return $$cache__(...) })
let wrapper_fn = wrap_cache_expr(
cache_kind.as_str(),
reference_id.as_str(),
ids_from_closure.len(),
inner_fn,
fn_name.clone(),
function_span,
);
// Create the export: export var $$RSC_SERVER_CACHE_0 = ...
self.hoisted_extra_items self.hoisted_extra_items
.push(ModuleItem::ModuleDecl(ModuleDecl::ExportDecl(ExportDecl { .push(ModuleItem::ModuleDecl(ModuleDecl::ExportDecl(ExportDecl {
span: DUMMY_SP, span: DUMMY_SP,
decl: VarDecl { decl: VarDecl {
span: DUMMY_SP,
kind: VarDeclKind::Var, kind: VarDeclKind::Var,
decls: vec![VarDeclarator { decls: vec![VarDeclarator {
span: function.span, span: function_span,
name: Pat::Ident(cache_ident.clone().into()), name: Pat::Ident(cache_ident.clone().into()),
init: Some(wrap_cache_expr( init: Some(wrapper_fn),
Box::new(Expr::Fn(FnExpr {
ident: fn_name.clone(),
function: Box::new(Function {
params: new_params,
..function.take()
}),
})),
&cache_kind,
&reference_id,
ids_from_closure.len(),
)),
definite: false, definite: false,
}], }],
..Default::default() ..Default::default()
...@@ -901,7 +915,7 @@ impl<C: Comments> ServerActions<C> { ...@@ -901,7 +915,7 @@ impl<C: Comments> ServerActions<C> {
expr: Box::new(annotate_ident_as_server_reference( expr: Box::new(annotate_ident_as_server_reference(
cache_ident.clone(), cache_ident.clone(),
reference_id.clone(), reference_id.clone(),
function.span, function_span,
)), )),
}))); })));
...@@ -2049,6 +2063,7 @@ impl<C: Comments> VisitMut for ServerActions<C> { ...@@ -2049,6 +2063,7 @@ impl<C: Comments> VisitMut for ServerActions<C> {
} }
// import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; // import { cache as $$cache__ } from "private-next-rsc-cache-wrapper";
// import { cache as $$reactCache__ } from "react";
if self.has_cache && self.config.is_react_server_layer { if self.has_cache && self.config.is_react_server_layer {
new.push(ModuleItem::ModuleDecl(ModuleDecl::Import(ImportDecl { new.push(ModuleItem::ModuleDecl(ModuleDecl::Import(ImportDecl {
span: DUMMY_SP, span: DUMMY_SP,
...@@ -2068,8 +2083,26 @@ impl<C: Comments> VisitMut for ServerActions<C> { ...@@ -2068,8 +2083,26 @@ impl<C: Comments> VisitMut for ServerActions<C> {
phase: Default::default(), phase: Default::default(),
}))); })));
// Make it the first item new.push(ModuleItem::ModuleDecl(ModuleDecl::Import(ImportDecl {
new.rotate_right(1); span: DUMMY_SP,
specifiers: vec![ImportSpecifier::Named(ImportNamedSpecifier {
span: DUMMY_SP,
local: quote_ident!("$$reactCache__").into(),
imported: Some(quote_ident!("cache").into()),
is_type_only: false,
})],
src: Box::new(Str {
span: DUMMY_SP,
value: atom!("react"),
raw: None,
}),
type_only: false,
with: None,
phase: Default::default(),
})));
// Make them the first items
new.rotate_right(2);
} }
if (self.has_action || self.has_cache) && self.config.is_react_server_layer { if (self.has_action || self.has_cache) && self.config.is_react_server_layer {
...@@ -2379,24 +2412,64 @@ fn retain_names_from_declared_idents( ...@@ -2379,24 +2412,64 @@ fn retain_names_from_declared_idents(
*child_names = retained_names; *child_names = retained_names;
} }
fn wrap_cache_expr(expr: Box<Expr>, name: &str, id: &str, bound_args_len: usize) -> Box<Expr> { fn wrap_cache_expr(
// expr -> $$cache__("name", "id", 0, expr) cache_kind: &str,
Box::new(Expr::Call(CallExpr { reference_id: &str,
span: DUMMY_SP, bound_args_length: usize,
inner_fn: Box<Expr>,
fn_ident: Option<Ident>,
original_span: Span,
) -> Box<Expr> {
let cache_call = CallExpr {
span: original_span,
callee: quote_ident!("$$cache__").as_callee(), callee: quote_ident!("$$cache__").as_callee(),
args: vec![ args: vec![
ExprOrSpread { ExprOrSpread {
spread: None, spread: None,
expr: Box::new(name.into()), expr: Box::new(cache_kind.into()),
},
ExprOrSpread {
spread: None,
expr: Box::new(reference_id.into()),
},
ExprOrSpread {
spread: None,
expr: Box::new(Expr::Lit(Lit::Num(Number {
span: DUMMY_SP,
value: bound_args_length as f64,
raw: None,
}))),
}, },
inner_fn.as_arg(),
ExprOrSpread { ExprOrSpread {
spread: None, spread: None,
expr: Box::new(id.into()), expr: Box::new(Expr::Ident(private_ident!(DUMMY_SP, "arguments"))),
}, },
Number::from(bound_args_len).as_arg(),
expr.as_arg(),
], ],
..Default::default() ..Default::default()
};
// This wrapper function ensures that we have a user-space call stack frame.
let wrapper_fn = Box::new(Expr::Fn(FnExpr {
ident: fn_ident,
function: Box::new(Function {
body: Some(BlockStmt {
span: DUMMY_SP,
stmts: vec![Stmt::Return(ReturnStmt {
span: DUMMY_SP,
arg: Some(Box::new(Expr::Call(cache_call))),
})],
..Default::default()
}),
span: original_span,
..Default::default()
}),
}));
Box::new(Expr::Call(CallExpr {
callee: quote_ident!("$$reactCache__").as_callee(),
args: vec![wrapper_fn.as_arg()],
..Default::default()
})) }))
} }
......
/* __next_internal_action_entry_do_not_use__ {"c0dd5bb6fef67f5ab84327f5164ac2c3111a159337":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"c0dd5bb6fef67f5ab84327f5164ac2c3111a159337":"$$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";
import { cache as $$reactCache__ } from "react";
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 = $$reactCache__(function Cached() {
return $$cache__("default", "c0dd5bb6fef67f5ab84327f5164ac2c3111a159337", 0, async function Cached({ children }) {
return <div className={inter.className}>{children}</div>; return <div className={inter.className}>{children}</div>;
}, arguments);
}); });
registerServerReference($$RSC_SERVER_CACHE_0, "c0dd5bb6fef67f5ab84327f5164ac2c3111a159337", null); registerServerReference($$RSC_SERVER_CACHE_0, "c0dd5bb6fef67f5ab84327f5164ac2c3111a159337", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", { Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", {
......
...@@ -44,6 +44,7 @@ declare module 'private-next-rsc-cache-wrapper' { ...@@ -44,6 +44,7 @@ declare module 'private-next-rsc-cache-wrapper' {
kind: string, kind: string,
id: string, id: string,
boundArgsLength: number, boundArgsLength: number,
fn: TFn fn: TFn,
): TFn argsObj: IArguments
): Promise<any>
} }
/* __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";
import { cache as $$reactCache__ } from "react";
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 = $$reactCache__(function fn() {
return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, async function fn() {
return 'hello, ' + v; return 'hello, ' + v;
}, arguments);
}); });
registerServerReference($$RSC_SERVER_CACHE_0, "803128060c414d59f8552e4788b846c0d2b7f74743", null); registerServerReference($$RSC_SERVER_CACHE_0, "803128060c414d59f8552e4788b846c0d2b7f74743", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", { Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", {
......
/* __next_internal_action_entry_do_not_use__ {"8012a8d21b6362b4cc8f5b15560525095bc48dba80":"$$RSC_SERVER_CACHE_3","803128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0","8069348c79fce073bae2f70f139565a2fda1c74c74":"$$RSC_SERVER_CACHE_2","80951c375b4a6a6e89d67b743ec5808127cfde405d":"$$RSC_SERVER_CACHE_1"} */ 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","8069348c79fce073bae2f70f139565a2fda1c74c74":"$$RSC_SERVER_CACHE_2","80951c375b4a6a6e89d67b743ec5808127cfde405d":"$$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 var $$RSC_SERVER_CACHE_0 = $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, async function() { import { cache as $$reactCache__ } from "react";
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function foo() {
return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, async function() {
return 'foo'; return 'foo';
}, arguments);
}); });
registerServerReference($$RSC_SERVER_CACHE_0, "803128060c414d59f8552e4788b846c0d2b7f74743", null); registerServerReference($$RSC_SERVER_CACHE_0, "803128060c414d59f8552e4788b846c0d2b7f74743", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", { Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", {
...@@ -11,8 +14,10 @@ Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", { ...@@ -11,8 +14,10 @@ Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", {
}); });
const foo = $$RSC_SERVER_CACHE_0; const foo = $$RSC_SERVER_CACHE_0;
export { bar }; export { bar };
export var $$RSC_SERVER_CACHE_1 = $$cache__("default", "80951c375b4a6a6e89d67b743ec5808127cfde405d", 0, async function bar() { export var $$RSC_SERVER_CACHE_1 = $$reactCache__(function bar() {
return $$cache__("default", "80951c375b4a6a6e89d67b743ec5808127cfde405d", 0, async function bar() {
return 'bar'; return 'bar';
}, arguments);
}); });
registerServerReference($$RSC_SERVER_CACHE_1, "80951c375b4a6a6e89d67b743ec5808127cfde405d", null); registerServerReference($$RSC_SERVER_CACHE_1, "80951c375b4a6a6e89d67b743ec5808127cfde405d", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_1, "name", { Object["defineProperty"]($$RSC_SERVER_CACHE_1, "name", {
...@@ -24,8 +29,10 @@ var bar = $$RSC_SERVER_CACHE_1; ...@@ -24,8 +29,10 @@ var bar = $$RSC_SERVER_CACHE_1;
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 = $$reactCache__(function baz() {
return $$cache__("default", "8069348c79fce073bae2f70f139565a2fda1c74c74", 0, async function baz() {
return qux() + 'baz'; return qux() + 'baz';
}, arguments);
}); });
registerServerReference($$RSC_SERVER_CACHE_2, "8069348c79fce073bae2f70f139565a2fda1c74c74", null); registerServerReference($$RSC_SERVER_CACHE_2, "8069348c79fce073bae2f70f139565a2fda1c74c74", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_2, "name", { Object["defineProperty"]($$RSC_SERVER_CACHE_2, "name", {
...@@ -33,8 +40,10 @@ Object["defineProperty"]($$RSC_SERVER_CACHE_2, "name", { ...@@ -33,8 +40,10 @@ Object["defineProperty"]($$RSC_SERVER_CACHE_2, "name", {
writable: false writable: false
}); });
const baz = $$RSC_SERVER_CACHE_2; const baz = $$RSC_SERVER_CACHE_2;
export var $$RSC_SERVER_CACHE_3 = $$cache__("default", "8012a8d21b6362b4cc8f5b15560525095bc48dba80", 0, async function() { export var $$RSC_SERVER_CACHE_3 = $$reactCache__(function quux() {
return $$cache__("default", "8012a8d21b6362b4cc8f5b15560525095bc48dba80", 0, async function() {
return 'quux'; return 'quux';
}, arguments);
}); });
registerServerReference($$RSC_SERVER_CACHE_3, "8012a8d21b6362b4cc8f5b15560525095bc48dba80", null); registerServerReference($$RSC_SERVER_CACHE_3, "8012a8d21b6362b4cc8f5b15560525095bc48dba80", null);
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() { import { cache as $$reactCache__ } from "react";
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function my_fn() {
return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, async function() {
return 'data'; return 'data';
}, arguments);
}); });
registerServerReference($$RSC_SERVER_CACHE_0, "803128060c414d59f8552e4788b846c0d2b7f74743", null); registerServerReference($$RSC_SERVER_CACHE_0, "803128060c414d59f8552e4788b846c0d2b7f74743", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", { Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", {
......
/* __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() { import { cache as $$reactCache__ } from "react";
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function foo() {
return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, async function foo() {
return 'data A'; return 'data A';
}, arguments);
}); });
registerServerReference($$RSC_SERVER_CACHE_0, "803128060c414d59f8552e4788b846c0d2b7f74743", null); registerServerReference($$RSC_SERVER_CACHE_0, "803128060c414d59f8552e4788b846c0d2b7f74743", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", { Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", {
...@@ -10,8 +13,10 @@ Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", { ...@@ -10,8 +13,10 @@ Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", {
writable: false writable: false
}); });
export var foo = $$RSC_SERVER_CACHE_0; export var foo = $$RSC_SERVER_CACHE_0;
export var $$RSC_SERVER_CACHE_1 = $$cache__("default", "80951c375b4a6a6e89d67b743ec5808127cfde405d", 0, async function bar() { export var $$RSC_SERVER_CACHE_1 = $$reactCache__(function bar() {
return $$cache__("default", "80951c375b4a6a6e89d67b743ec5808127cfde405d", 0, async function bar() {
return 'data B'; return 'data B';
}, arguments);
}); });
registerServerReference($$RSC_SERVER_CACHE_1, "80951c375b4a6a6e89d67b743ec5808127cfde405d", null); registerServerReference($$RSC_SERVER_CACHE_1, "80951c375b4a6a6e89d67b743ec5808127cfde405d", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_1, "name", { Object["defineProperty"]($$RSC_SERVER_CACHE_1, "name", {
...@@ -19,8 +24,10 @@ Object["defineProperty"]($$RSC_SERVER_CACHE_1, "name", { ...@@ -19,8 +24,10 @@ Object["defineProperty"]($$RSC_SERVER_CACHE_1, "name", {
writable: false writable: false
}); });
export var bar = $$RSC_SERVER_CACHE_1; export var bar = $$RSC_SERVER_CACHE_1;
export var $$RSC_SERVER_CACHE_2 = $$cache__("default", "c069348c79fce073bae2f70f139565a2fda1c74c74", 0, async function Cached({ children }) { export var $$RSC_SERVER_CACHE_2 = $$reactCache__(function Cached() {
return $$cache__("default", "c069348c79fce073bae2f70f139565a2fda1c74c74", 0, async function Cached({ children }) {
return children; return children;
}, arguments);
}); });
registerServerReference($$RSC_SERVER_CACHE_2, "c069348c79fce073bae2f70f139565a2fda1c74c74", null); registerServerReference($$RSC_SERVER_CACHE_2, "c069348c79fce073bae2f70f139565a2fda1c74c74", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_2, "name", { Object["defineProperty"]($$RSC_SERVER_CACHE_2, "name", {
...@@ -28,8 +35,10 @@ Object["defineProperty"]($$RSC_SERVER_CACHE_2, "name", { ...@@ -28,8 +35,10 @@ Object["defineProperty"]($$RSC_SERVER_CACHE_2, "name", {
writable: false writable: false
}); });
export default $$RSC_SERVER_CACHE_2; export default $$RSC_SERVER_CACHE_2;
export var $$RSC_SERVER_CACHE_3 = $$cache__("default", "8012a8d21b6362b4cc8f5b15560525095bc48dba80", 0, async function baz() { export var $$RSC_SERVER_CACHE_3 = $$reactCache__(function baz() {
return $$cache__("default", "8012a8d21b6362b4cc8f5b15560525095bc48dba80", 0, async function baz() {
return 'data C'; return 'data C';
}, arguments);
}); });
registerServerReference($$RSC_SERVER_CACHE_3, "8012a8d21b6362b4cc8f5b15560525095bc48dba80", null); registerServerReference($$RSC_SERVER_CACHE_3, "8012a8d21b6362b4cc8f5b15560525095bc48dba80", null);
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() { import { cache as $$reactCache__ } from "react";
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function fn() {
return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, async function fn() {
return 'foo'; return 'foo';
}, arguments);
}); });
registerServerReference($$RSC_SERVER_CACHE_0, "803128060c414d59f8552e4788b846c0d2b7f74743", null); registerServerReference($$RSC_SERVER_CACHE_0, "803128060c414d59f8552e4788b846c0d2b7f74743", null);
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() { import { cache as $$reactCache__ } from "react";
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function foo() {
return $$cache__("x", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, async function foo() {
return 'data'; return 'data';
}, arguments);
}); });
registerServerReference($$RSC_SERVER_CACHE_0, "803128060c414d59f8552e4788b846c0d2b7f74743", null); registerServerReference($$RSC_SERVER_CACHE_0, "803128060c414d59f8552e4788b846c0d2b7f74743", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", { Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", {
......
...@@ -10,6 +10,6 @@ async function Component({ foo }) { ...@@ -10,6 +10,6 @@ async function Component({ foo }) {
} }
const data = await fn() const data = await fn()
// @ts-expect-error: data is not a valid react child // @ts-ignore: data is not a valid react child
return <div>{data}</div> return <div>{data}</div>
} }
/* __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]) { import { cache as $$reactCache__ } from "react";
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function fn() {
return $$cache__("default", "c03128060c414d59f8552e4788b846c0d2b7f74743", 2, 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
}; };
}, arguments);
}); });
registerServerReference($$RSC_SERVER_CACHE_0, "c03128060c414d59f8552e4788b846c0d2b7f74743", null); registerServerReference($$RSC_SERVER_CACHE_0, "c03128060c414d59f8552e4788b846c0d2b7f74743", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", { Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", {
...@@ -16,6 +19,6 @@ async function Component({ foo }) { ...@@ -16,6 +19,6 @@ async function Component({ foo }) {
const a = 123; const a = 123;
var fn = $$RSC_SERVER_CACHE_0.bind(null, encryptActionBoundArgs("c03128060c414d59f8552e4788b846c0d2b7f74743", a, foo)); var fn = $$RSC_SERVER_CACHE_0.bind(null, encryptActionBoundArgs("c03128060c414d59f8552e4788b846c0d2b7f74743", a, foo));
const data = await fn(); const data = await fn();
// @ts-expect-error: data is not a valid react child // @ts-ignore: data is not a valid react child
return <div>{data}</div>; return <div>{data}</div>;
} }
/* __next_internal_action_entry_do_not_use__ {"6090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1","e03128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"6090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1","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";
import { cache as $$reactCache__ } from "react";
import { Form } from 'components'; import { Form } from 'components';
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 = $$reactCache__(function cache() {
return $$cache__("default", "e03128060c414d59f8552e4788b846c0d2b7f74743", 2, 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,
...@@ -10,6 +12,7 @@ export var $$RSC_SERVER_CACHE_0 = $$cache__("default", "e03128060c414d59f8552e47 ...@@ -10,6 +12,7 @@ export var $$RSC_SERVER_CACHE_0 = $$cache__("default", "e03128060c414d59f8552e47
a: $$ACTION_ARG_1 a: $$ACTION_ARG_1
} }
]; ];
}, arguments);
}); });
registerServerReference($$RSC_SERVER_CACHE_0, "e03128060c414d59f8552e4788b846c0d2b7f74743", null); registerServerReference($$RSC_SERVER_CACHE_0, "e03128060c414d59f8552e4788b846c0d2b7f74743", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", { Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", {
......
/* __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";
import { cache as $$reactCache__ } from "react";
export const $$RSC_SERVER_ACTION_0 = async function fn($$ACTION_CLOSURE_BOUND) { export const $$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);
...@@ -9,12 +10,14 @@ export const $$RSC_SERVER_ACTION_0 = async function fn($$ACTION_CLOSURE_BOUND) { ...@@ -9,12 +10,14 @@ export const $$RSC_SERVER_ACTION_0 = async function fn($$ACTION_CLOSURE_BOUND) {
}; };
}; };
registerServerReference($$RSC_SERVER_ACTION_0, "406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null); registerServerReference($$RSC_SERVER_ACTION_0, "406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
export var $$RSC_SERVER_CACHE_1 = $$cache__("default", "c0951c375b4a6a6e89d67b743ec5808127cfde405d", 0, async function Component({ foo }) { export var $$RSC_SERVER_CACHE_1 = $$reactCache__(function Component() {
return $$cache__("default", "c0951c375b4a6a6e89d67b743ec5808127cfde405d", 0, async function Component({ foo }) {
const a = 123; const a = 123;
var fn = $$RSC_SERVER_ACTION_0.bind(null, encryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", a, foo)); var fn = $$RSC_SERVER_ACTION_0.bind(null, encryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", a, foo));
const data = await fn(); const data = await fn();
// @ts-expect-error: data is not a valid react child // @ts-expect-error: data is not a valid react child
return <div>{data}</div>; return <div>{data}</div>;
}, arguments);
}); });
registerServerReference($$RSC_SERVER_CACHE_1, "c0951c375b4a6a6e89d67b743ec5808127cfde405d", null); registerServerReference($$RSC_SERVER_CACHE_1, "c0951c375b4a6a6e89d67b743ec5808127cfde405d", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_1, "name", { Object["defineProperty"]($$RSC_SERVER_CACHE_1, "name", {
......
...@@ -10,6 +10,6 @@ async function Component({ foo }) { ...@@ -10,6 +10,6 @@ async function Component({ foo }) {
} }
const data = await fn() const data = await fn()
// @ts-expect-error: data is not a valid react child // @ts-ignore: data is not a valid react child
return <div>{data}</div> return <div>{data}</div>
} }
/* __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([$$ACTION_ARG_0, $$ACTION_ARG_1]) { import { cache as $$reactCache__ } from "react";
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function fn() {
return $$cache__("default", "c03128060c414d59f8552e4788b846c0d2b7f74743", 2, async function([$$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
}; };
}, arguments);
}); });
registerServerReference($$RSC_SERVER_CACHE_0, "c03128060c414d59f8552e4788b846c0d2b7f74743", null); registerServerReference($$RSC_SERVER_CACHE_0, "c03128060c414d59f8552e4788b846c0d2b7f74743", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", { Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", {
...@@ -16,6 +19,6 @@ async function Component({ foo }) { ...@@ -16,6 +19,6 @@ async function Component({ foo }) {
const a = 123; const a = 123;
const fn = $$RSC_SERVER_CACHE_0.bind(null, encryptActionBoundArgs("c03128060c414d59f8552e4788b846c0d2b7f74743", a, foo)); const fn = $$RSC_SERVER_CACHE_0.bind(null, encryptActionBoundArgs("c03128060c414d59f8552e4788b846c0d2b7f74743", a, foo));
const data = await fn(); const data = await fn();
// @ts-expect-error: data is not a valid react child // @ts-ignore: data is not a valid react child
return <div>{data}</div>; return <div>{data}</div>;
} }
/* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0","e0951c375b4a6a6e89d67b743ec5808127cfde405d":"$$RSC_SERVER_CACHE_1"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0","e0951c375b4a6a6e89d67b743ec5808127cfde405d":"$$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";
import { cache as $$reactCache__ } from "react";
import { Button } from 'components'; import { Button } from 'components';
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 $$RSC_SERVER_ACTION_0 = async function action($$ACTION_CLOSURE_BOUND) {
...@@ -8,13 +9,15 @@ export const $$RSC_SERVER_ACTION_0 = async function action($$ACTION_CLOSURE_BOUN ...@@ -8,13 +9,15 @@ export const $$RSC_SERVER_ACTION_0 = async function action($$ACTION_CLOSURE_BOUN
console.log(secret, $$ACTION_ARG_0); console.log(secret, $$ACTION_ARG_0);
}; };
registerServerReference($$RSC_SERVER_ACTION_0, "406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null); registerServerReference($$RSC_SERVER_ACTION_0, "406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
export var $$RSC_SERVER_CACHE_1 = $$cache__("default", "e0951c375b4a6a6e89d67b743ec5808127cfde405d", 0, async function getCachedRandom(x, children) { export var $$RSC_SERVER_CACHE_1 = $$reactCache__(function getCachedRandom() {
return $$cache__("default", "e0951c375b4a6a6e89d67b743ec5808127cfde405d", 0, async function getCachedRandom(x, children) {
return { return {
x, x,
y: Math.random(), y: Math.random(),
z: <Button action={$$RSC_SERVER_ACTION_0.bind(null, encryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", x))}/>, z: <Button action={$$RSC_SERVER_ACTION_0.bind(null, encryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", x))}/>,
r: children r: children
}; };
}, arguments);
}); });
registerServerReference($$RSC_SERVER_CACHE_1, "e0951c375b4a6a6e89d67b743ec5808127cfde405d", null); registerServerReference($$RSC_SERVER_CACHE_1, "e0951c375b4a6a6e89d67b743ec5808127cfde405d", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_1, "name", { Object["defineProperty"]($$RSC_SERVER_CACHE_1, "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";
import { cache as $$reactCache__ } from "react";
// Expect no error here, this is allowed to be sync because it's not exported. // Expect no error here, this is allowed to be sync because it's not exported.
function Foo() { function Foo() {
const v = Math.random(); const v = Math.random();
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 = $$reactCache__(function bar() {
return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, async function bar() {
return <Foo/>; return <Foo/>;
}, arguments);
}); });
registerServerReference($$RSC_SERVER_CACHE_0, "803128060c414d59f8552e4788b846c0d2b7f74743", null); registerServerReference($$RSC_SERVER_CACHE_0, "803128060c414d59f8552e4788b846c0d2b7f74743", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", { Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", {
......
...@@ -3,11 +3,14 @@ ...@@ -3,11 +3,14 @@
/* __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"; /* __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) { import { cache as $$reactCache__ } from "react";
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function f1() {
return $$cache__("default", "e03128060c414d59f8552e4788b846c0d2b7f74743", 0, async function f1(a, b) {
return [ return [
a, a,
b b
]; ];
}, arguments);
}); });
registerServerReference($$RSC_SERVER_CACHE_0, "e03128060c414d59f8552e4788b846c0d2b7f74743", null); registerServerReference($$RSC_SERVER_CACHE_0, "e03128060c414d59f8552e4788b846c0d2b7f74743", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", { Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", {
...@@ -25,12 +28,14 @@ $$RSC_SERVER_ACTION_1 = async function f2(a, b) { ...@@ -25,12 +28,14 @@ $$RSC_SERVER_ACTION_1 = async function f2(a, b) {
registerServerReference($$RSC_SERVER_ACTION_1, "6090b5db271335765a4b0eab01f044b381b5ebd5cd", null); registerServerReference($$RSC_SERVER_ACTION_1, "6090b5db271335765a4b0eab01f044b381b5ebd5cd", null);
var f2 = $$RSC_SERVER_ACTION_1; var f2 = $$RSC_SERVER_ACTION_1;
export var // Should be 1 111111 1, which is "ff" in hex. export var // Should be 1 111111 1, which is "ff" in hex.
$$RSC_SERVER_CACHE_2 = $$cache__("default", "ff69348c79fce073bae2f70f139565a2fda1c74c74", 0, async function f3(a, b, ...rest) { $$RSC_SERVER_CACHE_2 = $$reactCache__(function f3() {
return $$cache__("default", "ff69348c79fce073bae2f70f139565a2fda1c74c74", 0, async function f3(a, b, ...rest) {
return [ return [
a, a,
b, b,
rest rest
]; ];
}, arguments);
}); });
registerServerReference($$RSC_SERVER_CACHE_2, "ff69348c79fce073bae2f70f139565a2fda1c74c74", null); registerServerReference($$RSC_SERVER_CACHE_2, "ff69348c79fce073bae2f70f139565a2fda1c74c74", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_2, "name", { Object["defineProperty"]($$RSC_SERVER_CACHE_2, "name", {
...@@ -64,7 +69,8 @@ $$RSC_SERVER_ACTION_4 = async function f5(a, b, c, d, e, f) { ...@@ -64,7 +69,8 @@ $$RSC_SERVER_ACTION_4 = async function f5(a, b, c, d, e, f) {
registerServerReference($$RSC_SERVER_ACTION_4, "7ea9b2939c1f39073a6bed227fd20233064c8b7869", null); registerServerReference($$RSC_SERVER_ACTION_4, "7ea9b2939c1f39073a6bed227fd20233064c8b7869", null);
var f5 = $$RSC_SERVER_ACTION_4; var f5 = $$RSC_SERVER_ACTION_4;
export var // Should be 1 111111 1, which is "ff" in hex. export var // Should be 1 111111 1, which is "ff" in hex.
$$RSC_SERVER_CACHE_5 = $$cache__("default", "ff471a5eb0be1c31686dd4ba938a80328b80b1615d", 0, async function f6(a, b, c, d, e, f, g) { $$RSC_SERVER_CACHE_5 = $$reactCache__(function f6() {
return $$cache__("default", "ff471a5eb0be1c31686dd4ba938a80328b80b1615d", 0, async function f6(a, b, c, d, e, f, g) {
return [ return [
a, a,
b, b,
...@@ -74,6 +80,7 @@ $$RSC_SERVER_CACHE_5 = $$cache__("default", "ff471a5eb0be1c31686dd4ba938a80328b8 ...@@ -74,6 +80,7 @@ $$RSC_SERVER_CACHE_5 = $$cache__("default", "ff471a5eb0be1c31686dd4ba938a80328b8
f, f,
g g
]; ];
}, arguments);
}); });
registerServerReference($$RSC_SERVER_CACHE_5, "ff471a5eb0be1c31686dd4ba938a80328b80b1615d", null); registerServerReference($$RSC_SERVER_CACHE_5, "ff471a5eb0be1c31686dd4ba938a80328b80b1615d", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_5, "name", { Object["defineProperty"]($$RSC_SERVER_CACHE_5, "name", {
......
/* __next_internal_action_entry_do_not_use__ {"60079087479e4c103d815f273878c7d1b8e902cc39":"action3","70f14702b5a021dd117f7ec7a3c838f397c2046d3b":"action","7fc18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default","e03128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"60079087479e4c103d815f273878c7d1b8e902cc39":"action3","70f14702b5a021dd117f7ec7a3c838f397c2046d3b":"action","7fc18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default","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";
import { cache as $$reactCache__ } from "react";
// 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 action(a, b, c) {
return <div> return <div>
...@@ -24,11 +25,13 @@ export async function action3(a, b) { ...@@ -24,11 +25,13 @@ export async function action3(a, b) {
{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 = $$reactCache__(function cache() {
return $$cache__("default", "e03128060c414d59f8552e4788b846c0d2b7f74743", 0, async function cache(a, b) {
return <div> return <div>
{a} {a}
{b} {b}
</div>; </div>;
}, arguments);
}); });
registerServerReference($$RSC_SERVER_CACHE_0, "e03128060c414d59f8552e4788b846c0d2b7f74743", null); registerServerReference($$RSC_SERVER_CACHE_0, "e03128060c414d59f8552e4788b846c0d2b7f74743", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", { Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", {
......
/* __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) { import { cache as $$reactCache__ } from "react";
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function() {
return $$cache__("default", "f03128060c414d59f8552e4788b846c0d2b7f74743", 0, async function(a, b, c) {
return <div> return <div>
{a} {a}
{b} {b}
{c} {c}
</div>; </div>;
}, arguments);
}); });
registerServerReference($$RSC_SERVER_CACHE_0, "f03128060c414d59f8552e4788b846c0d2b7f74743", null); registerServerReference($$RSC_SERVER_CACHE_0, "f03128060c414d59f8552e4788b846c0d2b7f74743", null);
export default $$RSC_SERVER_CACHE_0; export default $$RSC_SERVER_CACHE_0;
/* __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) { import { cache as $$reactCache__ } from "react";
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function() {
return $$cache__("default", "f03128060c414d59f8552e4788b846c0d2b7f74743", 0, async function(a, b, c) {
return <div> return <div>
{a} {a}
{b} {b}
{c} {c}
</div>; </div>;
}, arguments);
}); });
registerServerReference($$RSC_SERVER_CACHE_0, "f03128060c414d59f8552e4788b846c0d2b7f74743", null); registerServerReference($$RSC_SERVER_CACHE_0, "f03128060c414d59f8552e4788b846c0d2b7f74743", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", { Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", {
......
/* __next_internal_action_entry_do_not_use__ {"409ed0cc47abc4e1c64320cf42b74ae60b58c40f00":"$$RSC_SERVER_ACTION_3","601c36b06e398c97abe5d5d7ae8c672bfddf4e1b91":"$$RSC_SERVER_ACTION_2","c0951c375b4a6a6e89d67b743ec5808127cfde405d":"$$RSC_SERVER_CACHE_1","e03128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"409ed0cc47abc4e1c64320cf42b74ae60b58c40f00":"$$RSC_SERVER_ACTION_3","601c36b06e398c97abe5d5d7ae8c672bfddf4e1b91":"$$RSC_SERVER_ACTION_2","c0951c375b4a6a6e89d67b743ec5808127cfde405d":"$$RSC_SERVER_CACHE_1","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";
import { cache as $$reactCache__ } from "react";
import { Client } from 'components'; import { Client } from 'components';
export var $$RSC_SERVER_CACHE_0 = $$cache__("default", "e03128060c414d59f8552e4788b846c0d2b7f74743", 2, async function([$$ACTION_ARG_0, $$ACTION_ARG_1], c) { export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function // Should be 1 110000 0, which is "e0" in hex (counts as two params,
// because of the encrypted bound args param)
fn1() {
return $$cache__("default", "e03128060c414d59f8552e4788b846c0d2b7f74743", 2, async function([$$ACTION_ARG_0, $$ACTION_ARG_1], c) {
return $$ACTION_ARG_0 + $$ACTION_ARG_1 + c; return $$ACTION_ARG_0 + $$ACTION_ARG_1 + c;
}, arguments);
}); });
registerServerReference($$RSC_SERVER_CACHE_0, "e03128060c414d59f8552e4788b846c0d2b7f74743", null); registerServerReference($$RSC_SERVER_CACHE_0, "e03128060c414d59f8552e4788b846c0d2b7f74743", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", { Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", {
value: "fn1", value: "fn1",
writable: false writable: false
}); });
export var $$RSC_SERVER_CACHE_1 = $$cache__("default", "c0951c375b4a6a6e89d67b743ec5808127cfde405d", 2, async function // Should be 1 100000 0, which is "c0" in hex (counts as one param, export var $$RSC_SERVER_CACHE_1 = $$reactCache__(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() {
return $$cache__("default", "c0951c375b4a6a6e89d67b743ec5808127cfde405d", 2, async function fn2([$$ACTION_ARG_0, $$ACTION_ARG_1]) {
return $$ACTION_ARG_0 + $$ACTION_ARG_1; return $$ACTION_ARG_0 + $$ACTION_ARG_1;
}, arguments);
}); });
registerServerReference($$RSC_SERVER_CACHE_1, "c0951c375b4a6a6e89d67b743ec5808127cfde405d", null); registerServerReference($$RSC_SERVER_CACHE_1, "c0951c375b4a6a6e89d67b743ec5808127cfde405d", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_1, "name", { Object["defineProperty"]($$RSC_SERVER_CACHE_1, "name", {
...@@ -36,7 +43,5 @@ fn4($$ACTION_CLOSURE_BOUND) { ...@@ -36,7 +43,5 @@ fn4($$ACTION_CLOSURE_BOUND) {
registerServerReference($$RSC_SERVER_ACTION_3, "409ed0cc47abc4e1c64320cf42b74ae60b58c40f00", null); registerServerReference($$RSC_SERVER_ACTION_3, "409ed0cc47abc4e1c64320cf42b74ae60b58c40f00", null);
export async function Component(a) { export async function Component(a) {
const b = 1; const b = 1;
return <Client // Should be 1 110000 0, which is "e0" in hex (counts as two params, return <Client fn1={$$RSC_SERVER_CACHE_0.bind(null, encryptActionBoundArgs("e03128060c414d59f8552e4788b846c0d2b7f74743", a, b))} fn2={$$RSC_SERVER_CACHE_1.bind(null, encryptActionBoundArgs("c0951c375b4a6a6e89d67b743ec5808127cfde405d", a, b))} fn3={$$RSC_SERVER_ACTION_2.bind(null, encryptActionBoundArgs("601c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", a, b))} fn4={$$RSC_SERVER_ACTION_3.bind(null, encryptActionBoundArgs("409ed0cc47abc4e1c64320cf42b74ae60b58c40f00", a, b))}/>;
// because of the encrypted bound args param)
fn1={$$RSC_SERVER_CACHE_0.bind(null, encryptActionBoundArgs("e03128060c414d59f8552e4788b846c0d2b7f74743", a, b))} fn2={$$RSC_SERVER_CACHE_1.bind(null, encryptActionBoundArgs("c0951c375b4a6a6e89d67b743ec5808127cfde405d", a, b))} fn3={$$RSC_SERVER_ACTION_2.bind(null, encryptActionBoundArgs("601c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", a, b))} fn4={$$RSC_SERVER_ACTION_3.bind(null, encryptActionBoundArgs("409ed0cc47abc4e1c64320cf42b74ae60b58c40f00", a, b))}/>;
} }
/* __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() {}); import { cache as $$reactCache__ } from "react";
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function foo() {
return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, async function foo() {}, arguments);
});
registerServerReference($$RSC_SERVER_CACHE_0, "803128060c414d59f8552e4788b846c0d2b7f74743", null); registerServerReference($$RSC_SERVER_CACHE_0, "803128060c414d59f8552e4788b846c0d2b7f74743", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", { Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", {
value: "foo", value: "foo",
......
/* __next_internal_action_entry_do_not_use__ {"4090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1","c03128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"4090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1","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]) { import { cache as $$reactCache__ } from "react";
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function foo() {
return $$cache__("default", "c03128060c414d59f8552e4788b846c0d2b7f74743", 2, async function foo([$$ACTION_ARG_0, $$ACTION_ARG_1]) {
return $$ACTION_ARG_0 * $$ACTION_ARG_1; return $$ACTION_ARG_0 * $$ACTION_ARG_1;
}, arguments);
}); });
registerServerReference($$RSC_SERVER_CACHE_0, "c03128060c414d59f8552e4788b846c0d2b7f74743", null); registerServerReference($$RSC_SERVER_CACHE_0, "c03128060c414d59f8552e4788b846c0d2b7f74743", null);
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__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, async function fetch1() { import { cache as $$reactCache__ } from "react";
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function fetch1() {
return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, async function fetch1() {
return fetch('https://example.com').then((res)=>res.json()); return fetch('https://example.com').then((res)=>res.json());
}, arguments);
}); });
registerServerReference($$RSC_SERVER_CACHE_0, "803128060c414d59f8552e4788b846c0d2b7f74743", null); registerServerReference($$RSC_SERVER_CACHE_0, "803128060c414d59f8552e4788b846c0d2b7f74743", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", { Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", {
......
/* __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() { import { cache as $$reactCache__ } from "react";
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function foo() {
return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, async function foo() {
return fetch('https://example.com').then((res)=>res.json()); return fetch('https://example.com').then((res)=>res.json());
}, arguments);
}); });
registerServerReference($$RSC_SERVER_CACHE_0, "803128060c414d59f8552e4788b846c0d2b7f74743", null); registerServerReference($$RSC_SERVER_CACHE_0, "803128060c414d59f8552e4788b846c0d2b7f74743", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", { Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", {
......
/* __next_internal_action_entry_do_not_use__ {"4090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1","c03128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"4090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1","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", 1, async function([$$ACTION_ARG_0]) { import { cache as $$reactCache__ } from "react";
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function() {
return $$cache__("default", "c03128060c414d59f8552e4788b846c0d2b7f74743", 1, async function([$$ACTION_ARG_0]) {
return $$ACTION_ARG_0(); return $$ACTION_ARG_0();
}, arguments);
}); });
registerServerReference($$RSC_SERVER_CACHE_0, "c03128060c414d59f8552e4788b846c0d2b7f74743", null); registerServerReference($$RSC_SERVER_CACHE_0, "c03128060c414d59f8552e4788b846c0d2b7f74743", null);
function createCachedFn(start) { function createCachedFn(start) {
......
/* __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";
import { cache as $$reactCache__ } from "react";
// Exported TypeScript nodes should be ignored when validating that all module // Exported TypeScript nodes should be ignored when validating that all module
// exports are async functions. // exports are async functions.
export type T = { export type T = {
...@@ -11,7 +12,9 @@ export enum E { ...@@ -11,7 +12,9 @@ export enum E {
} }
export default interface D { export default interface D {
} }
export var $$RSC_SERVER_CACHE_0 = $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, async function Page() {}); export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function Page() {
return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, async function Page() {}, arguments);
});
registerServerReference($$RSC_SERVER_CACHE_0, "803128060c414d59f8552e4788b846c0d2b7f74743", null); registerServerReference($$RSC_SERVER_CACHE_0, "803128060c414d59f8552e4788b846c0d2b7f74743", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", { Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", {
value: "Page", value: "Page",
......
/* __next_internal_action_entry_do_not_use__ {"803128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0","80951c375b4a6a6e89d67b743ec5808127cfde405d":"$$RSC_SERVER_CACHE_1"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"803128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0","80951c375b4a6a6e89d67b743ec5808127cfde405d":"$$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 var $$RSC_SERVER_CACHE_0 = $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, async function() {}); import { cache as $$reactCache__ } from "react";
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function foo() {
return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, async function() {}, arguments);
});
registerServerReference($$RSC_SERVER_CACHE_0, "803128060c414d59f8552e4788b846c0d2b7f74743", null); registerServerReference($$RSC_SERVER_CACHE_0, "803128060c414d59f8552e4788b846c0d2b7f74743", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", { Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", {
value: "foo", value: "foo",
writable: false writable: false
}); });
const foo = $$RSC_SERVER_CACHE_0; const foo = $$RSC_SERVER_CACHE_0;
export var $$RSC_SERVER_CACHE_1 = $$cache__("default", "80951c375b4a6a6e89d67b743ec5808127cfde405d", 0, async function bar() { export var $$RSC_SERVER_CACHE_1 = $$reactCache__(function bar() {
return $$cache__("default", "80951c375b4a6a6e89d67b743ec5808127cfde405d", 0, async function bar() {
return foo(); return foo();
}, arguments);
}); });
registerServerReference($$RSC_SERVER_CACHE_1, "80951c375b4a6a6e89d67b743ec5808127cfde405d", null); registerServerReference($$RSC_SERVER_CACHE_1, "80951c375b4a6a6e89d67b743ec5808127cfde405d", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_1, "name", { Object["defineProperty"]($$RSC_SERVER_CACHE_1, "name", {
......
{"version":3,"sources":["input.js"],"sourcesContent":["'use cache'\n\nconst foo = async () => {\n 'use cache'\n}\n\nexport async function bar() {\n return foo()\n}\n"],"names":[],"mappings":";;;WAEY,+GAEZ;AAFY;;;;;AAAZ,MAAM;WAIC,6FAAA,eAAe;IACpB,OAAO;AACT;;;;;;AAFA,WAAsB"} {"version":3,"sources":["input.js"],"sourcesContent":["'use cache'\n\nconst foo = async () => {\n 'use cache'\n}\n\nexport async function bar() {\n return foo()\n}\n"],"names":[],"mappings":";;;;WAEY,sCAAA,SAAN;WAAM,sEAAA,kBAEZ;;AAFY;;;;;AAAZ,MAAM;WAIC,sCAAA,SAAe;WAAf,sEAAA,eAAe;QACpB,OAAO;IACT;;AAFO;;;;;AAAP,WAAsB"}
...@@ -66,7 +66,6 @@ import { ...@@ -66,7 +66,6 @@ import {
type SearchParams, type SearchParams,
} from '../request/search-params' } from '../request/search-params'
import type { Params } from '../request/params' import type { Params } from '../request/params'
import React from 'react'
import { createLazyResult, isResolvedLazyResult } from '../lib/lazy-result' import { createLazyResult, isResolvedLazyResult } from '../lib/lazy-result'
import { dynamicAccessAsyncStorage } from '../app-render/dynamic-access-async-storage.external' import { dynamicAccessAsyncStorage } from '../app-render/dynamic-access-async-storage.external'
import { isReactLargeShellError } from '../app-render/react-large-shell-error' import { isReactLargeShellError } from '../app-render/react-large-shell-error'
...@@ -138,7 +137,7 @@ function generateCacheEntry( ...@@ -138,7 +137,7 @@ function generateCacheEntry(
clientReferenceManifest: DeepReadonly<ClientReferenceManifestForRsc>, clientReferenceManifest: DeepReadonly<ClientReferenceManifestForRsc>,
encodedArguments: FormData | string, encodedArguments: FormData | string,
fn: (...args: unknown[]) => Promise<unknown>, fn: (...args: unknown[]) => Promise<unknown>,
sharedErrorStack: string | undefined timeoutError: UseCacheTimeoutError
) { ) {
// We need to run this inside a clean AsyncLocalStorage snapshot so that the cache // We need to run this inside a clean AsyncLocalStorage snapshot so that the cache
// generation cannot read anything from the context we're currently executing which // generation cannot read anything from the context we're currently executing which
...@@ -152,7 +151,7 @@ function generateCacheEntry( ...@@ -152,7 +151,7 @@ function generateCacheEntry(
clientReferenceManifest, clientReferenceManifest,
encodedArguments, encodedArguments,
fn, fn,
sharedErrorStack timeoutError
) )
} }
...@@ -162,7 +161,7 @@ function generateCacheEntryWithRestoredWorkStore( ...@@ -162,7 +161,7 @@ function generateCacheEntryWithRestoredWorkStore(
clientReferenceManifest: DeepReadonly<ClientReferenceManifestForRsc>, clientReferenceManifest: DeepReadonly<ClientReferenceManifestForRsc>,
encodedArguments: FormData | string, encodedArguments: FormData | string,
fn: (...args: unknown[]) => Promise<unknown>, fn: (...args: unknown[]) => Promise<unknown>,
sharedErrorStack: string | undefined timeoutError: UseCacheTimeoutError
) { ) {
// Since we cleared the AsyncLocalStorage we need to restore the workStore. // Since we cleared the AsyncLocalStorage we need to restore the workStore.
// Note: We explicitly don't restore the RequestStore nor the PrerenderStore. // Note: We explicitly don't restore the RequestStore nor the PrerenderStore.
...@@ -179,7 +178,7 @@ function generateCacheEntryWithRestoredWorkStore( ...@@ -179,7 +178,7 @@ function generateCacheEntryWithRestoredWorkStore(
clientReferenceManifest, clientReferenceManifest,
encodedArguments, encodedArguments,
fn, fn,
sharedErrorStack timeoutError
) )
} }
...@@ -285,7 +284,7 @@ function generateCacheEntryWithCacheContext( ...@@ -285,7 +284,7 @@ function generateCacheEntryWithCacheContext(
clientReferenceManifest: DeepReadonly<ClientReferenceManifestForRsc>, clientReferenceManifest: DeepReadonly<ClientReferenceManifestForRsc>,
encodedArguments: FormData | string, encodedArguments: FormData | string,
fn: (...args: unknown[]) => Promise<unknown>, fn: (...args: unknown[]) => Promise<unknown>,
sharedErrorStack: string | undefined timeoutError: UseCacheTimeoutError
) { ) {
if (!workStore.cacheLifeProfiles) { if (!workStore.cacheLifeProfiles) {
throw new InvariantError('cacheLifeProfiles should always be provided.') throw new InvariantError('cacheLifeProfiles should always be provided.')
...@@ -310,7 +309,7 @@ function generateCacheEntryWithCacheContext( ...@@ -310,7 +309,7 @@ function generateCacheEntryWithCacheContext(
clientReferenceManifest, clientReferenceManifest,
encodedArguments, encodedArguments,
fn, fn,
sharedErrorStack timeoutError
) )
) )
} }
...@@ -525,7 +524,7 @@ async function generateCacheEntryImpl( ...@@ -525,7 +524,7 @@ async function generateCacheEntryImpl(
clientReferenceManifest: DeepReadonly<ClientReferenceManifestForRsc>, clientReferenceManifest: DeepReadonly<ClientReferenceManifestForRsc>,
encodedArguments: FormData | string, encodedArguments: FormData | string,
fn: (...args: unknown[]) => Promise<unknown>, fn: (...args: unknown[]) => Promise<unknown>,
sharedErrorStack: string | undefined timeoutError: UseCacheTimeoutError
): Promise<GenerateCacheEntryResult> { ): Promise<GenerateCacheEntryResult> {
const temporaryReferences = createServerTemporaryReferenceSet() const temporaryReferences = createServerTemporaryReferenceSet()
const outerWorkUnitStore = cacheContext.outerWorkUnitStore const outerWorkUnitStore = cacheContext.outerWorkUnitStore
...@@ -631,12 +630,8 @@ async function generateCacheEntryImpl( ...@@ -631,12 +630,8 @@ async function generateCacheEntryImpl(
// Otherwise we assume you stalled on hanging input and de-opt. This needs // Otherwise we assume you stalled on hanging input and de-opt. This needs
// to be lower than just the general timeout of 60 seconds. // to be lower than just the general timeout of 60 seconds.
const timer = setTimeout(() => { const timer = setTimeout(() => {
const error = new UseCacheTimeoutError() workStore.invalidDynamicUsageError = timeoutError
if (sharedErrorStack) { timeoutAbortController.abort(timeoutError)
error.stack = error.name + ': ' + error.message + sharedErrorStack
}
workStore.invalidDynamicUsageError = error
timeoutAbortController.abort(error)
}, 50000) }, 50000)
const dynamicAccessAbortSignal = const dynamicAccessAbortSignal =
...@@ -689,7 +684,7 @@ async function generateCacheEntryImpl( ...@@ -689,7 +684,7 @@ async function generateCacheEntryImpl(
const hangingPromise = makeHangingPromise<never>( const hangingPromise = makeHangingPromise<never>(
outerWorkUnitStore.renderSignal, outerWorkUnitStore.renderSignal,
workStore.route, workStore.route,
abortSignal.reason 'dynamic "use cache"'
) )
if (outerWorkUnitStore.cacheSignal) { if (outerWorkUnitStore.cacheSignal) {
...@@ -830,26 +825,15 @@ function createTrackedReadableStream( ...@@ -830,26 +825,15 @@ function createTrackedReadableStream(
}) })
} }
function wrapAsInvalidDynamicUsageError( export async function cache(
error: Error,
sharedErrorStack: string | undefined,
workStore: WorkStore
) {
if (sharedErrorStack) {
error.stack = error.name + ': ' + error.message + sharedErrorStack
}
workStore.invalidDynamicUsageError ??= error
return error
}
export function cache(
kind: string, kind: string,
id: string, id: string,
boundArgsLength: number, boundArgsLength: number,
originalFn: (...args: unknown[]) => Promise<unknown> originalFn: (...args: unknown[]) => Promise<unknown>,
argsObj: IArguments
) { ) {
let args = Array.prototype.slice.call(argsObj)
const isPrivate = kind === 'private' const isPrivate = kind === 'private'
// Private caches are currently only stored in the Resume Data Cache (RDC), // Private caches are currently only stored in the Resume Data Cache (RDC),
...@@ -860,16 +844,19 @@ export function cache( ...@@ -860,16 +844,19 @@ export function cache(
throw new Error('Unknown cache handler: ' + kind) throw new Error('Unknown cache handler: ' + kind)
} }
// Capture a better error stack in this scope. const timeoutError = new UseCacheTimeoutError()
const sharedError = new Error() Error.captureStackTrace(timeoutError, cache)
Error.captureStackTrace(sharedError, cache)
const sharedErrorStack = sharedError.stack?.slice( const wrapAsInvalidDynamicUsageError = (
sharedError.stack.indexOf('\n') error: Error,
) workStore: WorkStore
) => {
Error.captureStackTrace(error, cache)
workStore.invalidDynamicUsageError ??= error
return error
}
const name = originalFn.name
const cachedFn = {
[name]: async function (...args: any[]) {
const workStore = workAsyncStorage.getStore() const workStore = workAsyncStorage.getStore()
if (workStore === undefined) { if (workStore === undefined) {
throw new Error( throw new Error(
...@@ -877,10 +864,9 @@ export function cache( ...@@ -877,10 +864,9 @@ export function cache(
) )
} }
let fn = originalFn
const workUnitStore = workUnitAsyncStorage.getStore() const workUnitStore = workUnitAsyncStorage.getStore()
const name = originalFn.name
let fn = originalFn
let cacheContext: CacheContext let cacheContext: CacheContext
if (isPrivate) { if (isPrivate) {
...@@ -916,7 +902,6 @@ export function cache( ...@@ -916,7 +902,6 @@ export function cache(
// TODO: Add a link to an error documentation page when we have one. // TODO: Add a link to an error documentation page when we have one.
`${expression} must not be used within \`unstable_cache()\`.` `${expression} must not be used within \`unstable_cache()\`.`
), ),
sharedErrorStack,
workStore workStore
) )
} }
...@@ -926,7 +911,6 @@ export function cache( ...@@ -926,7 +911,6 @@ export function cache(
// TODO: Add a link to an error documentation page when we have one. // TODO: Add a link to an error documentation page when we have one.
`${expression} must not be used within "use cache". It can only be nested inside of another ${expression}.` `${expression} must not be used within "use cache". It can only be nested inside of another ${expression}.`
), ),
sharedErrorStack,
workStore workStore
) )
} }
...@@ -944,7 +928,6 @@ export function cache( ...@@ -944,7 +928,6 @@ export function cache(
// TODO: Add a link to an error documentation page when we have one. // TODO: Add a link to an error documentation page when we have one.
`${expression} cannot be used outside of a request context.` `${expression} cannot be used outside of a request context.`
), ),
sharedErrorStack,
workStore workStore
) )
default: default:
...@@ -1202,7 +1185,7 @@ export function cache( ...@@ -1202,7 +1185,7 @@ export function cache(
return makeHangingPromise( return makeHangingPromise(
workUnitStore.renderSignal, workUnitStore.renderSignal,
workStore.route, workStore.route,
dynamicAccessAbortController.signal.reason.message 'dynamic "use cache"'
) )
} }
break break
...@@ -1562,7 +1545,7 @@ export function cache( ...@@ -1562,7 +1545,7 @@ export function cache(
clientReferenceManifest, clientReferenceManifest,
encodedCacheKeyParts, encodedCacheKeyParts,
fn, fn,
sharedErrorStack timeoutError
) )
if (result.type === 'prerender-dynamic') { if (result.type === 'prerender-dynamic') {
...@@ -1588,10 +1571,7 @@ export function cache( ...@@ -1588,10 +1571,7 @@ export function cache(
} }
if (cacheHandler) { if (cacheHandler) {
const promise = cacheHandler.set( const promise = cacheHandler.set(serializedCacheKey, savedCacheEntry)
serializedCacheKey,
savedCacheEntry
)
workStore.pendingRevalidateWrites ??= [] workStore.pendingRevalidateWrites ??= []
workStore.pendingRevalidateWrites.push(promise) workStore.pendingRevalidateWrites.push(promise)
...@@ -1645,7 +1625,7 @@ export function cache( ...@@ -1645,7 +1625,7 @@ export function cache(
clientReferenceManifest, clientReferenceManifest,
encodedCacheKeyParts, encodedCacheKeyParts,
fn, fn,
sharedErrorStack timeoutError
) )
if (result.type === 'cached') { if (result.type === 'cached') {
...@@ -1706,10 +1686,6 @@ export function cache( ...@@ -1706,10 +1686,6 @@ export function cache(
replayConsoleLogs, replayConsoleLogs,
environmentName: 'Cache', environmentName: 'Cache',
}) })
},
}[name]
return React.cache(cachedFn)
} }
/** /**
......
...@@ -14,7 +14,7 @@ const expectedTimeoutErrorMessage = ...@@ -14,7 +14,7 @@ const expectedTimeoutErrorMessage =
'Filling a cache during prerender timed out, likely because request-specific arguments such as params, searchParams, cookies() or dynamic data were used inside "use cache".' 'Filling a cache during prerender timed out, likely because request-specific arguments such as params, searchParams, cookies() or dynamic data were used inside "use cache".'
describe('use-cache-hanging-inputs', () => { describe('use-cache-hanging-inputs', () => {
const { next, isNextDev, isTurbopack, skipped } = nextTestSetup({ const { next, isNextDev, skipped } = nextTestSetup({
files: __dirname, files: __dirname,
skipDeployment: true, skipDeployment: true,
skipStart: process.env.NEXT_TEST_MODE !== 'dev', skipStart: process.env.NEXT_TEST_MODE !== 'dev',
...@@ -45,9 +45,8 @@ describe('use-cache-hanging-inputs', () => { ...@@ -45,9 +45,8 @@ describe('use-cache-hanging-inputs', () => {
const cliOutput = stripAnsi(next.cliOutput.slice(outputIndex)) const cliOutput = stripAnsi(next.cliOutput.slice(outputIndex))
if (isTurbopack) {
expect(errorSource).toMatchInlineSnapshot(` expect(errorSource).toMatchInlineSnapshot(`
"app/uncached-promise/page.tsx (10:13) @ module evaluation "app/uncached-promise/page.tsx (10:13) @ Foo
8 | } 8 | }
9 | 9 |
...@@ -59,23 +58,7 @@ describe('use-cache-hanging-inputs', () => { ...@@ -59,23 +58,7 @@ describe('use-cache-hanging-inputs', () => {
`) `)
expect(cliOutput).toContain(`Error: ${expectedTimeoutErrorMessage} expect(cliOutput).toContain(`Error: ${expectedTimeoutErrorMessage}
at module evaluation`) at Foo (app/uncached-promise/page.tsx:10:13)`)
} else {
expect(errorSource).toMatchInlineSnapshot(`
"app/uncached-promise/page.tsx (10:13) @ eval
8 | }
9 |
> 10 | const Foo = async ({ promise }) => {
| ^
11 | 'use cache'
12 |
13 | return ("
`)
expect(cliOutput).toContain(`Error: ${expectedTimeoutErrorMessage}
at eval (app/uncached-promise/page.tsx:10:13)`)
}
}, 180_000) }, 180_000)
}) })
...@@ -99,24 +82,8 @@ describe('use-cache-hanging-inputs', () => { ...@@ -99,24 +82,8 @@ describe('use-cache-hanging-inputs', () => {
const cliOutput = stripAnsi(next.cliOutput.slice(outputIndex)) const cliOutput = stripAnsi(next.cliOutput.slice(outputIndex))
if (isTurbopack) {
expect(errorSource).toMatchInlineSnapshot(`
"app/uncached-promise-nested/page.tsx (16:1) @ module evaluation
14 | }
15 |
> 16 | async function indirection(promise: Promise<number>) {
| ^
17 | 'use cache'
18 |
19 | return getCachedData(promise)"
`)
expect(cliOutput).toContain(`Error: ${expectedTimeoutErrorMessage}
at module evaluation`)
} else {
expect(errorSource).toMatchInlineSnapshot(` expect(errorSource).toMatchInlineSnapshot(`
"app/uncached-promise-nested/page.tsx (16:1) @ eval "app/uncached-promise-nested/page.tsx (16:1) @ indirection
14 | } 14 | }
15 | 15 |
...@@ -128,8 +95,8 @@ describe('use-cache-hanging-inputs', () => { ...@@ -128,8 +95,8 @@ describe('use-cache-hanging-inputs', () => {
`) `)
expect(cliOutput).toContain(`Error: ${expectedTimeoutErrorMessage} expect(cliOutput).toContain(`Error: ${expectedTimeoutErrorMessage}
at eval (app/uncached-promise-nested/page.tsx:16:1)`) at indirection (app/uncached-promise-nested/page.tsx:16:1)
} at Page (app/uncached-promise-nested/page.tsx:23:22)`)
}, 180_000) }, 180_000)
}) })
...@@ -154,9 +121,8 @@ describe('use-cache-hanging-inputs', () => { ...@@ -154,9 +121,8 @@ describe('use-cache-hanging-inputs', () => {
expect(errorDescription).toBe(expectedTimeoutErrorMessage) expect(errorDescription).toBe(expectedTimeoutErrorMessage)
if (isTurbopack) {
expect(errorSource).toMatchInlineSnapshot(` expect(errorSource).toMatchInlineSnapshot(`
"app/bound-args/page.tsx (13:15) @ module evaluation "app/bound-args/page.tsx (13:15) @ Foo
11 | const uncachedDataPromise = fetchUncachedData() 11 | const uncachedDataPromise = fetchUncachedData()
12 | 12 |
...@@ -168,23 +134,7 @@ describe('use-cache-hanging-inputs', () => { ...@@ -168,23 +134,7 @@ describe('use-cache-hanging-inputs', () => {
`) `)
expect(cliOutput).toContain(`Error: ${expectedTimeoutErrorMessage} expect(cliOutput).toContain(`Error: ${expectedTimeoutErrorMessage}
at module evaluation`) at Foo (app/bound-args/page.tsx:13:15)`)
} else {
expect(errorSource).toMatchInlineSnapshot(`
"app/bound-args/page.tsx (13:15) @ eval
11 | const uncachedDataPromise = fetchUncachedData()
12 |
> 13 | const Foo = async () => {
| ^
14 | 'use cache'
15 |
16 | return ("
`)
expect(cliOutput).toContain(`Error: ${expectedTimeoutErrorMessage}
at eval (app/bound-args/page.tsx:13:15)`)
}
}, 180_000) }, 180_000)
}) })
......
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