Commit 822dcc7d authored by Hendrik Liebau's avatar Hendrik Liebau Committed by Jiachi Liu

Hoist inner `'use cache'` functions to reduce function allocations (#85904)

This PR fixes a slight performance regression introduced in #85519 where
inline async function expressions were created for each unique set of
arguments passed to a `'use cache'` function.

For a function like this:

```js
export async function getCachedData(id) {
  'use cache';
  return fetch(`/api/data/${id}`);
}
```

we were previously generating (simplified):

```js
export var $$RSC_SERVER_CACHE_0 = cache("default", "0815", 0, async function(id) {
  return fetch(`/api/data/${id}`);
});
```

In #85519, we restructured this to ensure proper stack frames in error
messages (simplified):

```js
export var $$RSC_SERVER_CACHE_0 = React.cache(function getCachedData() {
  return cache("default", "0815", 0, async function(id) {
    return fetch(`/api/data/${id}`);
  }, arguments);
});
```

However, this introduced a small performance issue: the inner async
function expression was passed inline to the cache wrapper. While
`React.cache` memoizes the outer function, each unique set of arguments
would cause a new inner function object to be allocated.

Now we're generating (simplified):

```js
const $$RSC_SERVER_CACHE_0_INNER = async function getCachedData(id) {
  return fetch(`/api/data/${id}`);
};

export var $$RSC_SERVER_CACHE_0 = React.cache(function getCachedData() {
  return cache("default", "0815", 0, $$RSC_SERVER_CACHE_0_INNER, arguments);
});
```

The cache implementation is now hoisted to module scope with an `_INNER`
suffix as a const declaration with a named function expression. The
function name is preserved to ensure proper stack traces in dev. This
eliminates the repeated function allocations while preserving the
improvements from #85519.
parent 499f5e19
...@@ -3,8 +3,7 @@ import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc ...@@ -3,8 +3,7 @@ import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc
export default $$RSC_SERVER_ACTION_0 = ()=>{}; export default $$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"
writable: false
}); });
import { ensureServerEntryExports } from "private-next-rsc-action-validate"; import { ensureServerEntryExports } from "private-next-rsc-action-validate";
ensureServerEntryExports([ ensureServerEntryExports([
......
...@@ -4,14 +4,14 @@ import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; ...@@ -4,14 +4,14 @@ import { cache as $$cache__ } from "private-next-rsc-cache-wrapper";
import { cache as $$reactCache__ } from "react"; 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 = $$reactCache__(function Cached() { const $$RSC_SERVER_CACHE_0_INNER = async function Cached({ children }) {
return $$cache__("default", "c0dd5bb6fef67f5ab84327f5164ac2c3111a159337", 0, async function Cached({ children }) {
return <div className={inter.className}>{children}</div>; return <div className={inter.className}>{children}</div>;
}, arguments); };
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function Cached() {
return $$cache__("default", "c0dd5bb6fef67f5ab84327f5164ac2c3111a159337", 0, $$RSC_SERVER_CACHE_0_INNER, 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", {
value: "Cached", value: "Cached"
writable: false
}); });
export var Cached = $$RSC_SERVER_CACHE_0; export var Cached = $$RSC_SERVER_CACHE_0;
...@@ -2,8 +2,7 @@ ...@@ -2,8 +2,7 @@
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 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
}); });
import { ensureServerEntryExports } from "private-next-rsc-action-validate"; import { ensureServerEntryExports } from "private-next-rsc-action-validate";
ensureServerEntryExports([ ensureServerEntryExports([
......
...@@ -5,8 +5,7 @@ export default $$RSC_SERVER_ACTION_0 = async (a, b)=>{ ...@@ -5,8 +5,7 @@ export default $$RSC_SERVER_ACTION_0 = async (a, b)=>{
}; };
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"
writable: false
}); });
import { ensureServerEntryExports } from "private-next-rsc-action-validate"; import { ensureServerEntryExports } from "private-next-rsc-action-validate";
ensureServerEntryExports([ ensureServerEntryExports([
......
...@@ -5,8 +5,7 @@ export const action = validator(async ()=>{}); ...@@ -5,8 +5,7 @@ export const action = validator(async ()=>{});
export default $$RSC_SERVER_ACTION_0 = validator(async ()=>{}); export default $$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"
writable: false
}); });
import { ensureServerEntryExports } from "private-next-rsc-action-validate"; import { ensureServerEntryExports } from "private-next-rsc-action-validate";
ensureServerEntryExports([ ensureServerEntryExports([
......
...@@ -3,15 +3,15 @@ import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc ...@@ -3,15 +3,15 @@ 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 { cache as $$reactCache__ } from "react"; import { cache as $$reactCache__ } from "react";
const v = 'world'; const v = 'world';
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function fn() { const $$RSC_SERVER_CACHE_0_INNER = async function fn() {
return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, async function fn() {
return 'hello, ' + v; return 'hello, ' + v;
}, arguments); };
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function fn() {
return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, 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: "fn", value: "fn"
writable: false
}); });
var fn = $$RSC_SERVER_CACHE_0; var fn = $$RSC_SERVER_CACHE_0;
export async function Component() { export async function Component() {
......
...@@ -2,53 +2,53 @@ ...@@ -2,53 +2,53 @@
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 { cache as $$reactCache__ } from "react";
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function foo() { const $$RSC_SERVER_CACHE_0_INNER = async function foo() {
return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, async function() {
return 'foo'; return 'foo';
}, arguments); };
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function foo() {
return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, 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
}); });
const foo = $$RSC_SERVER_CACHE_0; const foo = $$RSC_SERVER_CACHE_0;
export { bar }; export { bar };
export var $$RSC_SERVER_CACHE_1 = $$reactCache__(function bar() { const $$RSC_SERVER_CACHE_1_INNER = async function bar() {
return $$cache__("default", "80951c375b4a6a6e89d67b743ec5808127cfde405d", 0, async function bar() {
return 'bar'; return 'bar';
}, arguments); };
export var $$RSC_SERVER_CACHE_1 = $$reactCache__(function bar() {
return $$cache__("default", "80951c375b4a6a6e89d67b743ec5808127cfde405d", 0, $$RSC_SERVER_CACHE_1_INNER, 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", {
value: "bar", value: "bar"
writable: false
}); });
var bar = $$RSC_SERVER_CACHE_1; var bar = $$RSC_SERVER_CACHE_1;
// Should not be wrapped in $$cache__. // Should not be wrapped in $$cache__.
const qux = async function qux() { const qux = async function qux() {
return 'qux'; return 'qux';
}; };
export var $$RSC_SERVER_CACHE_2 = $$reactCache__(function baz() { const $$RSC_SERVER_CACHE_2_INNER = async function baz() {
return $$cache__("default", "8069348c79fce073bae2f70f139565a2fda1c74c74", 0, async function baz() {
return qux() + 'baz'; return qux() + 'baz';
}, arguments); };
export var $$RSC_SERVER_CACHE_2 = $$reactCache__(function baz() {
return $$cache__("default", "8069348c79fce073bae2f70f139565a2fda1c74c74", 0, $$RSC_SERVER_CACHE_2_INNER, 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", {
value: "baz", value: "baz"
writable: false
}); });
const baz = $$RSC_SERVER_CACHE_2; const baz = $$RSC_SERVER_CACHE_2;
export var $$RSC_SERVER_CACHE_3 = $$reactCache__(function quux() { const $$RSC_SERVER_CACHE_3_INNER = async function quux() {
return $$cache__("default", "8012a8d21b6362b4cc8f5b15560525095bc48dba80", 0, async function() {
return 'quux'; return 'quux';
}, arguments); };
export var $$RSC_SERVER_CACHE_3 = $$reactCache__(function quux() {
return $$cache__("default", "8012a8d21b6362b4cc8f5b15560525095bc48dba80", 0, $$RSC_SERVER_CACHE_3_INNER, 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", {
value: "quux", value: "quux"
writable: false
}); });
const quux = $$RSC_SERVER_CACHE_3; const quux = $$RSC_SERVER_CACHE_3;
export { foo, baz }; export { foo, baz };
......
...@@ -2,14 +2,14 @@ ...@@ -2,14 +2,14 @@
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 { cache as $$reactCache__ } from "react";
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function my_fn() { const $$RSC_SERVER_CACHE_0_INNER = async function my_fn() {
return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, async function() {
return 'data'; return 'data';
}, arguments); };
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function my_fn() {
return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, 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: "my_fn", value: "my_fn"
writable: false
}); });
export const my_fn = $$RSC_SERVER_CACHE_0; export const my_fn = $$RSC_SERVER_CACHE_0;
...@@ -2,47 +2,47 @@ ...@@ -2,47 +2,47 @@
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 { cache as $$reactCache__ } from "react";
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function foo() { const $$RSC_SERVER_CACHE_0_INNER = async function foo() {
return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, async function foo() {
return 'data A'; return 'data A';
}, arguments); };
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function foo() {
return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, 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
}); });
export var foo = $$RSC_SERVER_CACHE_0; export var foo = $$RSC_SERVER_CACHE_0;
export var $$RSC_SERVER_CACHE_1 = $$reactCache__(function bar() { const $$RSC_SERVER_CACHE_1_INNER = async function bar() {
return $$cache__("default", "80951c375b4a6a6e89d67b743ec5808127cfde405d", 0, async function bar() {
return 'data B'; return 'data B';
}, arguments); };
export var $$RSC_SERVER_CACHE_1 = $$reactCache__(function bar() {
return $$cache__("default", "80951c375b4a6a6e89d67b743ec5808127cfde405d", 0, $$RSC_SERVER_CACHE_1_INNER, 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", {
value: "bar", value: "bar"
writable: false
}); });
export var bar = $$RSC_SERVER_CACHE_1; export var bar = $$RSC_SERVER_CACHE_1;
export var $$RSC_SERVER_CACHE_2 = $$reactCache__(function Cached() { const $$RSC_SERVER_CACHE_2_INNER = async function Cached({ children }) {
return $$cache__("default", "c069348c79fce073bae2f70f139565a2fda1c74c74", 0, async function Cached({ children }) {
return children; return children;
}, arguments); };
export var $$RSC_SERVER_CACHE_2 = $$reactCache__(function Cached() {
return $$cache__("default", "c069348c79fce073bae2f70f139565a2fda1c74c74", 0, $$RSC_SERVER_CACHE_2_INNER, 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", {
value: "Cached", value: "Cached"
writable: false
}); });
export default $$RSC_SERVER_CACHE_2; export default $$RSC_SERVER_CACHE_2;
export var $$RSC_SERVER_CACHE_3 = $$reactCache__(function baz() { const $$RSC_SERVER_CACHE_3_INNER = async function baz() {
return $$cache__("default", "8012a8d21b6362b4cc8f5b15560525095bc48dba80", 0, async function baz() {
return 'data C'; return 'data C';
}, arguments); };
export var $$RSC_SERVER_CACHE_3 = $$reactCache__(function baz() {
return $$cache__("default", "8012a8d21b6362b4cc8f5b15560525095bc48dba80", 0, $$RSC_SERVER_CACHE_3_INNER, 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", {
value: "baz", value: "baz"
writable: false
}); });
export const baz = $$RSC_SERVER_CACHE_3; export const baz = $$RSC_SERVER_CACHE_3;
...@@ -2,15 +2,15 @@ ...@@ -2,15 +2,15 @@
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 { cache as $$reactCache__ } from "react";
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function fn() { const $$RSC_SERVER_CACHE_0_INNER = async function fn() {
return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, async function fn() {
return 'foo'; return 'foo';
}, arguments); };
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function fn() {
return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, 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: "fn", value: "fn"
writable: false
}); });
var fn = $$RSC_SERVER_CACHE_0; var fn = $$RSC_SERVER_CACHE_0;
async function Component() { async function Component() {
......
...@@ -2,14 +2,14 @@ ...@@ -2,14 +2,14 @@
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 { cache as $$reactCache__ } from "react";
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function foo() { const $$RSC_SERVER_CACHE_0_INNER = async function foo() {
return $$cache__("x", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, async function foo() {
return 'data'; return 'data';
}, arguments); };
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function foo() {
return $$cache__("x", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, 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
}); });
export var foo = $$RSC_SERVER_CACHE_0; export var foo = $$RSC_SERVER_CACHE_0;
...@@ -2,18 +2,18 @@ ...@@ -2,18 +2,18 @@
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 { cache as $$reactCache__ } from "react";
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function fn() { const $$RSC_SERVER_CACHE_0_INNER = async function fn([$$ACTION_ARG_0, $$ACTION_ARG_1]) {
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); };
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function fn() {
return $$cache__("default", "c03128060c414d59f8552e4788b846c0d2b7f74743", 2, $$RSC_SERVER_CACHE_0_INNER, 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", {
value: "fn", value: "fn"
writable: false
}); });
async function Component({ foo }) { async function Component({ foo }) {
const a = 123; const a = 123;
......
...@@ -3,8 +3,7 @@ import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc ...@@ -3,8 +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 { cache as $$reactCache__ } from "react"; import { cache as $$reactCache__ } from "react";
import { Form } from 'components'; import { Form } from 'components';
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function cache() { const $$RSC_SERVER_CACHE_0_INNER = async function cache([$$ACTION_ARG_0, $$ACTION_ARG_1], e) {
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,
...@@ -12,12 +11,13 @@ export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function cache() { ...@@ -12,12 +11,13 @@ export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function cache() {
a: $$ACTION_ARG_1 a: $$ACTION_ARG_1
} }
]; ];
}, arguments); };
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function cache() {
return $$cache__("default", "e03128060c414d59f8552e4788b846c0d2b7f74743", 2, $$RSC_SERVER_CACHE_0_INNER, 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: "cache", value: "cache"
writable: false
}); });
export const $$RSC_SERVER_ACTION_1 = async function action($$ACTION_CLOSURE_BOUND, c) { export const $$RSC_SERVER_ACTION_1 = async function action($$ACTION_CLOSURE_BOUND, c) {
var [$$ACTION_ARG_0, $$ACTION_ARG_1] = await decryptActionBoundArgs("6090b5db271335765a4b0eab01f044b381b5ebd5cd", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0, $$ACTION_ARG_1] = await decryptActionBoundArgs("6090b5db271335765a4b0eab01f044b381b5ebd5cd", $$ACTION_CLOSURE_BOUND);
......
...@@ -10,18 +10,18 @@ export const $$RSC_SERVER_ACTION_0 = async function fn($$ACTION_CLOSURE_BOUND) { ...@@ -10,18 +10,18 @@ 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 = $$reactCache__(function Component() { const $$RSC_SERVER_CACHE_1_INNER = async function Component({ foo }) {
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); };
export var $$RSC_SERVER_CACHE_1 = $$reactCache__(function Component() {
return $$cache__("default", "c0951c375b4a6a6e89d67b743ec5808127cfde405d", 0, $$RSC_SERVER_CACHE_1_INNER, 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", {
value: "Component", value: "Component"
writable: false
}); });
export var Component = $$RSC_SERVER_CACHE_1; export var Component = $$RSC_SERVER_CACHE_1;
...@@ -2,18 +2,18 @@ ...@@ -2,18 +2,18 @@
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 { cache as $$reactCache__ } from "react";
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function fn() { const $$RSC_SERVER_CACHE_0_INNER = async function fn([$$ACTION_ARG_0, $$ACTION_ARG_1]) {
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); };
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function fn() {
return $$cache__("default", "c03128060c414d59f8552e4788b846c0d2b7f74743", 2, $$RSC_SERVER_CACHE_0_INNER, 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", {
value: "fn", value: "fn"
writable: false
}); });
async function Component({ foo }) { async function Component({ foo }) {
const a = 123; const a = 123;
......
...@@ -9,19 +9,19 @@ export const $$RSC_SERVER_ACTION_0 = async function action($$ACTION_CLOSURE_BOUN ...@@ -9,19 +9,19 @@ 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 = $$reactCache__(function getCachedRandom() { const $$RSC_SERVER_CACHE_1_INNER = async function getCachedRandom(x, children) {
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); };
export var $$RSC_SERVER_CACHE_1 = $$reactCache__(function getCachedRandom() {
return $$cache__("default", "e0951c375b4a6a6e89d67b743ec5808127cfde405d", 0, $$RSC_SERVER_CACHE_1_INNER, 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", {
value: "getCachedRandom", value: "getCachedRandom"
writable: false
}); });
var getCachedRandom = $$RSC_SERVER_CACHE_1; var getCachedRandom = $$RSC_SERVER_CACHE_1;
...@@ -8,14 +8,14 @@ function Foo() { ...@@ -8,14 +8,14 @@ function Foo() {
console.log(v); console.log(v);
return v; return v;
} }
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function bar() { const $$RSC_SERVER_CACHE_0_INNER = async function bar() {
return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, async function bar() {
return <Foo/>; return <Foo/>;
}, arguments); };
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function bar() {
return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, 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: "bar", value: "bar"
writable: false
}); });
export var bar = $$RSC_SERVER_CACHE_0; export var bar = $$RSC_SERVER_CACHE_0;
...@@ -4,18 +4,18 @@ ...@@ -4,18 +4,18 @@
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 { cache as $$reactCache__ } from "react";
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function f1() { const $$RSC_SERVER_CACHE_0_INNER = async function f1(a, b) {
return $$cache__("default", "e03128060c414d59f8552e4788b846c0d2b7f74743", 0, async function f1(a, b) {
return [ return [
a, a,
b b
]; ];
}, arguments); };
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function f1() {
return $$cache__("default", "e03128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, 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: "f1", value: "f1"
writable: false
}); });
var f1 = $$RSC_SERVER_CACHE_0; var f1 = $$RSC_SERVER_CACHE_0;
export const // Should be 0 110000 0, which is "60" in hex. export const // Should be 0 110000 0, which is "60" in hex.
...@@ -27,20 +27,20 @@ $$RSC_SERVER_ACTION_1 = async function f2(a, b) { ...@@ -27,20 +27,20 @@ $$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. // Should be 1 111111 1, which is "ff" in hex.
$$RSC_SERVER_CACHE_2 = $$reactCache__(function f3() { const $$RSC_SERVER_CACHE_2_INNER = async function f3(a, b, ...rest) {
return $$cache__("default", "ff69348c79fce073bae2f70f139565a2fda1c74c74", 0, async function f3(a, b, ...rest) {
return [ return [
a, a,
b, b,
rest rest
]; ];
}, arguments); };
export var $$RSC_SERVER_CACHE_2 = $$reactCache__(function f3() {
return $$cache__("default", "ff69348c79fce073bae2f70f139565a2fda1c74c74", 0, $$RSC_SERVER_CACHE_2_INNER, 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", {
value: "f3", value: "f3"
writable: false
}); });
var f3 = $$RSC_SERVER_CACHE_2; var f3 = $$RSC_SERVER_CACHE_2;
export const // Should be 0 111110 0, which is "7c" in hex. export const // Should be 0 111110 0, which is "7c" in hex.
...@@ -68,9 +68,8 @@ $$RSC_SERVER_ACTION_4 = async function f5(a, b, c, d, e, f) { ...@@ -68,9 +68,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. // Should be 1 111111 1, which is "ff" in hex.
$$RSC_SERVER_CACHE_5 = $$reactCache__(function f6() { const $$RSC_SERVER_CACHE_5_INNER = async function f6(a, b, c, d, e, f, g) {
return $$cache__("default", "ff471a5eb0be1c31686dd4ba938a80328b80b1615d", 0, async function f6(a, b, c, d, e, f, g) {
return [ return [
a, a,
b, b,
...@@ -80,11 +79,12 @@ $$RSC_SERVER_CACHE_5 = $$reactCache__(function f6() { ...@@ -80,11 +79,12 @@ $$RSC_SERVER_CACHE_5 = $$reactCache__(function f6() {
f, f,
g g
]; ];
}, arguments); };
export var $$RSC_SERVER_CACHE_5 = $$reactCache__(function f6() {
return $$cache__("default", "ff471a5eb0be1c31686dd4ba938a80328b80b1615d", 0, $$RSC_SERVER_CACHE_5_INNER, 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", {
value: "f6", value: "f6"
writable: false
}); });
var f6 = $$RSC_SERVER_CACHE_5; var f6 = $$RSC_SERVER_CACHE_5;
...@@ -25,18 +25,18 @@ export async function action3(a, b) { ...@@ -25,18 +25,18 @@ export async function action3(a, b) {
{b} {b}
</div>; </div>;
} }
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function cache() { const $$RSC_SERVER_CACHE_0_INNER = async function cache(a, b) {
return $$cache__("default", "e03128060c414d59f8552e4788b846c0d2b7f74743", 0, async function cache(a, b) {
return <div> return <div>
{a} {a}
{b} {b}
</div>; </div>;
}, arguments); };
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function cache() {
return $$cache__("default", "e03128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, 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: "cache", value: "cache"
writable: false
}); });
// Should be 1 110000 0, which is "e0" in hex. // Should be 1 110000 0, which is "e0" in hex.
export var cache = $$RSC_SERVER_CACHE_0; export var cache = $$RSC_SERVER_CACHE_0;
......
...@@ -2,14 +2,18 @@ ...@@ -2,14 +2,18 @@
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 { cache as $$reactCache__ } from "react";
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function() { const $$RSC_SERVER_CACHE_0_INNER = async function(a, b, c) {
return $$cache__("default", "f03128060c414d59f8552e4788b846c0d2b7f74743", 0, async function(a, b, c) {
return <div> return <div>
{a} {a}
{b} {b}
{c} {c}
</div>; </div>;
}, arguments); };
Object["defineProperty"]($$RSC_SERVER_CACHE_0_INNER, "name", {
value: ""
});
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function() {
return $$cache__("default", "f03128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, 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;
...@@ -2,18 +2,21 @@ ...@@ -2,18 +2,21 @@
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 { cache as $$reactCache__ } from "react";
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function() { const $$RSC_SERVER_CACHE_0_INNER = async function(a, b, c) {
return $$cache__("default", "f03128060c414d59f8552e4788b846c0d2b7f74743", 0, async function(a, b, c) {
return <div> return <div>
{a} {a}
{b} {b}
{c} {c}
</div>; </div>;
}, arguments); };
Object["defineProperty"]($$RSC_SERVER_CACHE_0_INNER, "name", {
value: ""
});
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function() {
return $$cache__("default", "f03128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, 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", {
value: "default", value: "default"
writable: false
}); });
export default $$RSC_SERVER_CACHE_0; export default $$RSC_SERVER_CACHE_0;
...@@ -10,8 +10,7 @@ export const $$RSC_SERVER_ACTION_1 = async function $$RSC_SERVER_ACTION_0(a, b, ...@@ -10,8 +10,7 @@ export const $$RSC_SERVER_ACTION_1 = async function $$RSC_SERVER_ACTION_0(a, b,
registerServerReference($$RSC_SERVER_ACTION_1, "7090b5db271335765a4b0eab01f044b381b5ebd5cd", null); registerServerReference($$RSC_SERVER_ACTION_1, "7090b5db271335765a4b0eab01f044b381b5ebd5cd", null);
export default $$RSC_SERVER_ACTION_1; export default $$RSC_SERVER_ACTION_1;
Object["defineProperty"]($$RSC_SERVER_ACTION_0, "name", { Object["defineProperty"]($$RSC_SERVER_ACTION_0, "name", {
value: "default", value: "default"
writable: false
}); });
export const $$RSC_SERVER_ACTION_2 = async function foo(a, b) { export const $$RSC_SERVER_ACTION_2 = async function foo(a, b) {
return <div> return <div>
......
...@@ -3,29 +3,29 @@ import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc ...@@ -3,29 +3,29 @@ 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 { cache as $$reactCache__ } from "react"; import { cache as $$reactCache__ } from "react";
import { Client } from 'components'; import { Client } from 'components';
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function // Should be 1 110000 0, which is "e0" in hex (counts as two params, const $$RSC_SERVER_CACHE_0_INNER = async function // Should be 1 110000 0, which is "e0" in hex (counts as two params,
// because of the encrypted bound args param) // because of the encrypted bound args param)
fn1() { fn1([$$ACTION_ARG_0, $$ACTION_ARG_1], c) {
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); };
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function fn1() {
return $$cache__("default", "e03128060c414d59f8552e4788b846c0d2b7f74743", 2, $$RSC_SERVER_CACHE_0_INNER, 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
}); });
export var $$RSC_SERVER_CACHE_1 = $$reactCache__(function // Should be 1 100000 0, which is "c0" in hex (counts as one param, const $$RSC_SERVER_CACHE_1_INNER = 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() { fn2([$$ACTION_ARG_0, $$ACTION_ARG_1]) {
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); };
export var $$RSC_SERVER_CACHE_1 = $$reactCache__(function fn2() {
return $$cache__("default", "c0951c375b4a6a6e89d67b743ec5808127cfde405d", 2, $$RSC_SERVER_CACHE_1_INNER, 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", {
value: "fn2", value: "fn2"
writable: false
}); });
export const $$RSC_SERVER_ACTION_2 = async function // Should be 0 110000 0, which is "60" in hex (counts as two params, export const $$RSC_SERVER_ACTION_2 = 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)
......
...@@ -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 { 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 { cache as $$reactCache__ } from "react";
const $$RSC_SERVER_CACHE_0_INNER = async function foo() {};
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function foo() { export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function foo() {
return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, async function foo() {}, arguments); return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, 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
}); });
export const $$RSC_SERVER_ACTION_1 = async function bar() {}; export const $$RSC_SERVER_ACTION_1 = async function bar() {};
registerServerReference($$RSC_SERVER_ACTION_1, "0090b5db271335765a4b0eab01f044b381b5ebd5cd", null); registerServerReference($$RSC_SERVER_ACTION_1, "0090b5db271335765a4b0eab01f044b381b5ebd5cd", null);
......
...@@ -2,15 +2,15 @@ ...@@ -2,15 +2,15 @@
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 { cache as $$reactCache__ } from "react";
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function foo() { const $$RSC_SERVER_CACHE_0_INNER = async function foo([$$ACTION_ARG_0, $$ACTION_ARG_1]) {
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); };
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function foo() {
return $$cache__("default", "c03128060c414d59f8552e4788b846c0d2b7f74743", 2, $$RSC_SERVER_CACHE_0_INNER, 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", {
value: "foo", value: "foo"
writable: false
}); });
export const $$RSC_SERVER_ACTION_1 = async function bar($$ACTION_CLOSURE_BOUND) { export const $$RSC_SERVER_ACTION_1 = async function bar($$ACTION_CLOSURE_BOUND) {
var [$$ACTION_ARG_0] = await decryptActionBoundArgs("4090b5db271335765a4b0eab01f044b381b5ebd5cd", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0] = await decryptActionBoundArgs("4090b5db271335765a4b0eab01f044b381b5ebd5cd", $$ACTION_CLOSURE_BOUND);
......
...@@ -2,15 +2,15 @@ ...@@ -2,15 +2,15 @@
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 { cache as $$reactCache__ } from "react";
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function fetch1() { const $$RSC_SERVER_CACHE_0_INNER = async 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); };
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function fetch1() {
return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, 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: "fetch", value: "fetch"
writable: false
}); });
export const api = { export const api = {
product: { product: {
......
...@@ -2,15 +2,15 @@ ...@@ -2,15 +2,15 @@
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 { cache as $$reactCache__ } from "react";
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function foo() { const $$RSC_SERVER_CACHE_0_INNER = async 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); };
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function foo() {
return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, 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
}); });
export const $$RSC_SERVER_ACTION_1 = async function bar() { export const $$RSC_SERVER_ACTION_1 = async function bar() {
console.log(42); console.log(42);
......
...@@ -2,10 +2,14 @@ ...@@ -2,10 +2,14 @@
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 { cache as $$reactCache__ } from "react";
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function() { const $$RSC_SERVER_CACHE_0_INNER = async function([$$ACTION_ARG_0]) {
return $$cache__("default", "c03128060c414d59f8552e4788b846c0d2b7f74743", 1, async function([$$ACTION_ARG_0]) {
return $$ACTION_ARG_0(); return $$ACTION_ARG_0();
}, arguments); };
Object["defineProperty"]($$RSC_SERVER_CACHE_0_INNER, "name", {
value: ""
});
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function() {
return $$cache__("default", "c03128060c414d59f8552e4788b846c0d2b7f74743", 1, $$RSC_SERVER_CACHE_0_INNER, arguments);
}); });
registerServerReference($$RSC_SERVER_CACHE_0, "c03128060c414d59f8552e4788b846c0d2b7f74743", null); registerServerReference($$RSC_SERVER_CACHE_0, "c03128060c414d59f8552e4788b846c0d2b7f74743", null);
function createCachedFn(start) { function createCachedFn(start) {
......
...@@ -12,12 +12,12 @@ export enum E { ...@@ -12,12 +12,12 @@ export enum E {
} }
export default interface D { export default interface D {
} }
const $$RSC_SERVER_CACHE_0_INNER = async function Page() {};
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function Page() { export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function Page() {
return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, async function Page() {}, arguments); return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, 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"
writable: false
}); });
export var Page = $$RSC_SERVER_CACHE_0; export var Page = $$RSC_SERVER_CACHE_0;
...@@ -2,23 +2,23 @@ ...@@ -2,23 +2,23 @@
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 { cache as $$reactCache__ } from "react";
const $$RSC_SERVER_CACHE_0_INNER = async function foo() {};
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function foo() { export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function foo() {
return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, async function() {}, arguments); return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, 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
}); });
const foo = $$RSC_SERVER_CACHE_0; const foo = $$RSC_SERVER_CACHE_0;
export var $$RSC_SERVER_CACHE_1 = $$reactCache__(function bar() { const $$RSC_SERVER_CACHE_1_INNER = async function bar() {
return $$cache__("default", "80951c375b4a6a6e89d67b743ec5808127cfde405d", 0, async function bar() {
return foo(); return foo();
}, arguments); };
export var $$RSC_SERVER_CACHE_1 = $$reactCache__(function bar() {
return $$cache__("default", "80951c375b4a6a6e89d67b743ec5808127cfde405d", 0, $$RSC_SERVER_CACHE_1_INNER, 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", {
value: "bar", value: "bar"
writable: false
}); });
export var bar = $$RSC_SERVER_CACHE_1; export var bar = $$RSC_SERVER_CACHE_1;
{"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"} {"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":";;;;AAEY,MAAA,6BAAA,eAAN,OAEN;WAFY,sCAAA,SAAN;WAAM;;AAAA;;;;AAAZ,MAAM;AAIC,MAAA,6BAAA,eAAe;IACpB,OAAO;AACT;WAFO,sCAAA,SAAe;WAAf;;AAAA;;;;AAAP,WAAsB"}
function createCacheFn() {
return async () => {
'use cache'
throw new Error('kaputt!')
}
}
const cached = createCacheFn()
export default async function Page() {
return <p>A page with an anonymous cache function. {await cached()}</p>
}
import { nextTestSetup } from 'e2e-utils' import { nextTestSetup } from 'e2e-utils'
import { waitForNoRedbox } from '../../../lib/next-test-utils' import { waitForNoRedbox } from '../../../lib/next-test-utils'
const cacheComponentsEnabled = process.env.__NEXT_CACHE_COMPONENTS === 'true'
describe('use-cache-errors', () => { describe('use-cache-errors', () => {
const { next } = nextTestSetup({ const { next, isRspack, isTurbopack } = nextTestSetup({
files: __dirname, files: __dirname,
}) })
const isRspack = Boolean(process.env.NEXT_RSPACK)
it('should not show a false-positive compiler error about a misplaced "use cache" directive', async () => { it('should not show a false-positive compiler error about a misplaced "use cache" directive', async () => {
// This is a regression test to ensure that an injected React Refresh // This is a regression test to ensure that an injected React Refresh
...@@ -50,4 +51,70 @@ describe('use-cache-errors', () => { ...@@ -50,4 +51,70 @@ describe('use-cache-errors', () => {
`) `)
} }
}) })
it('should not leak generated internal cache function names in call stacks', async () => {
const browser = await next.browser('/anonymous')
if (cacheComponentsEnabled) {
if (isTurbopack) {
await expect(browser).toDisplayRedbox(`
{
"description": "kaputt!",
"environmentLabel": "Prerender",
"label": "Runtime Error",
"source": "app/anonymous/page.tsx (4:11) @ <anonymous>
> 4 | throw new Error('kaputt!')
| ^",
"stack": [
"<anonymous> app/anonymous/page.tsx (4:11)",
],
}
`)
} else {
await expect(browser).toDisplayRedbox(`
{
"description": "kaputt!",
"environmentLabel": "Prerender",
"label": "Runtime Error",
"source": "app/anonymous/page.tsx (4:11) @ eval
> 4 | throw new Error('kaputt!')
| ^",
"stack": [
"eval app/anonymous/page.tsx (4:11)",
],
}
`)
}
} else {
if (isTurbopack) {
await expect(browser).toDisplayRedbox(`
{
"description": "kaputt!",
"environmentLabel": "Cache",
"label": "Runtime Error",
"source": "app/anonymous/page.tsx (4:11) @ <anonymous>
> 4 | throw new Error('kaputt!')
| ^",
"stack": [
"<anonymous> app/anonymous/page.tsx (4:11)",
],
}
`)
} else {
await expect(browser).toDisplayRedbox(`
{
"description": "kaputt!",
"environmentLabel": "Cache",
"label": "Runtime Error",
"source": "app/anonymous/page.tsx (4:11) @ eval
> 4 | throw new Error('kaputt!')
| ^",
"stack": [
"eval app/anonymous/page.tsx (4:11)",
],
}
`)
}
}
})
}) })
...@@ -2149,7 +2149,7 @@ describe('Cache Components Errors', () => { ...@@ -2149,7 +2149,7 @@ describe('Cache Components Errors', () => {
} else { } else {
expect(output).toMatchInlineSnapshot(` expect(output).toMatchInlineSnapshot(`
"Error: Route /use-cache-cookies used \`cookies()\` inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \`cookies()\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache "Error: Route /use-cache-cookies used \`cookies()\` inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \`cookies()\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache
at <unknown> (app/use-cache-cookies/page.tsx:22:11) at a (app/use-cache-cookies/page.tsx:22:11)
20 | // in userland. 20 | // in userland.
21 | try { 21 | try {
> 22 | await cookies() > 22 | await cookies()
...@@ -2275,7 +2275,7 @@ describe('Cache Components Errors', () => { ...@@ -2275,7 +2275,7 @@ describe('Cache Components Errors', () => {
if (isTurbopack) { if (isTurbopack) {
expect(output).toMatchInlineSnapshot(` expect(output).toMatchInlineSnapshot(`
"Error: Route /use-cache-draft-mode used "draftMode().enable()" inside "use cache". The enabled status of \`draftMode()\` can be read in caches but you must not enable or disable \`draftMode()\` inside a cache. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache "Error: Route /use-cache-draft-mode used "draftMode().enable()" inside "use cache". The enabled status of \`draftMode()\` can be read in caches but you must not enable or disable \`draftMode()\` inside a cache. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache
at <unknown> (app/use-cache-draft-mode/page.tsx:20:26) at a (app/use-cache-draft-mode/page.tsx:20:26)
18 | // here to ensure that this error is shown even when it's caught in userland. 18 | // here to ensure that this error is shown even when it's caught in userland.
19 | try { 19 | try {
> 20 | ;(await draftMode()).enable() > 20 | ;(await draftMode()).enable()
...@@ -2360,7 +2360,7 @@ describe('Cache Components Errors', () => { ...@@ -2360,7 +2360,7 @@ describe('Cache Components Errors', () => {
} else { } else {
expect(output).toMatchInlineSnapshot(` expect(output).toMatchInlineSnapshot(`
"Error: Route /use-cache-headers used \`headers()\` inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \`headers()\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache "Error: Route /use-cache-headers used \`headers()\` inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \`headers()\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache
at <unknown> (app/use-cache-headers/page.tsx:21:11) at a (app/use-cache-headers/page.tsx:21:11)
19 | // to ensure that this error is shown even when it's caught in userland. 19 | // to ensure that this error is shown even when it's caught in userland.
20 | try { 20 | try {
> 21 | await headers() > 21 | await headers()
......
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