Unverified Commit 94ea1c21 authored by Niklas Mischkulnig's avatar Niklas Mischkulnig Committed by GitHub

next-custom-transforms: Optimize server-reference transform output (#100637)

This will eventually allow better tree shaking

Before:
```js
const $$RSC_SERVER_CACHE_0_INNER = async function cached() {
  return expensive()
}

export var $$RSC_SERVER_CACHE_0 = reactCache(function cached() {
  return cache('default', id, 0, $$RSC_SERVER_CACHE_0_INNER, [])
})

registerServerReference($$RSC_SERVER_CACHE_0, id, null)
Object.defineProperty($$RSC_SERVER_CACHE_0, 'name', { value: 'cached' })
```

After:
```js
const $$RSC_SERVER_CACHE_0_INNER = async function cached() {
  return expensive()
}

export var $$RSC_SERVER_CACHE_0 =
	/*#__PURE__*/Object.defineProperty(
	/*#__PURE__*/registerServerReference(
	/*#__PURE__*/reactCache(function cached() {
		return cache('default', id, 0, $$RSC_SERVER_CACHE_0_INNER, [])
	}), id, null), 'name', { value: 'cached' })
```
parent b6ac0b53
/* __next_internal_action_entry_do_not_use__ [{"006a88810ecce4a4e8b59d53b8327d7e98bbf251d7":{"name":"$$RSC_SERVER_ACTION_0"}},"/app/item.js",""] */ 'use client'; /* __next_internal_action_entry_do_not_use__ [{"006a88810ecce4a4e8b59d53b8327d7e98bbf251d7":{"name":"$$RSC_SERVER_ACTION_0"}},"/app/item.js",""] */ 'use client';
'use strict'; 'use strict';
import { registerServerReference } from "private-next-rsc-server-reference"; import { registerServerReference } from "private-next-rsc-server-reference";
export const $$RSC_SERVER_ACTION_0 = async function action() {}; export const $$RSC_SERVER_ACTION_0 = /*#__PURE__*/ registerServerReference(async function action() {}, "006a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
registerServerReference($$RSC_SERVER_ACTION_0, "006a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
export default function Page() { export default function Page() {
return <form action={$$RSC_SERVER_ACTION_0}/>; return <form action={$$RSC_SERVER_ACTION_0}/>;
} }
import { registerServerReference } from "private-next-rsc-server-reference"; import { registerServerReference } from "private-next-rsc-server-reference";
export const $$RSC_SERVER_ACTION_0 = async function foo() { export const $$RSC_SERVER_ACTION_0 = /*#__PURE__*/ registerServerReference(async function foo() {
'use strict'; 'use strict';
}; }, "006a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
registerServerReference($$RSC_SERVER_ACTION_0, "006a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
/* __next_internal_action_entry_do_not_use__ {"006a88810ecce4a4e8b59d53b8327d7e98bbf251d7":{"name":"$$RSC_SERVER_ACTION_0"}} */ const foo = $$RSC_SERVER_ACTION_0; /* __next_internal_action_entry_do_not_use__ {"006a88810ecce4a4e8b59d53b8327d7e98bbf251d7":{"name":"$$RSC_SERVER_ACTION_0"}} */ const foo = $$RSC_SERVER_ACTION_0;
const bar = async ()=>{ const bar = async ()=>{
const x = 1; const x = 1;
......
...@@ -6,11 +6,9 @@ import inter from '@next/font/google/target.css?{"path":"app/test.tsx","import": ...@@ -6,11 +6,9 @@ import inter from '@next/font/google/target.css?{"path":"app/test.tsx","import":
const $$RSC_SERVER_CACHE_0_INNER = async function Cached({ children }) { const $$RSC_SERVER_CACHE_0_INNER = async function Cached({ children }) {
return <div className={inter.className}>{children}</div>; return <div className={inter.className}>{children}</div>;
}; };
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function Cached() { export var $$RSC_SERVER_CACHE_0 = /*#__PURE__*/ Object["defineProperty"](/*#__PURE__*/ registerServerReference(/*#__PURE__*/ $$reactCache__(function Cached() {
return $$cache__("default", "c0dd5bb6fef67f5ab84327f5164ac2c3111a159337", 0, $$RSC_SERVER_CACHE_0_INNER, Array.prototype.slice.call(arguments, 0, 1)); return $$cache__("default", "c0dd5bb6fef67f5ab84327f5164ac2c3111a159337", 0, $$RSC_SERVER_CACHE_0_INNER, Array.prototype.slice.call(arguments, 0, 1));
}); }), "c0dd5bb6fef67f5ab84327f5164ac2c3111a159337", null), "name", {
registerServerReference($$RSC_SERVER_CACHE_0, "c0dd5bb6fef67f5ab84327f5164ac2c3111a159337", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", {
value: "Cached" value: "Cached"
}); });
export var Cached = $$RSC_SERVER_CACHE_0; export var Cached = $$RSC_SERVER_CACHE_0;
...@@ -35,12 +35,12 @@ declare module 'components' { ...@@ -35,12 +35,12 @@ declare module 'components' {
export function Button( export function Button(
props: { props: {
action: () => Promise<any> action: (...args: any[]) => Promise<any>
} & React.ComponentProps<'button'> } & React.ComponentProps<'button'>
): React.ReactNode ): React.ReactNode
export function Form( export function Form(
props: React.PropsWithChildren<{ action: () => Promise<any> }> props: React.PropsWithChildren<{ action: (...args: any[]) => Promise<any> }>
): React.ReactNode ): React.ReactNode
export function Client(props: Record<string, any>): React.ReactNode export function Client(props: Record<string, any>): React.ReactNode
......
...@@ -2,22 +2,20 @@ import { registerServerReference } from "private-next-rsc-server-reference"; ...@@ -2,22 +2,20 @@ 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";
/* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":{"name":"$$RSC_SERVER_ACTION_0"},"4090b5db271335765a4b0eab01f044b381b5ebd5cd":{"name":"$$RSC_SERVER_ACTION_1"}} */ import { Button } from 'components'; /* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":{"name":"$$RSC_SERVER_ACTION_0"},"4090b5db271335765a4b0eab01f044b381b5ebd5cd":{"name":"$$RSC_SERVER_ACTION_1"}} */ import { Button } from 'components';
import deleteFromDb from 'db'; import deleteFromDb from 'db';
export const $$RSC_SERVER_ACTION_0 = async function deleteItem($$ACTION_CLOSURE_BOUND) { export const $$RSC_SERVER_ACTION_0 = /*#__PURE__*/ registerServerReference(async function deleteItem($$ACTION_CLOSURE_BOUND) {
var [$$ACTION_ARG_0, $$ACTION_ARG_1] = await decryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0, $$ACTION_ARG_1] = await decryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND);
await deleteFromDb($$ACTION_ARG_0); await deleteFromDb($$ACTION_ARG_0);
await deleteFromDb($$ACTION_ARG_1); await deleteFromDb($$ACTION_ARG_1);
}; }, "406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
registerServerReference($$RSC_SERVER_ACTION_0, "406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
export function Item({ id1, id2 }) { export function Item({ id1, id2 }) {
var deleteItem = $$RSC_SERVER_ACTION_0.bind(null, encryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", id1, id2)); var deleteItem = $$RSC_SERVER_ACTION_0.bind(null, encryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", id1, id2));
return <Button action={deleteItem}>Delete</Button>; return <Button action={deleteItem}>Delete</Button>;
} }
export const $$RSC_SERVER_ACTION_1 = async function action($$ACTION_CLOSURE_BOUND) { export const $$RSC_SERVER_ACTION_1 = /*#__PURE__*/ registerServerReference(async function action($$ACTION_CLOSURE_BOUND) {
var [$$ACTION_ARG_0, $$ACTION_ARG_1] = await decryptActionBoundArgs("4090b5db271335765a4b0eab01f044b381b5ebd5cd", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0, $$ACTION_ARG_1] = await decryptActionBoundArgs("4090b5db271335765a4b0eab01f044b381b5ebd5cd", $$ACTION_CLOSURE_BOUND);
console.log($$ACTION_ARG_0); console.log($$ACTION_ARG_0);
console.log($$ACTION_ARG_1); console.log($$ACTION_ARG_1);
}; }, "4090b5db271335765a4b0eab01f044b381b5ebd5cd", null);
registerServerReference($$RSC_SERVER_ACTION_1, "4090b5db271335765a4b0eab01f044b381b5ebd5cd", null);
export default function Home() { export default function Home() {
const info = { const info = {
name: 'John', name: 'John',
......
/* __next_internal_action_entry_do_not_use__ {"00c18c215a6b7cdc64bf709f3a714ffdef1bf9651d":{"name":"default"}} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"00c18c215a6b7cdc64bf709f3a714ffdef1bf9651d":{"name":"default"}} */ import { registerServerReference } from "private-next-rsc-server-reference";
const $$RSC_SERVER_ACTION_0 = async function() {}; const $$RSC_SERVER_ACTION_0 = /*#__PURE__*/ Object["defineProperty"](async function() {}, "name", {
Object["defineProperty"]($$RSC_SERVER_ACTION_0, "name", {
value: "default" value: "default"
}); });
export default $$RSC_SERVER_ACTION_0; export default $$RSC_SERVER_ACTION_0;
......
/* __next_internal_action_entry_do_not_use__ {"60c18c215a6b7cdc64bf709f3a714ffdef1bf9651d":{"name":"default"}} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"60c18c215a6b7cdc64bf709f3a714ffdef1bf9651d":{"name":"default"}} */ import { registerServerReference } from "private-next-rsc-server-reference";
const $$RSC_SERVER_ACTION_0 = async (a, b)=>{ const $$RSC_SERVER_ACTION_0 = /*#__PURE__*/ Object["defineProperty"](async (a, b)=>{
console.log(a, b); console.log(a, b);
}; }, "name", {
Object["defineProperty"]($$RSC_SERVER_ACTION_0, "name", {
value: "default" value: "default"
}); });
export default $$RSC_SERVER_ACTION_0; export default $$RSC_SERVER_ACTION_0;
......
...@@ -3,35 +3,32 @@ import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc ...@@ -3,35 +3,32 @@ import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc
/* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":{"name":"$$RSC_SERVER_ACTION_0"},"7f1c36b06e398c97abe5d5d7ae8c672bfddf4e1b91":{"name":"$$RSC_SERVER_ACTION_2"},"7f90b5db271335765a4b0eab01f044b381b5ebd5cd":{"name":"$$RSC_SERVER_ACTION_1"}} */ import { Button } from 'components'; /* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":{"name":"$$RSC_SERVER_ACTION_0"},"7f1c36b06e398c97abe5d5d7ae8c672bfddf4e1b91":{"name":"$$RSC_SERVER_ACTION_2"},"7f90b5db271335765a4b0eab01f044b381b5ebd5cd":{"name":"$$RSC_SERVER_ACTION_1"}} */ import { Button } from 'components';
import deleteFromDb from 'db'; import deleteFromDb from 'db';
const v1 = 'v1'; const v1 = 'v1';
export const $$RSC_SERVER_ACTION_0 = async function deleteItem($$ACTION_CLOSURE_BOUND) { export const $$RSC_SERVER_ACTION_0 = /*#__PURE__*/ registerServerReference(async function deleteItem($$ACTION_CLOSURE_BOUND) {
var [$$ACTION_ARG_0, $$ACTION_ARG_1] = await decryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0, $$ACTION_ARG_1] = await decryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND);
await deleteFromDb($$ACTION_ARG_0); await deleteFromDb($$ACTION_ARG_0);
await deleteFromDb(v1); await deleteFromDb(v1);
await deleteFromDb($$ACTION_ARG_1); await deleteFromDb($$ACTION_ARG_1);
}; }, "406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
registerServerReference($$RSC_SERVER_ACTION_0, "406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
export function Item({ id1, id2 }) { export function Item({ id1, id2 }) {
const v2 = id2; const v2 = id2;
const deleteItem = $$RSC_SERVER_ACTION_0.bind(null, encryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", id1, v2)); const deleteItem = $$RSC_SERVER_ACTION_0.bind(null, encryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", id1, v2));
return <Button action={deleteItem}>Delete</Button>; return <Button action={deleteItem}>Delete</Button>;
} }
export const $$RSC_SERVER_ACTION_1 = async function g($$ACTION_CLOSURE_BOUND, y, ...z) { export const $$RSC_SERVER_ACTION_1 = /*#__PURE__*/ registerServerReference(async function g($$ACTION_CLOSURE_BOUND, y, ...z) {
var [$$ACTION_ARG_0] = await decryptActionBoundArgs("7f90b5db271335765a4b0eab01f044b381b5ebd5cd", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0] = await decryptActionBoundArgs("7f90b5db271335765a4b0eab01f044b381b5ebd5cd", $$ACTION_CLOSURE_BOUND);
return $$ACTION_ARG_0 + y + z[0]; return $$ACTION_ARG_0 + y + z[0];
}; }, "7f90b5db271335765a4b0eab01f044b381b5ebd5cd", null);
registerServerReference($$RSC_SERVER_ACTION_1, "7f90b5db271335765a4b0eab01f044b381b5ebd5cd", null);
let f = (x)=>{ let f = (x)=>{
var g = $$RSC_SERVER_ACTION_1.bind(null, encryptActionBoundArgs("7f90b5db271335765a4b0eab01f044b381b5ebd5cd", x)); var g = $$RSC_SERVER_ACTION_1.bind(null, encryptActionBoundArgs("7f90b5db271335765a4b0eab01f044b381b5ebd5cd", x));
}; };
export const $$RSC_SERVER_ACTION_2 = async function f($$ACTION_CLOSURE_BOUND, y, ...z) { export const $$RSC_SERVER_ACTION_2 = /*#__PURE__*/ registerServerReference(async function f($$ACTION_CLOSURE_BOUND, y, ...z) {
var [$$ACTION_ARG_0] = await decryptActionBoundArgs("7f1c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0] = await decryptActionBoundArgs("7f1c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", $$ACTION_CLOSURE_BOUND);
return $$ACTION_ARG_0 + y + // can't be a `ts-expect-error` because the type of `z` changes to `any` in the output return $$ACTION_ARG_0 + y + // can't be a `ts-expect-error` because the type of `z` changes to `any` in the output
// and it stops being an error // and it stops being an error
// //
// @ts-ignore: incompatible argument types // @ts-ignore: incompatible argument types
z[0]; z[0];
}; }, "7f1c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", null);
registerServerReference($$RSC_SERVER_ACTION_2, "7f1c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", null);
const g = (x)=>{ const g = (x)=>{
f = $$RSC_SERVER_ACTION_2.bind(null, encryptActionBoundArgs("7f1c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", x)); f = $$RSC_SERVER_ACTION_2.bind(null, encryptActionBoundArgs("7f1c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", x));
}; };
...@@ -3,20 +3,18 @@ import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc ...@@ -3,20 +3,18 @@ import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc
/* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":{"name":"$$RSC_SERVER_ACTION_0"},"4090b5db271335765a4b0eab01f044b381b5ebd5cd":{"name":"$$RSC_SERVER_ACTION_1"}} */ import { Button } from 'components'; /* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":{"name":"$$RSC_SERVER_ACTION_0"},"4090b5db271335765a4b0eab01f044b381b5ebd5cd":{"name":"$$RSC_SERVER_ACTION_1"}} */ import { Button } from 'components';
import deleteFromDb from 'db'; import deleteFromDb from 'db';
const v1 = 'v1'; const v1 = 'v1';
export const $$RSC_SERVER_ACTION_0 = async function action($$ACTION_CLOSURE_BOUND) { export const $$RSC_SERVER_ACTION_0 = /*#__PURE__*/ registerServerReference(async function action($$ACTION_CLOSURE_BOUND) {
var [$$ACTION_ARG_0, $$ACTION_ARG_1] = await decryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0, $$ACTION_ARG_1] = await decryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND);
await deleteFromDb($$ACTION_ARG_0); await deleteFromDb($$ACTION_ARG_0);
await deleteFromDb(v1); await deleteFromDb(v1);
await deleteFromDb($$ACTION_ARG_1); await deleteFromDb($$ACTION_ARG_1);
}; }, "406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
registerServerReference($$RSC_SERVER_ACTION_0, "406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null); export const $$RSC_SERVER_ACTION_1 = /*#__PURE__*/ registerServerReference(async function action($$ACTION_CLOSURE_BOUND) {
export const $$RSC_SERVER_ACTION_1 = async function action($$ACTION_CLOSURE_BOUND) {
var [$$ACTION_ARG_0, $$ACTION_ARG_1] = await decryptActionBoundArgs("4090b5db271335765a4b0eab01f044b381b5ebd5cd", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0, $$ACTION_ARG_1] = await decryptActionBoundArgs("4090b5db271335765a4b0eab01f044b381b5ebd5cd", $$ACTION_CLOSURE_BOUND);
await deleteFromDb($$ACTION_ARG_0); await deleteFromDb($$ACTION_ARG_0);
await deleteFromDb(v1); await deleteFromDb(v1);
await deleteFromDb($$ACTION_ARG_1); await deleteFromDb($$ACTION_ARG_1);
}; }, "4090b5db271335765a4b0eab01f044b381b5ebd5cd", null);
registerServerReference($$RSC_SERVER_ACTION_1, "4090b5db271335765a4b0eab01f044b381b5ebd5cd", null);
export function Item({ id1, id2 }) { export function Item({ id1, id2 }) {
const v2 = id2; const v2 = id2;
return <> return <>
......
import { registerServerReference } from "private-next-rsc-server-reference"; 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";
/* __next_internal_action_entry_do_not_use__ {"606a88810ecce4a4e8b59d53b8327d7e98bbf251d7":{"name":"$$RSC_SERVER_ACTION_0"}} */ import { Button } from 'components'; /* __next_internal_action_entry_do_not_use__ {"606a88810ecce4a4e8b59d53b8327d7e98bbf251d7":{"name":"$$RSC_SERVER_ACTION_0"}} */ import { Button } from 'components';
export const $$RSC_SERVER_ACTION_0 = async function action($$ACTION_CLOSURE_BOUND, value2) { export const $$RSC_SERVER_ACTION_0 = /*#__PURE__*/ registerServerReference(async function action($$ACTION_CLOSURE_BOUND, value2) {
var [$$ACTION_ARG_0] = await decryptActionBoundArgs("606a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0] = await decryptActionBoundArgs("606a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND);
return $$ACTION_ARG_0 * value2; return $$ACTION_ARG_0 * value2;
}; }, "606a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
registerServerReference($$RSC_SERVER_ACTION_0, "606a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
export function Item({ value }) { export function Item({ value }) {
return <> return <>
<Button action={$$RSC_SERVER_ACTION_0.bind(null, encryptActionBoundArgs("606a88810ecce4a4e8b59d53b8327d7e98bbf251d7", value))}> <Button action={$$RSC_SERVER_ACTION_0.bind(null, encryptActionBoundArgs("606a88810ecce4a4e8b59d53b8327d7e98bbf251d7", value))}>
......
import { registerServerReference } from "private-next-rsc-server-reference"; import { registerServerReference } from "private-next-rsc-server-reference";
/* __next_internal_action_entry_do_not_use__ {"0090b5db271335765a4b0eab01f044b381b5ebd5cd":{"name":"$$RSC_SERVER_ACTION_1"},"706a88810ecce4a4e8b59d53b8327d7e98bbf251d7":{"name":"$$RSC_SERVER_ACTION_0"}} */ import { validator } from 'auth'; /* __next_internal_action_entry_do_not_use__ {"0090b5db271335765a4b0eab01f044b381b5ebd5cd":{"name":"$$RSC_SERVER_ACTION_1"},"706a88810ecce4a4e8b59d53b8327d7e98bbf251d7":{"name":"$$RSC_SERVER_ACTION_0"}} */ import { validator } from 'auth';
import { Button } from 'components'; import { Button } from 'components';
export const $$RSC_SERVER_ACTION_0 = async function myAction(a, b, c) { export const $$RSC_SERVER_ACTION_0 = /*#__PURE__*/ registerServerReference(async function myAction(a, b, c) {
console.log('a'); console.log('a');
}; }, "706a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
registerServerReference($$RSC_SERVER_ACTION_0, "706a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
var myAction = $$RSC_SERVER_ACTION_0; var myAction = $$RSC_SERVER_ACTION_0;
export default function Page() { export default function Page() {
return <Button action={myAction}>Delete</Button>; return <Button action={myAction}>Delete</Button>;
} }
export const $$RSC_SERVER_ACTION_1 = async function() {}; export const $$RSC_SERVER_ACTION_1 = /*#__PURE__*/ registerServerReference(async function() {}, "0090b5db271335765a4b0eab01f044b381b5ebd5cd", null);
registerServerReference($$RSC_SERVER_ACTION_1, "0090b5db271335765a4b0eab01f044b381b5ebd5cd", null);
// TODO: should use `action` as function name? // TODO: should use `action` as function name?
export const action = validator($$RSC_SERVER_ACTION_1); export const action = validator($$RSC_SERVER_ACTION_1);
...@@ -3,19 +3,16 @@ import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc ...@@ -3,19 +3,16 @@ import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc
/* __next_internal_action_entry_do_not_use__ {"001c36b06e398c97abe5d5d7ae8c672bfddf4e1b91":{"name":"$$RSC_SERVER_ACTION_2"},"0090b5db271335765a4b0eab01f044b381b5ebd5cd":{"name":"$$RSC_SERVER_ACTION_1"},"606a88810ecce4a4e8b59d53b8327d7e98bbf251d7":{"name":"$$RSC_SERVER_ACTION_0"}} */ import { validator, another } from 'auth'; /* __next_internal_action_entry_do_not_use__ {"001c36b06e398c97abe5d5d7ae8c672bfddf4e1b91":{"name":"$$RSC_SERVER_ACTION_2"},"0090b5db271335765a4b0eab01f044b381b5ebd5cd":{"name":"$$RSC_SERVER_ACTION_1"},"606a88810ecce4a4e8b59d53b8327d7e98bbf251d7":{"name":"$$RSC_SERVER_ACTION_0"}} */ import { validator, another } from 'auth';
import { Button } from 'components'; import { Button } from 'components';
const x = 1; const x = 1;
export const $$RSC_SERVER_ACTION_0 = async function($$ACTION_CLOSURE_BOUND, z) { export const $$RSC_SERVER_ACTION_0 = /*#__PURE__*/ registerServerReference(async function($$ACTION_CLOSURE_BOUND, z) {
var [$$ACTION_ARG_0] = await decryptActionBoundArgs("606a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0] = await decryptActionBoundArgs("606a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND);
return x + $$ACTION_ARG_0 + z; return x + $$ACTION_ARG_0 + z;
}; }, "606a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
registerServerReference($$RSC_SERVER_ACTION_0, "606a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
export default function Page() { export default function Page() {
const y = 1; const y = 1;
return <Button // TODO: should use `action` as function name? return <Button // TODO: should use `action` as function name?
action={validator($$RSC_SERVER_ACTION_0.bind(null, encryptActionBoundArgs("606a88810ecce4a4e8b59d53b8327d7e98bbf251d7", y)))}/>; action={validator($$RSC_SERVER_ACTION_0.bind(null, encryptActionBoundArgs("606a88810ecce4a4e8b59d53b8327d7e98bbf251d7", y)))}/>;
} }
export const $$RSC_SERVER_ACTION_1 = async function() {}; export const $$RSC_SERVER_ACTION_1 = /*#__PURE__*/ registerServerReference(async function() {}, "0090b5db271335765a4b0eab01f044b381b5ebd5cd", null);
registerServerReference($$RSC_SERVER_ACTION_1, "0090b5db271335765a4b0eab01f044b381b5ebd5cd", null);
validator($$RSC_SERVER_ACTION_1); validator($$RSC_SERVER_ACTION_1);
export const $$RSC_SERVER_ACTION_2 = async function() {}; export const $$RSC_SERVER_ACTION_2 = /*#__PURE__*/ registerServerReference(async function() {}, "001c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", null);
registerServerReference($$RSC_SERVER_ACTION_2, "001c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", null);
another(validator($$RSC_SERVER_ACTION_2)); another(validator($$RSC_SERVER_ACTION_2));
import { registerServerReference } from "private-next-rsc-server-reference"; import { registerServerReference } from "private-next-rsc-server-reference";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
export const $$RSC_SERVER_ACTION_0 = async function action($$ACTION_CLOSURE_BOUND, a, b, c, d) { export const $$RSC_SERVER_ACTION_0 = /*#__PURE__*/ registerServerReference(async function action($$ACTION_CLOSURE_BOUND, a, b, c, d) {
var [$$ACTION_ARG_0] = await decryptActionBoundArgs("7c6a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0] = await decryptActionBoundArgs("7c6a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND);
console.log(a, b, $$ACTION_ARG_0, c, d); console.log(a, b, $$ACTION_ARG_0, c, d);
}; }, "7c6a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
registerServerReference($$RSC_SERVER_ACTION_0, "7c6a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null); export const $$RSC_SERVER_ACTION_1 = /*#__PURE__*/ registerServerReference(async function action2($$ACTION_CLOSURE_BOUND, a, b, c, d) {
export const $$RSC_SERVER_ACTION_1 = async function action2($$ACTION_CLOSURE_BOUND, a, b, c, d) {
var [$$ACTION_ARG_0] = await decryptActionBoundArgs("7c90b5db271335765a4b0eab01f044b381b5ebd5cd", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0] = await decryptActionBoundArgs("7c90b5db271335765a4b0eab01f044b381b5ebd5cd", $$ACTION_CLOSURE_BOUND);
console.log(a, b, $$ACTION_ARG_0, c, d); console.log(a, b, $$ACTION_ARG_0, c, d);
}; }, "7c90b5db271335765a4b0eab01f044b381b5ebd5cd", null);
registerServerReference($$RSC_SERVER_ACTION_1, "7c90b5db271335765a4b0eab01f044b381b5ebd5cd", null);
/* __next_internal_action_entry_do_not_use__ {"7c6a88810ecce4a4e8b59d53b8327d7e98bbf251d7":{"name":"$$RSC_SERVER_ACTION_0"},"7c90b5db271335765a4b0eab01f044b381b5ebd5cd":{"name":"$$RSC_SERVER_ACTION_1"}} */ export default function Page({ foo, x, y }) { /* __next_internal_action_entry_do_not_use__ {"7c6a88810ecce4a4e8b59d53b8327d7e98bbf251d7":{"name":"$$RSC_SERVER_ACTION_0"},"7c90b5db271335765a4b0eab01f044b381b5ebd5cd":{"name":"$$RSC_SERVER_ACTION_1"}} */ export default function Page({ foo, x, y }) {
var action = $$RSC_SERVER_ACTION_0.bind(null, encryptActionBoundArgs("7c6a88810ecce4a4e8b59d53b8327d7e98bbf251d7", x)); var action = $$RSC_SERVER_ACTION_0.bind(null, encryptActionBoundArgs("7c6a88810ecce4a4e8b59d53b8327d7e98bbf251d7", x));
action.bind(null, foo[0], foo[1], foo.x, foo[y]); action.bind(null, foo[0], foo[1], foo.x, foo[y]);
......
import { registerServerReference } from "private-next-rsc-server-reference"; import { registerServerReference } from "private-next-rsc-server-reference";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
export const $$RSC_SERVER_ACTION_0 = async function action($$ACTION_CLOSURE_BOUND, a, b, c, { d }) { export const $$RSC_SERVER_ACTION_0 = /*#__PURE__*/ registerServerReference(async function action($$ACTION_CLOSURE_BOUND, a, b, c, { d }) {
var [$$ACTION_ARG_0] = await decryptActionBoundArgs("7c6a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0] = await decryptActionBoundArgs("7c6a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND);
console.log(a, b, $$ACTION_ARG_0, d); console.log(a, b, $$ACTION_ARG_0, d);
}; }, "7c6a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
registerServerReference($$RSC_SERVER_ACTION_0, "7c6a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
/* __next_internal_action_entry_do_not_use__ {"7c6a88810ecce4a4e8b59d53b8327d7e98bbf251d7":{"name":"$$RSC_SERVER_ACTION_0"}} */ export default function Page({ foo, x, y }) { /* __next_internal_action_entry_do_not_use__ {"7c6a88810ecce4a4e8b59d53b8327d7e98bbf251d7":{"name":"$$RSC_SERVER_ACTION_0"}} */ export default function Page({ foo, x, y }) {
var action = $$RSC_SERVER_ACTION_0.bind(null, encryptActionBoundArgs("7c6a88810ecce4a4e8b59d53b8327d7e98bbf251d7", foo)); var action = $$RSC_SERVER_ACTION_0.bind(null, encryptActionBoundArgs("7c6a88810ecce4a4e8b59d53b8327d7e98bbf251d7", foo));
} }
...@@ -2,12 +2,11 @@ import { registerServerReference } from "private-next-rsc-server-reference"; ...@@ -2,12 +2,11 @@ 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";
/* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":{"name":"$$RSC_SERVER_ACTION_0"},"4090b5db271335765a4b0eab01f044b381b5ebd5cd":{"name":"$$RSC_SERVER_ACTION_1"}} */ import { Button } from 'components'; /* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":{"name":"$$RSC_SERVER_ACTION_0"},"4090b5db271335765a4b0eab01f044b381b5ebd5cd":{"name":"$$RSC_SERVER_ACTION_1"}} */ import { Button } from 'components';
import deleteFromDb from 'db'; import deleteFromDb from 'db';
export const $$RSC_SERVER_ACTION_0 = async function deleteItem($$ACTION_CLOSURE_BOUND) { export const $$RSC_SERVER_ACTION_0 = /*#__PURE__*/ registerServerReference(async function deleteItem($$ACTION_CLOSURE_BOUND) {
var [$$ACTION_ARG_0, $$ACTION_ARG_1] = await decryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0, $$ACTION_ARG_1] = await decryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND);
await deleteFromDb($$ACTION_ARG_0); await deleteFromDb($$ACTION_ARG_0);
await deleteFromDb($$ACTION_ARG_1); await deleteFromDb($$ACTION_ARG_1);
}; }, "406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
registerServerReference($$RSC_SERVER_ACTION_0, "406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
export function Item({ id1, id2 }) { export function Item({ id1, id2 }) {
id1++; id1++;
return (()=>{ return (()=>{
...@@ -18,12 +17,11 @@ export function Item({ id1, id2 }) { ...@@ -18,12 +17,11 @@ export function Item({ id1, id2 }) {
} }
export const // FIXME: invalid transformation of hoisted functions (https://github.com/vercel/next.js/issues/57392) export const // FIXME: invalid transformation of hoisted functions (https://github.com/vercel/next.js/issues/57392)
// (remove output.js from `tsconfig.json#exclude` to see the error) // (remove output.js from `tsconfig.json#exclude` to see the error)
$$RSC_SERVER_ACTION_1 = async function deleteItem($$ACTION_CLOSURE_BOUND) { $$RSC_SERVER_ACTION_1 = /*#__PURE__*/ registerServerReference(async function deleteItem($$ACTION_CLOSURE_BOUND) {
var [$$ACTION_ARG_0, $$ACTION_ARG_1] = await decryptActionBoundArgs("4090b5db271335765a4b0eab01f044b381b5ebd5cd", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0, $$ACTION_ARG_1] = await decryptActionBoundArgs("4090b5db271335765a4b0eab01f044b381b5ebd5cd", $$ACTION_CLOSURE_BOUND);
await deleteFromDb($$ACTION_ARG_0); await deleteFromDb($$ACTION_ARG_0);
await deleteFromDb($$ACTION_ARG_1); await deleteFromDb($$ACTION_ARG_1);
}; }, "4090b5db271335765a4b0eab01f044b381b5ebd5cd", null);
registerServerReference($$RSC_SERVER_ACTION_1, "4090b5db271335765a4b0eab01f044b381b5ebd5cd", null);
// In this example, if Button immediately executes the action, different ids should // In this example, if Button immediately executes the action, different ids should
// be passed. // be passed.
export function Item2({ id1, id2 }) { export function Item2({ id1, id2 }) {
......
import { registerServerReference } from "private-next-rsc-server-reference"; import { registerServerReference } from "private-next-rsc-server-reference";
/* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":{"name":"$$RSC_SERVER_ACTION_0"}} */ const noop = (action)=>action; /* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":{"name":"$$RSC_SERVER_ACTION_0"}} */ const noop = (action)=>action;
export const $$RSC_SERVER_ACTION_0 = async function(data) { export const $$RSC_SERVER_ACTION_0 = /*#__PURE__*/ registerServerReference(async function(data) {
console.log(data); console.log(data);
}; }, "406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
registerServerReference($$RSC_SERVER_ACTION_0, "406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
// TODO: should use `log` as function name? // TODO: should use `log` as function name?
export const log = noop($$RSC_SERVER_ACTION_0); export const log = noop($$RSC_SERVER_ACTION_0);
...@@ -2,29 +2,24 @@ ...@@ -2,29 +2,24 @@
// 1. Each exported function should still be exported, but as a reference `registerServerReference(...)`. // 1. Each exported function should still be exported, but as a reference `registerServerReference(...)`.
// 2. Actual action functions should be renamed to `$$ACTION_...` and got exported. // 2. Actual action functions should be renamed to `$$ACTION_...` and got exported.
/* __next_internal_action_entry_do_not_use__ {"001c36b06e398c97abe5d5d7ae8c672bfddf4e1b91":{"name":"$$RSC_SERVER_ACTION_2"},"006a88810ecce4a4e8b59d53b8327d7e98bbf251d7":{"name":"$$RSC_SERVER_ACTION_0"},"0090b5db271335765a4b0eab01f044b381b5ebd5cd":{"name":"$$RSC_SERVER_ACTION_1"},"009ed0cc47abc4e1c64320cf42b74ae60b58c40f00":{"name":"$$RSC_SERVER_ACTION_3"},"00a9b2939c1f39073a6bed227fd20233064c8b7869":{"name":"$$RSC_SERVER_ACTION_4"}} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"001c36b06e398c97abe5d5d7ae8c672bfddf4e1b91":{"name":"$$RSC_SERVER_ACTION_2"},"006a88810ecce4a4e8b59d53b8327d7e98bbf251d7":{"name":"$$RSC_SERVER_ACTION_0"},"0090b5db271335765a4b0eab01f044b381b5ebd5cd":{"name":"$$RSC_SERVER_ACTION_1"},"009ed0cc47abc4e1c64320cf42b74ae60b58c40f00":{"name":"$$RSC_SERVER_ACTION_3"},"00a9b2939c1f39073a6bed227fd20233064c8b7869":{"name":"$$RSC_SERVER_ACTION_4"}} */ import { registerServerReference } from "private-next-rsc-server-reference";
export const $$RSC_SERVER_ACTION_0 = async function foo() { export const $$RSC_SERVER_ACTION_0 = /*#__PURE__*/ registerServerReference(async function foo() {
console.log(1); console.log(1);
}; }, "006a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
registerServerReference($$RSC_SERVER_ACTION_0, "006a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
var foo = $$RSC_SERVER_ACTION_0; var foo = $$RSC_SERVER_ACTION_0;
export { foo }; export { foo };
export const $$RSC_SERVER_ACTION_1 = async function bar() { export const $$RSC_SERVER_ACTION_1 = /*#__PURE__*/ registerServerReference(async function bar() {
console.log(2); console.log(2);
}; }, "0090b5db271335765a4b0eab01f044b381b5ebd5cd", null);
registerServerReference($$RSC_SERVER_ACTION_1, "0090b5db271335765a4b0eab01f044b381b5ebd5cd", null);
export var bar = $$RSC_SERVER_ACTION_1; export var bar = $$RSC_SERVER_ACTION_1;
export const $$RSC_SERVER_ACTION_2 = async function baz() { export const $$RSC_SERVER_ACTION_2 = /*#__PURE__*/ registerServerReference(async function baz() {
console.log(3); console.log(3);
}; }, "001c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", null);
registerServerReference($$RSC_SERVER_ACTION_2, "001c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", null);
export default $$RSC_SERVER_ACTION_2; export default $$RSC_SERVER_ACTION_2;
export const $$RSC_SERVER_ACTION_3 = async function qux() { export const $$RSC_SERVER_ACTION_3 = /*#__PURE__*/ registerServerReference(async function qux() {
console.log(4); console.log(4);
}; }, "009ed0cc47abc4e1c64320cf42b74ae60b58c40f00", null);
registerServerReference($$RSC_SERVER_ACTION_3, "009ed0cc47abc4e1c64320cf42b74ae60b58c40f00", null);
export const qux = $$RSC_SERVER_ACTION_3; export const qux = $$RSC_SERVER_ACTION_3;
export const $$RSC_SERVER_ACTION_4 = async function quuux() { export const $$RSC_SERVER_ACTION_4 = /*#__PURE__*/ registerServerReference(async function quuux() {
console.log(5); console.log(5);
}; }, "00a9b2939c1f39073a6bed227fd20233064c8b7869", null);
registerServerReference($$RSC_SERVER_ACTION_4, "00a9b2939c1f39073a6bed227fd20233064c8b7869", null);
export const quux = $$RSC_SERVER_ACTION_4; export const quux = $$RSC_SERVER_ACTION_4;
...@@ -3,18 +3,16 @@ import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc ...@@ -3,18 +3,16 @@ import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc
/* __next_internal_action_entry_do_not_use__ {"601c36b06e398c97abe5d5d7ae8c672bfddf4e1b91":{"name":"$$RSC_SERVER_ACTION_2"},"606a88810ecce4a4e8b59d53b8327d7e98bbf251d7":{"name":"$$RSC_SERVER_ACTION_0"},"6090b5db271335765a4b0eab01f044b381b5ebd5cd":{"name":"$$RSC_SERVER_ACTION_1"}} */ let a, f; /* __next_internal_action_entry_do_not_use__ {"601c36b06e398c97abe5d5d7ae8c672bfddf4e1b91":{"name":"$$RSC_SERVER_ACTION_2"},"606a88810ecce4a4e8b59d53b8327d7e98bbf251d7":{"name":"$$RSC_SERVER_ACTION_0"},"6090b5db271335765a4b0eab01f044b381b5ebd5cd":{"name":"$$RSC_SERVER_ACTION_1"}} */ let a, f;
export const // FIXME: invalid transformation of hoisted functions (https://github.com/vercel/next.js/issues/57392) export const // FIXME: invalid transformation of hoisted functions (https://github.com/vercel/next.js/issues/57392)
// (remove output.js from `tsconfig.json#exclude` to see the error) // (remove output.js from `tsconfig.json#exclude` to see the error)
$$RSC_SERVER_ACTION_0 = async function action2($$ACTION_CLOSURE_BOUND, e) { $$RSC_SERVER_ACTION_0 = /*#__PURE__*/ registerServerReference(async function action2($$ACTION_CLOSURE_BOUND, e) {
var [$$ACTION_ARG_0, $$ACTION_ARG_1, $$ACTION_ARG_2, $$ACTION_ARG_3] = await decryptActionBoundArgs("606a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0, $$ACTION_ARG_1, $$ACTION_ARG_2, $$ACTION_ARG_3] = await decryptActionBoundArgs("606a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND);
console.log(a, $$ACTION_ARG_0, $$ACTION_ARG_1, e, $$ACTION_ARG_2, $$ACTION_ARG_3); console.log(a, $$ACTION_ARG_0, $$ACTION_ARG_1, e, $$ACTION_ARG_2, $$ACTION_ARG_3);
}; }, "606a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
registerServerReference($$RSC_SERVER_ACTION_0, "606a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null); export const $$RSC_SERVER_ACTION_1 = /*#__PURE__*/ registerServerReference(async function action3($$ACTION_CLOSURE_BOUND, e) {
export const $$RSC_SERVER_ACTION_1 = async function action3($$ACTION_CLOSURE_BOUND, e) {
var [$$ACTION_ARG_0, $$ACTION_ARG_1, $$ACTION_ARG_2] = await decryptActionBoundArgs("6090b5db271335765a4b0eab01f044b381b5ebd5cd", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0, $$ACTION_ARG_1, $$ACTION_ARG_2] = await decryptActionBoundArgs("6090b5db271335765a4b0eab01f044b381b5ebd5cd", $$ACTION_CLOSURE_BOUND);
$$ACTION_ARG_0(e); $$ACTION_ARG_0(e);
console.log(a, $$ACTION_ARG_1, $$ACTION_ARG_2, e); console.log(a, $$ACTION_ARG_1, $$ACTION_ARG_2, e);
}; }, "6090b5db271335765a4b0eab01f044b381b5ebd5cd", null);
registerServerReference($$RSC_SERVER_ACTION_1, "6090b5db271335765a4b0eab01f044b381b5ebd5cd", null); export const $$RSC_SERVER_ACTION_2 = /*#__PURE__*/ registerServerReference(async function action1($$ACTION_CLOSURE_BOUND, d) {
export const $$RSC_SERVER_ACTION_2 = async function action1($$ACTION_CLOSURE_BOUND, d) {
var [$$ACTION_ARG_0, $$ACTION_ARG_1, $$ACTION_ARG_2] = await decryptActionBoundArgs("601c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0, $$ACTION_ARG_1, $$ACTION_ARG_2] = await decryptActionBoundArgs("601c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", $$ACTION_CLOSURE_BOUND);
let f; let f;
// @ts-expect-error: window is not iterable // @ts-expect-error: window is not iterable
...@@ -27,8 +25,7 @@ export const $$RSC_SERVER_ACTION_2 = async function action1($$ACTION_CLOSURE_BOU ...@@ -27,8 +25,7 @@ export const $$RSC_SERVER_ACTION_2 = async function action1($$ACTION_CLOSURE_BOU
action2, action2,
$$RSC_SERVER_ACTION_1.bind(null, encryptActionBoundArgs("6090b5db271335765a4b0eab01f044b381b5ebd5cd", action2, $$ACTION_ARG_1, d)) $$RSC_SERVER_ACTION_1.bind(null, encryptActionBoundArgs("6090b5db271335765a4b0eab01f044b381b5ebd5cd", action2, $$ACTION_ARG_1, d))
]; ];
}; }, "601c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", null);
registerServerReference($$RSC_SERVER_ACTION_2, "601c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", null);
function Comp(b, c, ...g) { function Comp(b, c, ...g) {
return $$RSC_SERVER_ACTION_2.bind(null, encryptActionBoundArgs("601c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", b, c, g)); return $$RSC_SERVER_ACTION_2.bind(null, encryptActionBoundArgs("601c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", b, c, g));
} }
...@@ -3,18 +3,16 @@ import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc ...@@ -3,18 +3,16 @@ import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc
let a, f; let a, f;
export const // FIXME: invalid transformation of hoisted functions (https://github.com/vercel/next.js/issues/57392) export const // FIXME: invalid transformation of hoisted functions (https://github.com/vercel/next.js/issues/57392)
// (remove output.js from `tsconfig.json#exclude` to see the error) // (remove output.js from `tsconfig.json#exclude` to see the error)
$$RSC_SERVER_ACTION_0 = async function action2($$ACTION_CLOSURE_BOUND, e) { $$RSC_SERVER_ACTION_0 = /*#__PURE__*/ registerServerReference(async function action2($$ACTION_CLOSURE_BOUND, e) {
var [$$ACTION_ARG_0, $$ACTION_ARG_1, $$ACTION_ARG_2, $$ACTION_ARG_3] = await decryptActionBoundArgs("606a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0, $$ACTION_ARG_1, $$ACTION_ARG_2, $$ACTION_ARG_3] = await decryptActionBoundArgs("606a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND);
console.log(a, $$ACTION_ARG_0, $$ACTION_ARG_1, e, $$ACTION_ARG_2, $$ACTION_ARG_3); console.log(a, $$ACTION_ARG_0, $$ACTION_ARG_1, e, $$ACTION_ARG_2, $$ACTION_ARG_3);
}; }, "606a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
registerServerReference($$RSC_SERVER_ACTION_0, "606a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null); export const $$RSC_SERVER_ACTION_1 = /*#__PURE__*/ registerServerReference(async function action3($$ACTION_CLOSURE_BOUND, e) {
export const $$RSC_SERVER_ACTION_1 = async function action3($$ACTION_CLOSURE_BOUND, e) {
var [$$ACTION_ARG_0, $$ACTION_ARG_1, $$ACTION_ARG_2] = await decryptActionBoundArgs("6090b5db271335765a4b0eab01f044b381b5ebd5cd", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0, $$ACTION_ARG_1, $$ACTION_ARG_2] = await decryptActionBoundArgs("6090b5db271335765a4b0eab01f044b381b5ebd5cd", $$ACTION_CLOSURE_BOUND);
$$ACTION_ARG_0(e); $$ACTION_ARG_0(e);
console.log(a, $$ACTION_ARG_1, $$ACTION_ARG_2, e); console.log(a, $$ACTION_ARG_1, $$ACTION_ARG_2, e);
}; }, "6090b5db271335765a4b0eab01f044b381b5ebd5cd", null);
registerServerReference($$RSC_SERVER_ACTION_1, "6090b5db271335765a4b0eab01f044b381b5ebd5cd", null); export const $$RSC_SERVER_ACTION_2 = /*#__PURE__*/ registerServerReference(async function action1($$ACTION_CLOSURE_BOUND, d) {
export const $$RSC_SERVER_ACTION_2 = async function action1($$ACTION_CLOSURE_BOUND, d) {
var [$$ACTION_ARG_0, $$ACTION_ARG_1, $$ACTION_ARG_2] = await decryptActionBoundArgs("601c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0, $$ACTION_ARG_1, $$ACTION_ARG_2] = await decryptActionBoundArgs("601c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", $$ACTION_CLOSURE_BOUND);
let f; let f;
// @ts-expect-error: window is not iterable // @ts-expect-error: window is not iterable
...@@ -27,8 +25,7 @@ export const $$RSC_SERVER_ACTION_2 = async function action1($$ACTION_CLOSURE_BOU ...@@ -27,8 +25,7 @@ export const $$RSC_SERVER_ACTION_2 = async function action1($$ACTION_CLOSURE_BOU
action2, action2,
$$RSC_SERVER_ACTION_1.bind(null, encryptActionBoundArgs("6090b5db271335765a4b0eab01f044b381b5ebd5cd", action2, $$ACTION_ARG_1, d)) $$RSC_SERVER_ACTION_1.bind(null, encryptActionBoundArgs("6090b5db271335765a4b0eab01f044b381b5ebd5cd", action2, $$ACTION_ARG_1, d))
]; ];
}; }, "601c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", null);
registerServerReference($$RSC_SERVER_ACTION_2, "601c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", null);
export async function action0(b, c, ...g) { export async function action0(b, c, ...g) {
return $$RSC_SERVER_ACTION_2.bind(null, encryptActionBoundArgs("601c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", b, c, g)); return $$RSC_SERVER_ACTION_2.bind(null, encryptActionBoundArgs("601c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", b, c, g));
} }
......
import { registerServerReference } from "private-next-rsc-server-reference"; import { registerServerReference } from "private-next-rsc-server-reference";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
export const $$RSC_SERVER_ACTION_0 = async function action($$ACTION_CLOSURE_BOUND) { export const $$RSC_SERVER_ACTION_0 = /*#__PURE__*/ registerServerReference(async function action($$ACTION_CLOSURE_BOUND) {
var [$$ACTION_ARG_0, $$ACTION_ARG_1, $$ACTION_ARG_2] = await decryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0, $$ACTION_ARG_1, $$ACTION_ARG_2] = await decryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND);
console.log($$ACTION_ARG_0.at(1), $$ACTION_ARG_1, $$ACTION_ARG_1.current); console.log($$ACTION_ARG_0.at(1), $$ACTION_ARG_1, $$ACTION_ARG_1.current);
console.log($$ACTION_ARG_2.push.call($$ACTION_ARG_2, 5)); console.log($$ACTION_ARG_2.push.call($$ACTION_ARG_2, 5));
}; }, "406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
registerServerReference($$RSC_SERVER_ACTION_0, "406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
/* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":{"name":"$$RSC_SERVER_ACTION_0"}} */ export function Component() { /* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":{"name":"$$RSC_SERVER_ACTION_0"}} */ export function Component() {
const data = [ const data = [
1, 1,
......
...@@ -5,11 +5,9 @@ import { cache as $$reactCache__ } from "react"; ...@@ -5,11 +5,9 @@ import { cache as $$reactCache__ } from "react";
const $$RSC_SERVER_CACHE_0_INNER = async function fn() { const $$RSC_SERVER_CACHE_0_INNER = async function fn() {
return 'hello, ' + v; return 'hello, ' + v;
}; };
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function fn() { export var $$RSC_SERVER_CACHE_0 = /*#__PURE__*/ Object["defineProperty"](/*#__PURE__*/ registerServerReference(/*#__PURE__*/ $$reactCache__(function fn() {
return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, []); return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, []);
}); }), "803128060c414d59f8552e4788b846c0d2b7f74743", null), "name", {
registerServerReference($$RSC_SERVER_CACHE_0, "803128060c414d59f8552e4788b846c0d2b7f74743", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", {
value: "fn" value: "fn"
}); });
var fn = $$RSC_SERVER_CACHE_0; var fn = $$RSC_SERVER_CACHE_0;
......
...@@ -4,11 +4,9 @@ import { cache as $$reactCache__ } from "react"; ...@@ -4,11 +4,9 @@ import { cache as $$reactCache__ } from "react";
const $$RSC_SERVER_CACHE_0_INNER = async function foo() { const $$RSC_SERVER_CACHE_0_INNER = async function foo() {
return 'foo'; return 'foo';
}; };
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function foo() { export var $$RSC_SERVER_CACHE_0 = /*#__PURE__*/ Object["defineProperty"](/*#__PURE__*/ registerServerReference(/*#__PURE__*/ $$reactCache__(function foo() {
return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, []); return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, []);
}); }), "803128060c414d59f8552e4788b846c0d2b7f74743", null), "name", {
registerServerReference($$RSC_SERVER_CACHE_0, "803128060c414d59f8552e4788b846c0d2b7f74743", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", {
value: "foo" value: "foo"
}); });
const foo = $$RSC_SERVER_CACHE_0; const foo = $$RSC_SERVER_CACHE_0;
...@@ -16,11 +14,9 @@ export { bar }; ...@@ -16,11 +14,9 @@ export { bar };
const $$RSC_SERVER_CACHE_1_INNER = async function bar() { const $$RSC_SERVER_CACHE_1_INNER = async function bar() {
return 'bar'; return 'bar';
}; };
export var $$RSC_SERVER_CACHE_1 = $$reactCache__(function bar() { export var $$RSC_SERVER_CACHE_1 = /*#__PURE__*/ Object["defineProperty"](/*#__PURE__*/ registerServerReference(/*#__PURE__*/ $$reactCache__(function bar() {
return $$cache__("default", "80951c375b4a6a6e89d67b743ec5808127cfde405d", 0, $$RSC_SERVER_CACHE_1_INNER, []); return $$cache__("default", "80951c375b4a6a6e89d67b743ec5808127cfde405d", 0, $$RSC_SERVER_CACHE_1_INNER, []);
}); }), "80951c375b4a6a6e89d67b743ec5808127cfde405d", null), "name", {
registerServerReference($$RSC_SERVER_CACHE_1, "80951c375b4a6a6e89d67b743ec5808127cfde405d", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_1, "name", {
value: "bar" value: "bar"
}); });
var bar = $$RSC_SERVER_CACHE_1; var bar = $$RSC_SERVER_CACHE_1;
...@@ -31,22 +27,18 @@ const qux = async function qux() { ...@@ -31,22 +27,18 @@ const qux = async function qux() {
const $$RSC_SERVER_CACHE_2_INNER = async function baz() { const $$RSC_SERVER_CACHE_2_INNER = async function baz() {
return qux() + 'baz'; return qux() + 'baz';
}; };
export var $$RSC_SERVER_CACHE_2 = $$reactCache__(function baz() { export var $$RSC_SERVER_CACHE_2 = /*#__PURE__*/ Object["defineProperty"](/*#__PURE__*/ registerServerReference(/*#__PURE__*/ $$reactCache__(function baz() {
return $$cache__("default", "8069348c79fce073bae2f70f139565a2fda1c74c74", 0, $$RSC_SERVER_CACHE_2_INNER, []); return $$cache__("default", "8069348c79fce073bae2f70f139565a2fda1c74c74", 0, $$RSC_SERVER_CACHE_2_INNER, []);
}); }), "8069348c79fce073bae2f70f139565a2fda1c74c74", null), "name", {
registerServerReference($$RSC_SERVER_CACHE_2, "8069348c79fce073bae2f70f139565a2fda1c74c74", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_2, "name", {
value: "baz" value: "baz"
}); });
const baz = $$RSC_SERVER_CACHE_2; const baz = $$RSC_SERVER_CACHE_2;
const $$RSC_SERVER_CACHE_3_INNER = async function quux() { const $$RSC_SERVER_CACHE_3_INNER = async function quux() {
return 'quux'; return 'quux';
}; };
export var $$RSC_SERVER_CACHE_3 = $$reactCache__(function quux() { export var $$RSC_SERVER_CACHE_3 = /*#__PURE__*/ Object["defineProperty"](/*#__PURE__*/ registerServerReference(/*#__PURE__*/ $$reactCache__(function quux() {
return $$cache__("default", "8012a8d21b6362b4cc8f5b15560525095bc48dba80", 0, $$RSC_SERVER_CACHE_3_INNER, []); return $$cache__("default", "8012a8d21b6362b4cc8f5b15560525095bc48dba80", 0, $$RSC_SERVER_CACHE_3_INNER, []);
}); }), "8012a8d21b6362b4cc8f5b15560525095bc48dba80", null), "name", {
registerServerReference($$RSC_SERVER_CACHE_3, "8012a8d21b6362b4cc8f5b15560525095bc48dba80", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_3, "name", {
value: "quux" value: "quux"
}); });
const quux = $$RSC_SERVER_CACHE_3; const quux = $$RSC_SERVER_CACHE_3;
......
...@@ -4,11 +4,9 @@ import { cache as $$reactCache__ } from "react"; ...@@ -4,11 +4,9 @@ import { cache as $$reactCache__ } from "react";
const $$RSC_SERVER_CACHE_0_INNER = async function my_fn() { const $$RSC_SERVER_CACHE_0_INNER = async function my_fn() {
return 'data'; return 'data';
}; };
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function my_fn() { export var $$RSC_SERVER_CACHE_0 = /*#__PURE__*/ Object["defineProperty"](/*#__PURE__*/ registerServerReference(/*#__PURE__*/ $$reactCache__(function my_fn() {
return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, []); return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, []);
}); }), "803128060c414d59f8552e4788b846c0d2b7f74743", null), "name", {
registerServerReference($$RSC_SERVER_CACHE_0, "803128060c414d59f8552e4788b846c0d2b7f74743", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", {
value: "my_fn" value: "my_fn"
}); });
export const my_fn = $$RSC_SERVER_CACHE_0; export const my_fn = $$RSC_SERVER_CACHE_0;
...@@ -4,44 +4,36 @@ import { cache as $$reactCache__ } from "react"; ...@@ -4,44 +4,36 @@ import { cache as $$reactCache__ } from "react";
const $$RSC_SERVER_CACHE_0_INNER = async function foo() { const $$RSC_SERVER_CACHE_0_INNER = async function foo() {
return 'data A'; return 'data A';
}; };
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function foo() { export var $$RSC_SERVER_CACHE_0 = /*#__PURE__*/ Object["defineProperty"](/*#__PURE__*/ registerServerReference(/*#__PURE__*/ $$reactCache__(function foo() {
return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, []); return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, []);
}); }), "803128060c414d59f8552e4788b846c0d2b7f74743", null), "name", {
registerServerReference($$RSC_SERVER_CACHE_0, "803128060c414d59f8552e4788b846c0d2b7f74743", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", {
value: "foo" value: "foo"
}); });
export var foo = $$RSC_SERVER_CACHE_0; export var foo = $$RSC_SERVER_CACHE_0;
const $$RSC_SERVER_CACHE_1_INNER = async function bar() { const $$RSC_SERVER_CACHE_1_INNER = async function bar() {
return 'data B'; return 'data B';
}; };
export var $$RSC_SERVER_CACHE_1 = $$reactCache__(function bar() { export var $$RSC_SERVER_CACHE_1 = /*#__PURE__*/ Object["defineProperty"](/*#__PURE__*/ registerServerReference(/*#__PURE__*/ $$reactCache__(function bar() {
return $$cache__("default", "80951c375b4a6a6e89d67b743ec5808127cfde405d", 0, $$RSC_SERVER_CACHE_1_INNER, []); return $$cache__("default", "80951c375b4a6a6e89d67b743ec5808127cfde405d", 0, $$RSC_SERVER_CACHE_1_INNER, []);
}); }), "80951c375b4a6a6e89d67b743ec5808127cfde405d", null), "name", {
registerServerReference($$RSC_SERVER_CACHE_1, "80951c375b4a6a6e89d67b743ec5808127cfde405d", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_1, "name", {
value: "bar" value: "bar"
}); });
export var bar = $$RSC_SERVER_CACHE_1; export var bar = $$RSC_SERVER_CACHE_1;
const $$RSC_SERVER_CACHE_2_INNER = async function Cached({ children }) { const $$RSC_SERVER_CACHE_2_INNER = async function Cached({ children }) {
return children; return children;
}; };
export var $$RSC_SERVER_CACHE_2 = $$reactCache__(function Cached() { export var $$RSC_SERVER_CACHE_2 = /*#__PURE__*/ Object["defineProperty"](/*#__PURE__*/ registerServerReference(/*#__PURE__*/ $$reactCache__(function Cached() {
return $$cache__("default", "c069348c79fce073bae2f70f139565a2fda1c74c74", 0, $$RSC_SERVER_CACHE_2_INNER, Array.prototype.slice.call(arguments, 0, 1)); return $$cache__("default", "c069348c79fce073bae2f70f139565a2fda1c74c74", 0, $$RSC_SERVER_CACHE_2_INNER, Array.prototype.slice.call(arguments, 0, 1));
}); }), "c069348c79fce073bae2f70f139565a2fda1c74c74", null), "name", {
registerServerReference($$RSC_SERVER_CACHE_2, "c069348c79fce073bae2f70f139565a2fda1c74c74", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_2, "name", {
value: "Cached" value: "Cached"
}); });
export default $$RSC_SERVER_CACHE_2; export default $$RSC_SERVER_CACHE_2;
const $$RSC_SERVER_CACHE_3_INNER = async function baz() { const $$RSC_SERVER_CACHE_3_INNER = async function baz() {
return 'data C'; return 'data C';
}; };
export var $$RSC_SERVER_CACHE_3 = $$reactCache__(function baz() { export var $$RSC_SERVER_CACHE_3 = /*#__PURE__*/ Object["defineProperty"](/*#__PURE__*/ registerServerReference(/*#__PURE__*/ $$reactCache__(function baz() {
return $$cache__("default", "8012a8d21b6362b4cc8f5b15560525095bc48dba80", 0, $$RSC_SERVER_CACHE_3_INNER, []); return $$cache__("default", "8012a8d21b6362b4cc8f5b15560525095bc48dba80", 0, $$RSC_SERVER_CACHE_3_INNER, []);
}); }), "8012a8d21b6362b4cc8f5b15560525095bc48dba80", null), "name", {
registerServerReference($$RSC_SERVER_CACHE_3, "8012a8d21b6362b4cc8f5b15560525095bc48dba80", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_3, "name", {
value: "baz" value: "baz"
}); });
export const baz = $$RSC_SERVER_CACHE_3; export const baz = $$RSC_SERVER_CACHE_3;
...@@ -4,11 +4,9 @@ import { cache as $$reactCache__ } from "react"; ...@@ -4,11 +4,9 @@ import { cache as $$reactCache__ } from "react";
const $$RSC_SERVER_CACHE_0_INNER = async function fn() { const $$RSC_SERVER_CACHE_0_INNER = async function fn() {
return 'foo'; return 'foo';
}; };
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function fn() { export var $$RSC_SERVER_CACHE_0 = /*#__PURE__*/ Object["defineProperty"](/*#__PURE__*/ registerServerReference(/*#__PURE__*/ $$reactCache__(function fn() {
return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, []); return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, []);
}); }), "803128060c414d59f8552e4788b846c0d2b7f74743", null), "name", {
registerServerReference($$RSC_SERVER_CACHE_0, "803128060c414d59f8552e4788b846c0d2b7f74743", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", {
value: "fn" value: "fn"
}); });
var fn = $$RSC_SERVER_CACHE_0; var fn = $$RSC_SERVER_CACHE_0;
......
...@@ -4,11 +4,9 @@ import { cache as $$reactCache__ } from "react"; ...@@ -4,11 +4,9 @@ import { cache as $$reactCache__ } from "react";
const $$RSC_SERVER_CACHE_0_INNER = async function foo() { const $$RSC_SERVER_CACHE_0_INNER = async function foo() {
return 'data'; return 'data';
}; };
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function foo() { export var $$RSC_SERVER_CACHE_0 = /*#__PURE__*/ Object["defineProperty"](/*#__PURE__*/ registerServerReference(/*#__PURE__*/ $$reactCache__(function foo() {
return $$cache__("x", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, []); return $$cache__("x", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, []);
}); }), "803128060c414d59f8552e4788b846c0d2b7f74743", null), "name", {
registerServerReference($$RSC_SERVER_CACHE_0, "803128060c414d59f8552e4788b846c0d2b7f74743", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", {
value: "foo" value: "foo"
}); });
export var foo = $$RSC_SERVER_CACHE_0; export var foo = $$RSC_SERVER_CACHE_0;
...@@ -8,11 +8,9 @@ const $$RSC_SERVER_CACHE_0_INNER = async function fn([$$ACTION_ARG_0, $$ACTION_A ...@@ -8,11 +8,9 @@ const $$RSC_SERVER_CACHE_0_INNER = async function fn([$$ACTION_ARG_0, $$ACTION_A
foo: $$ACTION_ARG_1 foo: $$ACTION_ARG_1
}; };
}; };
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function fn() { export var $$RSC_SERVER_CACHE_0 = /*#__PURE__*/ Object["defineProperty"](/*#__PURE__*/ registerServerReference(/*#__PURE__*/ $$reactCache__(function fn() {
return $$cache__("default", "c03128060c414d59f8552e4788b846c0d2b7f74743", 2, $$RSC_SERVER_CACHE_0_INNER, Array.prototype.slice.call(arguments, 0, 1)); return $$cache__("default", "c03128060c414d59f8552e4788b846c0d2b7f74743", 2, $$RSC_SERVER_CACHE_0_INNER, Array.prototype.slice.call(arguments, 0, 1));
}); }), "c03128060c414d59f8552e4788b846c0d2b7f74743", null), "name", {
registerServerReference($$RSC_SERVER_CACHE_0, "c03128060c414d59f8552e4788b846c0d2b7f74743", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", {
value: "fn" value: "fn"
}); });
async function Component({ foo }) { async function Component({ foo }) {
......
...@@ -3,8 +3,7 @@ export async function a() {} ...@@ -3,8 +3,7 @@ export async function a() {}
export async function b() {} export async function b() {}
export async function c() {} export async function c() {}
function d() {} function d() {}
export const $$RSC_SERVER_ACTION_0 = async function e() {}; export const $$RSC_SERVER_ACTION_0 = /*#__PURE__*/ registerServerReference(async function e() {}, "006a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
registerServerReference($$RSC_SERVER_ACTION_0, "006a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
function Foo() { function Foo() {
var e = $$RSC_SERVER_ACTION_0; var e = $$RSC_SERVER_ACTION_0;
} }
......
...@@ -12,20 +12,17 @@ const $$RSC_SERVER_CACHE_0_INNER = async function cache([$$ACTION_ARG_0, $$ACTIO ...@@ -12,20 +12,17 @@ const $$RSC_SERVER_CACHE_0_INNER = async function cache([$$ACTION_ARG_0, $$ACTIO
} }
]; ];
}; };
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function cache() { export var $$RSC_SERVER_CACHE_0 = /*#__PURE__*/ Object["defineProperty"](/*#__PURE__*/ registerServerReference(/*#__PURE__*/ $$reactCache__(function cache() {
return $$cache__("default", "e03128060c414d59f8552e4788b846c0d2b7f74743", 2, $$RSC_SERVER_CACHE_0_INNER, Array.prototype.slice.call(arguments, 0, 2)); return $$cache__("default", "e03128060c414d59f8552e4788b846c0d2b7f74743", 2, $$RSC_SERVER_CACHE_0_INNER, Array.prototype.slice.call(arguments, 0, 2));
}); }), "e03128060c414d59f8552e4788b846c0d2b7f74743", null), "name", {
registerServerReference($$RSC_SERVER_CACHE_0, "e03128060c414d59f8552e4788b846c0d2b7f74743", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", {
value: "cache" value: "cache"
}); });
export const $$RSC_SERVER_ACTION_1 = async function action($$ACTION_CLOSURE_BOUND, c) { export const $$RSC_SERVER_ACTION_1 = /*#__PURE__*/ registerServerReference(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);
const d = $$ACTION_ARG_0 + $$ACTION_ARG_1 + c; const d = $$ACTION_ARG_0 + $$ACTION_ARG_1 + c;
var cache = $$RSC_SERVER_CACHE_0.bind(null, encryptActionBoundArgs("e03128060c414d59f8552e4788b846c0d2b7f74743", d, $$ACTION_ARG_0)); var cache = $$RSC_SERVER_CACHE_0.bind(null, encryptActionBoundArgs("e03128060c414d59f8552e4788b846c0d2b7f74743", d, $$ACTION_ARG_0));
return cache(d); return cache(d);
}; }, "6090b5db271335765a4b0eab01f044b381b5ebd5cd", null);
registerServerReference($$RSC_SERVER_ACTION_1, "6090b5db271335765a4b0eab01f044b381b5ebd5cd", null);
async function Component({ a }) { async function Component({ a }) {
const b = 1; const b = 1;
var action = $$RSC_SERVER_ACTION_1.bind(null, encryptActionBoundArgs("6090b5db271335765a4b0eab01f044b381b5ebd5cd", a, b)); var action = $$RSC_SERVER_ACTION_1.bind(null, encryptActionBoundArgs("6090b5db271335765a4b0eab01f044b381b5ebd5cd", a, b));
......
...@@ -2,14 +2,13 @@ ...@@ -2,14 +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";
export const $$RSC_SERVER_ACTION_0 = async function fn($$ACTION_CLOSURE_BOUND) { export const $$RSC_SERVER_ACTION_0 = /*#__PURE__*/ registerServerReference(async function fn($$ACTION_CLOSURE_BOUND) {
var [$$ACTION_ARG_0, $$ACTION_ARG_1] = await decryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0, $$ACTION_ARG_1] = await decryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND);
console.log($$ACTION_ARG_0); console.log($$ACTION_ARG_0);
return { return {
foo: $$ACTION_ARG_1 foo: $$ACTION_ARG_1
}; };
}; }, "406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
registerServerReference($$RSC_SERVER_ACTION_0, "406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
const $$RSC_SERVER_CACHE_1_INNER = async function Component({ foo }) { const $$RSC_SERVER_CACHE_1_INNER = 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));
...@@ -17,11 +16,9 @@ const $$RSC_SERVER_CACHE_1_INNER = async function Component({ foo }) { ...@@ -17,11 +16,9 @@ const $$RSC_SERVER_CACHE_1_INNER = async function Component({ foo }) {
// @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>;
}; };
export var $$RSC_SERVER_CACHE_1 = $$reactCache__(function Component() { export var $$RSC_SERVER_CACHE_1 = /*#__PURE__*/ Object["defineProperty"](/*#__PURE__*/ registerServerReference(/*#__PURE__*/ $$reactCache__(function Component() {
return $$cache__("default", "c0951c375b4a6a6e89d67b743ec5808127cfde405d", 0, $$RSC_SERVER_CACHE_1_INNER, Array.prototype.slice.call(arguments, 0, 1)); return $$cache__("default", "c0951c375b4a6a6e89d67b743ec5808127cfde405d", 0, $$RSC_SERVER_CACHE_1_INNER, Array.prototype.slice.call(arguments, 0, 1));
}); }), "c0951c375b4a6a6e89d67b743ec5808127cfde405d", null), "name", {
registerServerReference($$RSC_SERVER_CACHE_1, "c0951c375b4a6a6e89d67b743ec5808127cfde405d", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_1, "name", {
value: "Component" value: "Component"
}); });
export var Component = $$RSC_SERVER_CACHE_1; export var Component = $$RSC_SERVER_CACHE_1;
...@@ -8,11 +8,9 @@ const $$RSC_SERVER_CACHE_0_INNER = async function fn([$$ACTION_ARG_0, $$ACTION_A ...@@ -8,11 +8,9 @@ const $$RSC_SERVER_CACHE_0_INNER = async function fn([$$ACTION_ARG_0, $$ACTION_A
foo: $$ACTION_ARG_1 foo: $$ACTION_ARG_1
}; };
}; };
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function fn() { export var $$RSC_SERVER_CACHE_0 = /*#__PURE__*/ Object["defineProperty"](/*#__PURE__*/ registerServerReference(/*#__PURE__*/ $$reactCache__(function fn() {
return $$cache__("default", "c03128060c414d59f8552e4788b846c0d2b7f74743", 2, $$RSC_SERVER_CACHE_0_INNER, Array.prototype.slice.call(arguments, 0, 1)); return $$cache__("default", "c03128060c414d59f8552e4788b846c0d2b7f74743", 2, $$RSC_SERVER_CACHE_0_INNER, Array.prototype.slice.call(arguments, 0, 1));
}); }), "c03128060c414d59f8552e4788b846c0d2b7f74743", null), "name", {
registerServerReference($$RSC_SERVER_CACHE_0, "c03128060c414d59f8552e4788b846c0d2b7f74743", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", {
value: "fn" value: "fn"
}); });
async function Component({ foo }) { async function Component({ foo }) {
......
...@@ -4,11 +4,10 @@ import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; ...@@ -4,11 +4,10 @@ import { cache as $$cache__ } from "private-next-rsc-cache-wrapper";
import { cache as $$reactCache__ } from "react"; import { cache as $$reactCache__ } from "react";
/* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":{"name":"$$RSC_SERVER_ACTION_0"},"e0951c375b4a6a6e89d67b743ec5808127cfde405d":{"name":"$$RSC_SERVER_CACHE_1"}} */ import { Button } from 'components'; /* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":{"name":"$$RSC_SERVER_ACTION_0"},"e0951c375b4a6a6e89d67b743ec5808127cfde405d":{"name":"$$RSC_SERVER_CACHE_1"}} */ 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 = /*#__PURE__*/ registerServerReference(async function action($$ACTION_CLOSURE_BOUND) {
var [$$ACTION_ARG_0] = await decryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0] = await decryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND);
console.log(secret, $$ACTION_ARG_0); console.log(secret, $$ACTION_ARG_0);
}; }, "406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
registerServerReference($$RSC_SERVER_ACTION_0, "406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
const $$RSC_SERVER_CACHE_1_INNER = async function getCachedRandom(x, children) { const $$RSC_SERVER_CACHE_1_INNER = async function getCachedRandom(x, children) {
return { return {
x, x,
...@@ -17,11 +16,9 @@ const $$RSC_SERVER_CACHE_1_INNER = async function getCachedRandom(x, children) { ...@@ -17,11 +16,9 @@ const $$RSC_SERVER_CACHE_1_INNER = async function getCachedRandom(x, children) {
r: children r: children
}; };
}; };
export var $$RSC_SERVER_CACHE_1 = $$reactCache__(function getCachedRandom() { export var $$RSC_SERVER_CACHE_1 = /*#__PURE__*/ Object["defineProperty"](/*#__PURE__*/ registerServerReference(/*#__PURE__*/ $$reactCache__(function getCachedRandom() {
return $$cache__("default", "e0951c375b4a6a6e89d67b743ec5808127cfde405d", 0, $$RSC_SERVER_CACHE_1_INNER, Array.prototype.slice.call(arguments, 0, 2)); return $$cache__("default", "e0951c375b4a6a6e89d67b743ec5808127cfde405d", 0, $$RSC_SERVER_CACHE_1_INNER, Array.prototype.slice.call(arguments, 0, 2));
}); }), "e0951c375b4a6a6e89d67b743ec5808127cfde405d", null), "name", {
registerServerReference($$RSC_SERVER_CACHE_1, "e0951c375b4a6a6e89d67b743ec5808127cfde405d", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_1, "name", {
value: "getCachedRandom" value: "getCachedRandom"
}); });
var getCachedRandom = $$RSC_SERVER_CACHE_1; var getCachedRandom = $$RSC_SERVER_CACHE_1;
import { registerServerReference } from "private-next-rsc-server-reference"; import { registerServerReference } from "private-next-rsc-server-reference";
/* __next_internal_action_entry_do_not_use__ {"001c36b06e398c97abe5d5d7ae8c672bfddf4e1b91":{"name":"$$RSC_SERVER_ACTION_2"},"006a88810ecce4a4e8b59d53b8327d7e98bbf251d7":{"name":"$$RSC_SERVER_ACTION_0"},"0090b5db271335765a4b0eab01f044b381b5ebd5cd":{"name":"$$RSC_SERVER_ACTION_1"},"009ed0cc47abc4e1c64320cf42b74ae60b58c40f00":{"name":"$$RSC_SERVER_ACTION_3"},"00a9b2939c1f39073a6bed227fd20233064c8b7869":{"name":"$$RSC_SERVER_ACTION_4"}} */ import { Form } from 'components'; /* __next_internal_action_entry_do_not_use__ {"001c36b06e398c97abe5d5d7ae8c672bfddf4e1b91":{"name":"$$RSC_SERVER_ACTION_2"},"006a88810ecce4a4e8b59d53b8327d7e98bbf251d7":{"name":"$$RSC_SERVER_ACTION_0"},"0090b5db271335765a4b0eab01f044b381b5ebd5cd":{"name":"$$RSC_SERVER_ACTION_1"},"009ed0cc47abc4e1c64320cf42b74ae60b58c40f00":{"name":"$$RSC_SERVER_ACTION_3"},"00a9b2939c1f39073a6bed227fd20233064c8b7869":{"name":"$$RSC_SERVER_ACTION_4"}} */ import { Form } from 'components';
export const $$RSC_SERVER_ACTION_0 = async function foo() { export const $$RSC_SERVER_ACTION_0 = /*#__PURE__*/ registerServerReference(async function foo() {
return 'declarator arrow function expression'; return 'declarator arrow function expression';
}; }, "006a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
registerServerReference($$RSC_SERVER_ACTION_0, "006a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null); export const $$RSC_SERVER_ACTION_1 = /*#__PURE__*/ registerServerReference(async function bar() {
export const $$RSC_SERVER_ACTION_1 = async function bar() {
return 'function declaration'; return 'function declaration';
}; }, "0090b5db271335765a4b0eab01f044b381b5ebd5cd", null);
registerServerReference($$RSC_SERVER_ACTION_1, "0090b5db271335765a4b0eab01f044b381b5ebd5cd", null); export const $$RSC_SERVER_ACTION_2 = /*#__PURE__*/ registerServerReference(async function action() {
export const $$RSC_SERVER_ACTION_2 = async function action() {
return 'arrow function expression'; return 'arrow function expression';
}; }, "001c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", null);
registerServerReference($$RSC_SERVER_ACTION_2, "001c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", null); export const $$RSC_SERVER_ACTION_3 = /*#__PURE__*/ registerServerReference(async function action() {
export const $$RSC_SERVER_ACTION_3 = async function action() {
return 'anonymous function expression'; return 'anonymous function expression';
}; }, "009ed0cc47abc4e1c64320cf42b74ae60b58c40f00", null);
registerServerReference($$RSC_SERVER_ACTION_3, "009ed0cc47abc4e1c64320cf42b74ae60b58c40f00", null); export const $$RSC_SERVER_ACTION_4 = /*#__PURE__*/ registerServerReference(async function baz() {
export const $$RSC_SERVER_ACTION_4 = async function baz() {
return 'named function expression'; return 'named function expression';
}; }, "00a9b2939c1f39073a6bed227fd20233064c8b7869", null);
registerServerReference($$RSC_SERVER_ACTION_4, "00a9b2939c1f39073a6bed227fd20233064c8b7869", null);
export default function Page() { export default function Page() {
const foo = $$RSC_SERVER_ACTION_0; const foo = $$RSC_SERVER_ACTION_0;
var bar = $$RSC_SERVER_ACTION_1; var bar = $$RSC_SERVER_ACTION_1;
......
...@@ -10,11 +10,9 @@ function Foo() { ...@@ -10,11 +10,9 @@ function Foo() {
const $$RSC_SERVER_CACHE_0_INNER = async function bar() { const $$RSC_SERVER_CACHE_0_INNER = async function bar() {
return <Foo/>; return <Foo/>;
}; };
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function bar() { export var $$RSC_SERVER_CACHE_0 = /*#__PURE__*/ Object["defineProperty"](/*#__PURE__*/ registerServerReference(/*#__PURE__*/ $$reactCache__(function bar() {
return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, []); return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, []);
}); }), "803128060c414d59f8552e4788b846c0d2b7f74743", null), "name", {
registerServerReference($$RSC_SERVER_CACHE_0, "803128060c414d59f8552e4788b846c0d2b7f74743", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", {
value: "bar" value: "bar"
}); });
export var bar = $$RSC_SERVER_CACHE_0; export var bar = $$RSC_SERVER_CACHE_0;
...@@ -9,22 +9,19 @@ import { cache as $$reactCache__ } from "react"; ...@@ -9,22 +9,19 @@ import { cache as $$reactCache__ } from "react";
b b
]; ];
}; };
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function f1() { export var $$RSC_SERVER_CACHE_0 = /*#__PURE__*/ Object["defineProperty"](/*#__PURE__*/ registerServerReference(/*#__PURE__*/ $$reactCache__(function f1() {
return $$cache__("default", "e03128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, Array.prototype.slice.call(arguments, 0, 2)); return $$cache__("default", "e03128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, Array.prototype.slice.call(arguments, 0, 2));
}); }), "e03128060c414d59f8552e4788b846c0d2b7f74743", null), "name", {
registerServerReference($$RSC_SERVER_CACHE_0, "e03128060c414d59f8552e4788b846c0d2b7f74743", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", {
value: "f1" value: "f1"
}); });
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.
$$RSC_SERVER_ACTION_1 = async function f2(a, b) { $$RSC_SERVER_ACTION_1 = /*#__PURE__*/ registerServerReference(async function f2(a, b) {
return [ return [
a, a,
b b
]; ];
}; }, "6090b5db271335765a4b0eab01f044b381b5ebd5cd", null);
registerServerReference($$RSC_SERVER_ACTION_1, "6090b5db271335765a4b0eab01f044b381b5ebd5cd", null);
var f2 = $$RSC_SERVER_ACTION_1; var f2 = $$RSC_SERVER_ACTION_1;
// Should be 1 111111 1, which is "ff" in hex. // Should be 1 111111 1, which is "ff" in hex.
const $$RSC_SERVER_CACHE_2_INNER = async function f3(a, b, ...rest) { const $$RSC_SERVER_CACHE_2_INNER = async function f3(a, b, ...rest) {
...@@ -34,16 +31,14 @@ const $$RSC_SERVER_CACHE_2_INNER = async function f3(a, b, ...rest) { ...@@ -34,16 +31,14 @@ const $$RSC_SERVER_CACHE_2_INNER = async function f3(a, b, ...rest) {
rest rest
]; ];
}; };
export var $$RSC_SERVER_CACHE_2 = $$reactCache__(function f3() { export var $$RSC_SERVER_CACHE_2 = /*#__PURE__*/ Object["defineProperty"](/*#__PURE__*/ registerServerReference(/*#__PURE__*/ $$reactCache__(function f3() {
return $$cache__("default", "ff69348c79fce073bae2f70f139565a2fda1c74c74", 0, $$RSC_SERVER_CACHE_2_INNER, Array.prototype.slice.call(arguments)); return $$cache__("default", "ff69348c79fce073bae2f70f139565a2fda1c74c74", 0, $$RSC_SERVER_CACHE_2_INNER, Array.prototype.slice.call(arguments));
}); }), "ff69348c79fce073bae2f70f139565a2fda1c74c74", null), "name", {
registerServerReference($$RSC_SERVER_CACHE_2, "ff69348c79fce073bae2f70f139565a2fda1c74c74", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_2, "name", {
value: "f3" value: "f3"
}); });
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.
$$RSC_SERVER_ACTION_3 = async function f4(a, b, c, d, e) { $$RSC_SERVER_ACTION_3 = /*#__PURE__*/ registerServerReference(async function f4(a, b, c, d, e) {
return [ return [
a, a,
b, b,
...@@ -51,11 +46,10 @@ $$RSC_SERVER_ACTION_3 = async function f4(a, b, c, d, e) { ...@@ -51,11 +46,10 @@ $$RSC_SERVER_ACTION_3 = async function f4(a, b, c, d, e) {
d, d,
e e
]; ];
}; }, "7c9ed0cc47abc4e1c64320cf42b74ae60b58c40f00", null);
registerServerReference($$RSC_SERVER_ACTION_3, "7c9ed0cc47abc4e1c64320cf42b74ae60b58c40f00", null);
var f4 = $$RSC_SERVER_ACTION_3; var f4 = $$RSC_SERVER_ACTION_3;
export const // Should be 0 111111 0, which is "7e" in hex. export const // Should be 0 111111 0, which is "7e" in hex.
$$RSC_SERVER_ACTION_4 = async function f5(a, b, c, d, e, f) { $$RSC_SERVER_ACTION_4 = /*#__PURE__*/ registerServerReference(async function f5(a, b, c, d, e, f) {
return [ return [
a, a,
b, b,
...@@ -64,8 +58,7 @@ $$RSC_SERVER_ACTION_4 = async function f5(a, b, c, d, e, f) { ...@@ -64,8 +58,7 @@ $$RSC_SERVER_ACTION_4 = async function f5(a, b, c, d, e, f) {
e, e,
f f
]; ];
}; }, "7ea9b2939c1f39073a6bed227fd20233064c8b7869", null);
registerServerReference($$RSC_SERVER_ACTION_4, "7ea9b2939c1f39073a6bed227fd20233064c8b7869", null);
var f5 = $$RSC_SERVER_ACTION_4; var f5 = $$RSC_SERVER_ACTION_4;
// Should be 1 111111 1, which is "ff" in hex. // Should be 1 111111 1, which is "ff" in hex.
const $$RSC_SERVER_CACHE_5_INNER = async function f6(a, b, c, d, e, f, g) { const $$RSC_SERVER_CACHE_5_INNER = async function f6(a, b, c, d, e, f, g) {
...@@ -79,11 +72,9 @@ const $$RSC_SERVER_CACHE_5_INNER = async function f6(a, b, c, d, e, f, g) { ...@@ -79,11 +72,9 @@ const $$RSC_SERVER_CACHE_5_INNER = async function f6(a, b, c, d, e, f, g) {
g g
]; ];
}; };
export var $$RSC_SERVER_CACHE_5 = $$reactCache__(function f6() { export var $$RSC_SERVER_CACHE_5 = /*#__PURE__*/ Object["defineProperty"](/*#__PURE__*/ registerServerReference(/*#__PURE__*/ $$reactCache__(function f6() {
return $$cache__("default", "ff471a5eb0be1c31686dd4ba938a80328b80b1615d", 0, $$RSC_SERVER_CACHE_5_INNER, Array.prototype.slice.call(arguments, 0, 7)); return $$cache__("default", "ff471a5eb0be1c31686dd4ba938a80328b80b1615d", 0, $$RSC_SERVER_CACHE_5_INNER, Array.prototype.slice.call(arguments, 0, 7));
}); }), "ff471a5eb0be1c31686dd4ba938a80328b80b1615d", null), "name", {
registerServerReference($$RSC_SERVER_CACHE_5, "ff471a5eb0be1c31686dd4ba938a80328b80b1615d", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_5, "name", {
value: "f6" value: "f6"
}); });
var f6 = $$RSC_SERVER_CACHE_5; var f6 = $$RSC_SERVER_CACHE_5;
import { registerServerReference } from "private-next-rsc-server-reference"; import { registerServerReference } from "private-next-rsc-server-reference";
/* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":{"name":"$$RSC_SERVER_ACTION_0"}} */ import { redirect } from 'navigation'; /* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":{"name":"$$RSC_SERVER_ACTION_0"}} */ import { redirect } from 'navigation';
export const $$RSC_SERVER_ACTION_0 = async function action(formData) { export const $$RSC_SERVER_ACTION_0 = /*#__PURE__*/ registerServerReference(async function action(formData) {
redirect('/header?name=' + formData.get('name') + '&hidden-info=' + formData.get('hidden-info')); redirect('/header?name=' + formData.get('name') + '&hidden-info=' + formData.get('hidden-info'));
}; }, "406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
registerServerReference($$RSC_SERVER_ACTION_0, "406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
var action = $$RSC_SERVER_ACTION_0; var action = $$RSC_SERVER_ACTION_0;
export default function Form() { export default function Form() {
return <form action={action}> return <form action={action}>
......
...@@ -30,11 +30,9 @@ const $$RSC_SERVER_CACHE_0_INNER = async function cache(a, b) { ...@@ -30,11 +30,9 @@ const $$RSC_SERVER_CACHE_0_INNER = async function cache(a, b) {
{b} {b}
</div>; </div>;
}; };
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function cache() { export var $$RSC_SERVER_CACHE_0 = /*#__PURE__*/ Object["defineProperty"](/*#__PURE__*/ registerServerReference(/*#__PURE__*/ $$reactCache__(function cache() {
return $$cache__("default", "e03128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, Array.prototype.slice.call(arguments, 0, 2)); return $$cache__("default", "e03128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, Array.prototype.slice.call(arguments, 0, 2));
}); }), "e03128060c414d59f8552e4788b846c0d2b7f74743", null), "name", {
registerServerReference($$RSC_SERVER_CACHE_0, "e03128060c414d59f8552e4788b846c0d2b7f74743", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", {
value: "cache" value: "cache"
}); });
// Should be 1 110000 0, which is "e0" in hex. // Should be 1 110000 0, which is "e0" in hex.
......
/* __next_internal_action_entry_do_not_use__ {"f03128060c414d59f8552e4788b846c0d2b7f74743":{"name":"$$RSC_SERVER_CACHE_0"}} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"f03128060c414d59f8552e4788b846c0d2b7f74743":{"name":"$$RSC_SERVER_CACHE_0"}} */ import { registerServerReference } from "private-next-rsc-server-reference";
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(a, b, c) { const $$RSC_SERVER_CACHE_0_INNER = /*#__PURE__*/ Object["defineProperty"](async function(a, b, c) {
return <div> return <div>
{a} {a}
{b} {b}
{c} {c}
</div>; </div>;
}; }, "name", {
Object["defineProperty"]($$RSC_SERVER_CACHE_0_INNER, "name", {
value: "" value: ""
}); });
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function() { export var $$RSC_SERVER_CACHE_0 = /*#__PURE__*/ registerServerReference(/*#__PURE__*/ $$reactCache__(function() {
return $$cache__("default", "f03128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, Array.prototype.slice.call(arguments, 0, 3)); return $$cache__("default", "f03128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, Array.prototype.slice.call(arguments, 0, 3));
}); }), "f03128060c414d59f8552e4788b846c0d2b7f74743", null);
registerServerReference($$RSC_SERVER_CACHE_0, "f03128060c414d59f8552e4788b846c0d2b7f74743", null);
export default $$RSC_SERVER_CACHE_0; export default $$RSC_SERVER_CACHE_0;
...@@ -3,7 +3,7 @@ import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc ...@@ -3,7 +3,7 @@ import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc
/* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":{"name":"$$RSC_SERVER_ACTION_0"}} */ import { Button } from 'components'; /* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":{"name":"$$RSC_SERVER_ACTION_0"}} */ import { Button } from 'components';
import deleteFromDb from 'db'; import deleteFromDb from 'db';
const v1 = 'v1'; const v1 = 'v1';
export const $$RSC_SERVER_ACTION_0 = async function deleteItem($$ACTION_CLOSURE_BOUND) { export const $$RSC_SERVER_ACTION_0 = /*#__PURE__*/ registerServerReference(async function deleteItem($$ACTION_CLOSURE_BOUND) {
var [$$ACTION_ARG_0, $$ACTION_ARG_1, $$ACTION_ARG_2, $$ACTION_ARG_3] = await decryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0, $$ACTION_ARG_1, $$ACTION_ARG_2, $$ACTION_ARG_3] = await decryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND);
await deleteFromDb($$ACTION_ARG_0); await deleteFromDb($$ACTION_ARG_0);
await deleteFromDb(v1); await deleteFromDb(v1);
...@@ -12,8 +12,7 @@ export const $$RSC_SERVER_ACTION_0 = async function deleteItem($$ACTION_CLOSURE_ ...@@ -12,8 +12,7 @@ export const $$RSC_SERVER_ACTION_0 = async function deleteItem($$ACTION_CLOSURE_
id3: $$ACTION_ARG_2 id3: $$ACTION_ARG_2
}); });
await deleteFromDb($$ACTION_ARG_3); await deleteFromDb($$ACTION_ARG_3);
}; }, "406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
registerServerReference($$RSC_SERVER_ACTION_0, "406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
export function Item({ id1, id2, id3, id4 }) { export function Item({ id1, id2, id3, id4 }) {
const v2 = id2; const v2 = id2;
var deleteItem = $$RSC_SERVER_ACTION_0.bind(null, encryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", id1, v2, id3, id4.x)); var deleteItem = $$RSC_SERVER_ACTION_0.bind(null, encryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", id1, v2, id3, id4.x));
......
/* __next_internal_action_entry_do_not_use__ {"f03128060c414d59f8552e4788b846c0d2b7f74743":{"name":"$$RSC_SERVER_CACHE_0"}} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"f03128060c414d59f8552e4788b846c0d2b7f74743":{"name":"$$RSC_SERVER_CACHE_0"}} */ import { registerServerReference } from "private-next-rsc-server-reference";
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(a, b, c) { const $$RSC_SERVER_CACHE_0_INNER = /*#__PURE__*/ Object["defineProperty"](async function(a, b, c) {
return <div> return <div>
{a} {a}
{b} {b}
{c} {c}
</div>; </div>;
}; }, "name", {
Object["defineProperty"]($$RSC_SERVER_CACHE_0_INNER, "name", {
value: "" value: ""
}); });
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function() { export var $$RSC_SERVER_CACHE_0 = /*#__PURE__*/ Object["defineProperty"](/*#__PURE__*/ registerServerReference(/*#__PURE__*/ $$reactCache__(function() {
return $$cache__("default", "f03128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, Array.prototype.slice.call(arguments, 0, 3)); return $$cache__("default", "f03128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, Array.prototype.slice.call(arguments, 0, 3));
}); }), "f03128060c414d59f8552e4788b846c0d2b7f74743", null), "name", {
registerServerReference($$RSC_SERVER_CACHE_0, "f03128060c414d59f8552e4788b846c0d2b7f74743", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", {
value: "default" value: "default"
}); });
export default $$RSC_SERVER_CACHE_0; export default $$RSC_SERVER_CACHE_0;
/* __next_internal_action_entry_do_not_use__ {"601c36b06e398c97abe5d5d7ae8c672bfddf4e1b91":{"name":"$$RSC_SERVER_ACTION_2"},"6090b5db271335765a4b0eab01f044b381b5ebd5cd":{"name":"$$RSC_SERVER_ACTION_1"},"706a88810ecce4a4e8b59d53b8327d7e98bbf251d7":{"name":"$$RSC_SERVER_ACTION_0"}} */ import { registerServerReference } from "private-next-rsc-server-reference"; /* __next_internal_action_entry_do_not_use__ {"601c36b06e398c97abe5d5d7ae8c672bfddf4e1b91":{"name":"$$RSC_SERVER_ACTION_2"},"6090b5db271335765a4b0eab01f044b381b5ebd5cd":{"name":"$$RSC_SERVER_ACTION_1"},"706a88810ecce4a4e8b59d53b8327d7e98bbf251d7":{"name":"$$RSC_SERVER_ACTION_0"}} */ import { registerServerReference } from "private-next-rsc-server-reference";
export const $$RSC_SERVER_ACTION_0 = async function(a, b, c) { export const $$RSC_SERVER_ACTION_0 = /*#__PURE__*/ registerServerReference(async function(a, b, c) {
return <div> return <div>
{a} {a}
{b} {b}
{c} {c}
</div>; </div>;
}; }, "706a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
registerServerReference($$RSC_SERVER_ACTION_0, "706a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
export default $$RSC_SERVER_ACTION_0; export default $$RSC_SERVER_ACTION_0;
export const $$RSC_SERVER_ACTION_1 = async function foo(a, b) { export const $$RSC_SERVER_ACTION_1 = /*#__PURE__*/ registerServerReference(async function foo(a, b) {
return <div> return <div>
{a} {a}
{b} {b}
</div>; </div>;
}; }, "6090b5db271335765a4b0eab01f044b381b5ebd5cd", null);
registerServerReference($$RSC_SERVER_ACTION_1, "6090b5db271335765a4b0eab01f044b381b5ebd5cd", null);
export var foo = $$RSC_SERVER_ACTION_1; export var foo = $$RSC_SERVER_ACTION_1;
export const $$RSC_SERVER_ACTION_2 = async function bar(a, b) { export const $$RSC_SERVER_ACTION_2 = /*#__PURE__*/ registerServerReference(async function bar(a, b) {
return <div> return <div>
{a} {a}
{b} {b}
</div>; </div>;
}; }, "601c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", null);
registerServerReference($$RSC_SERVER_ACTION_2, "601c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", null);
export const bar = $$RSC_SERVER_ACTION_2; export const bar = $$RSC_SERVER_ACTION_2;
...@@ -8,11 +8,9 @@ const $$RSC_SERVER_CACHE_0_INNER = async function // Should be 1 110000 0, which ...@@ -8,11 +8,9 @@ const $$RSC_SERVER_CACHE_0_INNER = async function // Should be 1 110000 0, which
fn1([$$ACTION_ARG_0, $$ACTION_ARG_1], c) { fn1([$$ACTION_ARG_0, $$ACTION_ARG_1], c) {
return $$ACTION_ARG_0 + $$ACTION_ARG_1 + c; return $$ACTION_ARG_0 + $$ACTION_ARG_1 + c;
}; };
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function fn1() { export var $$RSC_SERVER_CACHE_0 = /*#__PURE__*/ Object["defineProperty"](/*#__PURE__*/ registerServerReference(/*#__PURE__*/ $$reactCache__(function fn1() {
return $$cache__("default", "e03128060c414d59f8552e4788b846c0d2b7f74743", 2, $$RSC_SERVER_CACHE_0_INNER, Array.prototype.slice.call(arguments, 0, 2)); return $$cache__("default", "e03128060c414d59f8552e4788b846c0d2b7f74743", 2, $$RSC_SERVER_CACHE_0_INNER, Array.prototype.slice.call(arguments, 0, 2));
}); }), "e03128060c414d59f8552e4788b846c0d2b7f74743", null), "name", {
registerServerReference($$RSC_SERVER_CACHE_0, "e03128060c414d59f8552e4788b846c0d2b7f74743", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", {
value: "fn1" value: "fn1"
}); });
const $$RSC_SERVER_CACHE_1_INNER = async 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,
...@@ -20,27 +18,23 @@ const $$RSC_SERVER_CACHE_1_INNER = async function // Should be 1 100000 0, which ...@@ -20,27 +18,23 @@ const $$RSC_SERVER_CACHE_1_INNER = async function // Should be 1 100000 0, which
fn2([$$ACTION_ARG_0, $$ACTION_ARG_1]) { fn2([$$ACTION_ARG_0, $$ACTION_ARG_1]) {
return $$ACTION_ARG_0 + $$ACTION_ARG_1; return $$ACTION_ARG_0 + $$ACTION_ARG_1;
}; };
export var $$RSC_SERVER_CACHE_1 = $$reactCache__(function fn2() { export var $$RSC_SERVER_CACHE_1 = /*#__PURE__*/ Object["defineProperty"](/*#__PURE__*/ registerServerReference(/*#__PURE__*/ $$reactCache__(function fn2() {
return $$cache__("default", "c0951c375b4a6a6e89d67b743ec5808127cfde405d", 2, $$RSC_SERVER_CACHE_1_INNER, Array.prototype.slice.call(arguments, 0, 1)); return $$cache__("default", "c0951c375b4a6a6e89d67b743ec5808127cfde405d", 2, $$RSC_SERVER_CACHE_1_INNER, Array.prototype.slice.call(arguments, 0, 1));
}); }), "c0951c375b4a6a6e89d67b743ec5808127cfde405d", null), "name", {
registerServerReference($$RSC_SERVER_CACHE_1, "c0951c375b4a6a6e89d67b743ec5808127cfde405d", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_1, "name", {
value: "fn2" value: "fn2"
}); });
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 = /*#__PURE__*/ registerServerReference(async function // Should be 0 110000 0, which is "60" in hex (counts as two params,
// because of the encrypted bound args param) // because of the encrypted bound args param)
fn3($$ACTION_CLOSURE_BOUND, c) { fn3($$ACTION_CLOSURE_BOUND, c) {
var [$$ACTION_ARG_0, $$ACTION_ARG_1] = await decryptActionBoundArgs("601c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0, $$ACTION_ARG_1] = await decryptActionBoundArgs("601c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", $$ACTION_CLOSURE_BOUND);
return $$ACTION_ARG_0 + $$ACTION_ARG_1 + c; return $$ACTION_ARG_0 + $$ACTION_ARG_1 + c;
}; }, "601c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", null);
registerServerReference($$RSC_SERVER_ACTION_2, "601c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", null); export const $$RSC_SERVER_ACTION_3 = /*#__PURE__*/ registerServerReference(async function // Should be 0 100000 0, which is "40" in hex (counts as one param,
export const $$RSC_SERVER_ACTION_3 = async function // Should be 0 100000 0, which is "40" in hex (counts as one param,
// because of the encrypted bound args param) // because of the encrypted bound args param)
fn4($$ACTION_CLOSURE_BOUND) { fn4($$ACTION_CLOSURE_BOUND) {
var [$$ACTION_ARG_0, $$ACTION_ARG_1] = await decryptActionBoundArgs("409ed0cc47abc4e1c64320cf42b74ae60b58c40f00", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0, $$ACTION_ARG_1] = await decryptActionBoundArgs("409ed0cc47abc4e1c64320cf42b74ae60b58c40f00", $$ACTION_CLOSURE_BOUND);
return $$ACTION_ARG_0 + $$ACTION_ARG_1; return $$ACTION_ARG_0 + $$ACTION_ARG_1;
}; }, "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 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))}/>; 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))}/>;
......
...@@ -2,15 +2,12 @@ import { registerServerReference } from "private-next-rsc-server-reference"; ...@@ -2,15 +2,12 @@ import { registerServerReference } from "private-next-rsc-server-reference";
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() {}; const $$RSC_SERVER_CACHE_0_INNER = async function foo() {};
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function foo() { export var $$RSC_SERVER_CACHE_0 = /*#__PURE__*/ Object["defineProperty"](/*#__PURE__*/ registerServerReference(/*#__PURE__*/ $$reactCache__(function foo() {
return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, []); return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, []);
}); }), "803128060c414d59f8552e4788b846c0d2b7f74743", null), "name", {
registerServerReference($$RSC_SERVER_CACHE_0, "803128060c414d59f8552e4788b846c0d2b7f74743", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", {
value: "foo" value: "foo"
}); });
export const $$RSC_SERVER_ACTION_1 = async function bar() {}; export const $$RSC_SERVER_ACTION_1 = /*#__PURE__*/ registerServerReference(async function bar() {}, "0090b5db271335765a4b0eab01f044b381b5ebd5cd", null);
registerServerReference($$RSC_SERVER_ACTION_1, "0090b5db271335765a4b0eab01f044b381b5ebd5cd", null);
/* __next_internal_action_entry_do_not_use__ {"0090b5db271335765a4b0eab01f044b381b5ebd5cd":{"name":"$$RSC_SERVER_ACTION_1"},"803128060c414d59f8552e4788b846c0d2b7f74743":{"name":"$$RSC_SERVER_CACHE_0"}} */ export const obj = { /* __next_internal_action_entry_do_not_use__ {"0090b5db271335765a4b0eab01f044b381b5ebd5cd":{"name":"$$RSC_SERVER_ACTION_1"},"803128060c414d59f8552e4788b846c0d2b7f74743":{"name":"$$RSC_SERVER_CACHE_0"}} */ export const obj = {
foo: $$RSC_SERVER_CACHE_0, foo: $$RSC_SERVER_CACHE_0,
bar: $$RSC_SERVER_ACTION_1 bar: $$RSC_SERVER_ACTION_1
......
...@@ -5,18 +5,15 @@ import { cache as $$reactCache__ } from "react"; ...@@ -5,18 +5,15 @@ import { cache as $$reactCache__ } from "react";
const $$RSC_SERVER_CACHE_0_INNER = async function foo([$$ACTION_ARG_0, $$ACTION_ARG_1]) { const $$RSC_SERVER_CACHE_0_INNER = async function foo([$$ACTION_ARG_0, $$ACTION_ARG_1]) {
return $$ACTION_ARG_0 * $$ACTION_ARG_1; return $$ACTION_ARG_0 * $$ACTION_ARG_1;
}; };
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function foo() { export var $$RSC_SERVER_CACHE_0 = /*#__PURE__*/ Object["defineProperty"](/*#__PURE__*/ registerServerReference(/*#__PURE__*/ $$reactCache__(function foo() {
return $$cache__("default", "c03128060c414d59f8552e4788b846c0d2b7f74743", 2, $$RSC_SERVER_CACHE_0_INNER, Array.prototype.slice.call(arguments, 0, 1)); return $$cache__("default", "c03128060c414d59f8552e4788b846c0d2b7f74743", 2, $$RSC_SERVER_CACHE_0_INNER, Array.prototype.slice.call(arguments, 0, 1));
}); }), "c03128060c414d59f8552e4788b846c0d2b7f74743", null), "name", {
registerServerReference($$RSC_SERVER_CACHE_0, "c03128060c414d59f8552e4788b846c0d2b7f74743", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", {
value: "foo" value: "foo"
}); });
export const $$RSC_SERVER_ACTION_1 = async function bar($$ACTION_CLOSURE_BOUND) { export const $$RSC_SERVER_ACTION_1 = /*#__PURE__*/ registerServerReference(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);
console.log($$ACTION_ARG_0); console.log($$ACTION_ARG_0);
}; }, "4090b5db271335765a4b0eab01f044b381b5ebd5cd", null);
registerServerReference($$RSC_SERVER_ACTION_1, "4090b5db271335765a4b0eab01f044b381b5ebd5cd", null);
/* __next_internal_action_entry_do_not_use__ {"4090b5db271335765a4b0eab01f044b381b5ebd5cd":{"name":"$$RSC_SERVER_ACTION_1"},"c03128060c414d59f8552e4788b846c0d2b7f74743":{"name":"$$RSC_SERVER_CACHE_0"}} */ function createObj(n) { /* __next_internal_action_entry_do_not_use__ {"4090b5db271335765a4b0eab01f044b381b5ebd5cd":{"name":"$$RSC_SERVER_ACTION_1"},"c03128060c414d59f8552e4788b846c0d2b7f74743":{"name":"$$RSC_SERVER_CACHE_0"}} */ function createObj(n) {
const m = n + 1; const m = n + 1;
return { return {
......
...@@ -4,11 +4,9 @@ import { cache as $$reactCache__ } from "react"; ...@@ -4,11 +4,9 @@ import { cache as $$reactCache__ } from "react";
const $$RSC_SERVER_CACHE_0_INNER = async function fetch1() { const $$RSC_SERVER_CACHE_0_INNER = async function fetch1() {
return fetch('https://example.com').then((res)=>res.json()); return fetch('https://example.com').then((res)=>res.json());
}; };
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function fetch1() { export var $$RSC_SERVER_CACHE_0 = /*#__PURE__*/ Object["defineProperty"](/*#__PURE__*/ registerServerReference(/*#__PURE__*/ $$reactCache__(function fetch1() {
return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, []); return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, []);
}); }), "803128060c414d59f8552e4788b846c0d2b7f74743", null), "name", {
registerServerReference($$RSC_SERVER_CACHE_0, "803128060c414d59f8552e4788b846c0d2b7f74743", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", {
value: "fetch" value: "fetch"
}); });
/* __next_internal_action_entry_do_not_use__ {"803128060c414d59f8552e4788b846c0d2b7f74743":{"name":"$$RSC_SERVER_CACHE_0"}} */ export const api = { /* __next_internal_action_entry_do_not_use__ {"803128060c414d59f8552e4788b846c0d2b7f74743":{"name":"$$RSC_SERVER_CACHE_0"}} */ export const api = {
......
...@@ -6,11 +6,9 @@ const { foo: fooCached } = { ...@@ -6,11 +6,9 @@ const { foo: fooCached } = {
}; };
let $$RSC_SERVER_CACHE_fooCached = fooCached; let $$RSC_SERVER_CACHE_fooCached = fooCached;
if (typeof fooCached === "function") { if (typeof fooCached === "function") {
$$RSC_SERVER_CACHE_fooCached = $$reactCache__(function() { $$RSC_SERVER_CACHE_fooCached = /*#__PURE__*/ Object["defineProperty"](/*#__PURE__*/ registerServerReference(/*#__PURE__*/ $$reactCache__(function() {
return $$cache__("default", "ffaa88e24cee8047d167e47f4f374dbddc187e2899", 0, fooCached, Array.prototype.slice.call(arguments)); return $$cache__("default", "ffaa88e24cee8047d167e47f4f374dbddc187e2899", 0, fooCached, Array.prototype.slice.call(arguments));
}); }), "ffaa88e24cee8047d167e47f4f374dbddc187e2899", null), "name", {
registerServerReference($$RSC_SERVER_CACHE_fooCached, "ffaa88e24cee8047d167e47f4f374dbddc187e2899", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_fooCached, "name", {
value: "fooCached" value: "fooCached"
}); });
} }
......
...@@ -4,17 +4,14 @@ import { cache as $$reactCache__ } from "react"; ...@@ -4,17 +4,14 @@ import { cache as $$reactCache__ } from "react";
const $$RSC_SERVER_CACHE_0_INNER = async function foo() { const $$RSC_SERVER_CACHE_0_INNER = async function foo() {
return fetch('https://example.com').then((res)=>res.json()); return fetch('https://example.com').then((res)=>res.json());
}; };
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function foo() { export var $$RSC_SERVER_CACHE_0 = /*#__PURE__*/ Object["defineProperty"](/*#__PURE__*/ registerServerReference(/*#__PURE__*/ $$reactCache__(function foo() {
return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, []); return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, []);
}); }), "803128060c414d59f8552e4788b846c0d2b7f74743", null), "name", {
registerServerReference($$RSC_SERVER_CACHE_0, "803128060c414d59f8552e4788b846c0d2b7f74743", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", {
value: "foo" value: "foo"
}); });
export const $$RSC_SERVER_ACTION_1 = async function bar() { export const $$RSC_SERVER_ACTION_1 = /*#__PURE__*/ registerServerReference(async function bar() {
console.log(42); console.log(42);
}; }, "0090b5db271335765a4b0eab01f044b381b5ebd5cd", null);
registerServerReference($$RSC_SERVER_ACTION_1, "0090b5db271335765a4b0eab01f044b381b5ebd5cd", null);
/* __next_internal_action_entry_do_not_use__ {"0090b5db271335765a4b0eab01f044b381b5ebd5cd":{"name":"$$RSC_SERVER_ACTION_1"},"803128060c414d59f8552e4788b846c0d2b7f74743":{"name":"$$RSC_SERVER_CACHE_0"}} */ export class MyClass { /* __next_internal_action_entry_do_not_use__ {"0090b5db271335765a4b0eab01f044b381b5ebd5cd":{"name":"$$RSC_SERVER_ACTION_1"},"803128060c414d59f8552e4788b846c0d2b7f74743":{"name":"$$RSC_SERVER_CACHE_0"}} */ export class MyClass {
static foo = $$RSC_SERVER_CACHE_0; static foo = $$RSC_SERVER_CACHE_0;
static bar = $$RSC_SERVER_ACTION_1; static bar = $$RSC_SERVER_ACTION_1;
......
...@@ -2,27 +2,24 @@ import { registerServerReference } from "private-next-rsc-server-reference"; ...@@ -2,27 +2,24 @@ 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 { cache as $$reactCache__ } from "react";
const $$RSC_SERVER_CACHE_0_INNER = async function([$$ACTION_ARG_0]) { const $$RSC_SERVER_CACHE_0_INNER = /*#__PURE__*/ Object["defineProperty"](async function([$$ACTION_ARG_0]) {
return $$ACTION_ARG_0(); return $$ACTION_ARG_0();
}; }, "name", {
Object["defineProperty"]($$RSC_SERVER_CACHE_0_INNER, "name", {
value: "" value: ""
}); });
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function() { export var $$RSC_SERVER_CACHE_0 = /*#__PURE__*/ registerServerReference(/*#__PURE__*/ $$reactCache__(function() {
return $$cache__("default", "c03128060c414d59f8552e4788b846c0d2b7f74743", 1, $$RSC_SERVER_CACHE_0_INNER, Array.prototype.slice.call(arguments, 0, 1)); return $$cache__("default", "c03128060c414d59f8552e4788b846c0d2b7f74743", 1, $$RSC_SERVER_CACHE_0_INNER, Array.prototype.slice.call(arguments, 0, 1));
}); }), "c03128060c414d59f8552e4788b846c0d2b7f74743", null);
registerServerReference($$RSC_SERVER_CACHE_0, "c03128060c414d59f8552e4788b846c0d2b7f74743", null);
/* __next_internal_action_entry_do_not_use__ {"4090b5db271335765a4b0eab01f044b381b5ebd5cd":{"name":"$$RSC_SERVER_ACTION_1"},"c03128060c414d59f8552e4788b846c0d2b7f74743":{"name":"$$RSC_SERVER_CACHE_0"}} */ function createCachedFn(start) { /* __next_internal_action_entry_do_not_use__ {"4090b5db271335765a4b0eab01f044b381b5ebd5cd":{"name":"$$RSC_SERVER_ACTION_1"},"c03128060c414d59f8552e4788b846c0d2b7f74743":{"name":"$$RSC_SERVER_CACHE_0"}} */ function createCachedFn(start) {
function fn() { function fn() {
return start + Math.random(); return start + Math.random();
} }
return $$RSC_SERVER_CACHE_0.bind(null, encryptActionBoundArgs("c03128060c414d59f8552e4788b846c0d2b7f74743", fn)); return $$RSC_SERVER_CACHE_0.bind(null, encryptActionBoundArgs("c03128060c414d59f8552e4788b846c0d2b7f74743", fn));
} }
export const $$RSC_SERVER_ACTION_1 = async function($$ACTION_CLOSURE_BOUND) { export const $$RSC_SERVER_ACTION_1 = /*#__PURE__*/ registerServerReference(async function($$ACTION_CLOSURE_BOUND) {
var [$$ACTION_ARG_0] = await decryptActionBoundArgs("4090b5db271335765a4b0eab01f044b381b5ebd5cd", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0] = await decryptActionBoundArgs("4090b5db271335765a4b0eab01f044b381b5ebd5cd", $$ACTION_CLOSURE_BOUND);
console.log($$ACTION_ARG_0()); console.log($$ACTION_ARG_0());
}; }, "4090b5db271335765a4b0eab01f044b381b5ebd5cd", null);
registerServerReference($$RSC_SERVER_ACTION_1, "4090b5db271335765a4b0eab01f044b381b5ebd5cd", null);
function createServerAction(start) { function createServerAction(start) {
function fn() { function fn() {
return start + Math.random(); return start + Math.random();
......
...@@ -14,7 +14,7 @@ function x() { ...@@ -14,7 +14,7 @@ function x() {
const f2 = 1; const f2 = 1;
const g201 = 1; const g201 = 1;
} }
export const $$RSC_SERVER_ACTION_0 = async function action($$ACTION_CLOSURE_BOUND) { export const $$RSC_SERVER_ACTION_0 = /*#__PURE__*/ registerServerReference(async function action($$ACTION_CLOSURE_BOUND) {
var [$$ACTION_ARG_0, $$ACTION_ARG_1, $$ACTION_ARG_2, $$ACTION_ARG_3, $$ACTION_ARG_4, $$ACTION_ARG_5] = await decryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0, $$ACTION_ARG_1, $$ACTION_ARG_2, $$ACTION_ARG_3, $$ACTION_ARG_4, $$ACTION_ARG_5] = await decryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND);
const f17 = 1; const f17 = 1;
if (true) { if (true) {
...@@ -24,8 +24,7 @@ export const $$RSC_SERVER_ACTION_0 = async function action($$ACTION_CLOSURE_BOUN ...@@ -24,8 +24,7 @@ export const $$RSC_SERVER_ACTION_0 = async function action($$ACTION_CLOSURE_BOUN
console.log(f, f1, $$ACTION_ARG_0, f3, f4, f5, f6, f7, f8, $$ACTION_ARG_0(f9), f12, $$ACTION_ARG_1, f16.x, f17, f18, $$ACTION_ARG_2, $$ACTION_ARG_3, $$ACTION_ARG_4, $$ACTION_ARG_5, // @ts-expect-error: deliberately undefined variable console.log(f, f1, $$ACTION_ARG_0, f3, f4, f5, f6, f7, f8, $$ACTION_ARG_0(f9), f12, $$ACTION_ARG_1, f16.x, f17, f18, $$ACTION_ARG_2, $$ACTION_ARG_3, $$ACTION_ARG_4, $$ACTION_ARG_5, // @ts-expect-error: deliberately undefined variable
g19, // @ts-expect-error: deliberately undefined variable g19, // @ts-expect-error: deliberately undefined variable
g20, globalThis); g20, globalThis);
}; }, "406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
registerServerReference($$RSC_SERVER_ACTION_0, "406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
export function y(p, [p1, { p2 }], ...p3) { export function y(p, [p1, { p2 }], ...p3) {
/** @type {any} */ const f2 = 1; /** @type {any} */ const f2 = 1;
const f11 = 1; const f11 = 1;
......
...@@ -12,11 +12,9 @@ export enum E { ...@@ -12,11 +12,9 @@ export enum E {
export default interface D { export default interface D {
} }
const $$RSC_SERVER_CACHE_0_INNER = async function Page() {}; const $$RSC_SERVER_CACHE_0_INNER = async function Page() {};
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function Page() { export var $$RSC_SERVER_CACHE_0 = /*#__PURE__*/ Object["defineProperty"](/*#__PURE__*/ registerServerReference(/*#__PURE__*/ $$reactCache__(function Page() {
return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, []); return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, []);
}); }), "803128060c414d59f8552e4788b846c0d2b7f74743", null), "name", {
registerServerReference($$RSC_SERVER_CACHE_0, "803128060c414d59f8552e4788b846c0d2b7f74743", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", {
value: "Page" value: "Page"
}); });
export var Page = $$RSC_SERVER_CACHE_0; export var Page = $$RSC_SERVER_CACHE_0;
import { registerServerReference } from "private-next-rsc-server-reference"; import { registerServerReference } from "private-next-rsc-server-reference";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
export const $$RSC_SERVER_ACTION_0 = async function action($$ACTION_CLOSURE_BOUND) { export const $$RSC_SERVER_ACTION_0 = /*#__PURE__*/ registerServerReference(async function action($$ACTION_CLOSURE_BOUND) {
var [$$ACTION_ARG_0, $$ACTION_ARG_1] = await decryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0, $$ACTION_ARG_1] = await decryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND);
console.log($$ACTION_ARG_0.find((x)=>x === $$ACTION_ARG_1)); console.log($$ACTION_ARG_0.find((x)=>x === $$ACTION_ARG_1));
}; }, "406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
registerServerReference($$RSC_SERVER_ACTION_0, "406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
/* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":{"name":"$$RSC_SERVER_ACTION_0"},"4090b5db271335765a4b0eab01f044b381b5ebd5cd":{"name":"$$RSC_SERVER_ACTION_1"}} */ export function ComponentA({ list, y }) { /* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":{"name":"$$RSC_SERVER_ACTION_0"},"4090b5db271335765a4b0eab01f044b381b5ebd5cd":{"name":"$$RSC_SERVER_ACTION_1"}} */ export function ComponentA({ list, y }) {
return <form action={$$RSC_SERVER_ACTION_0.bind(null, encryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", list, y))}> return <form action={$$RSC_SERVER_ACTION_0.bind(null, encryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", list, y))}>
<button>submit</button> <button>submit</button>
</form>; </form>;
} }
export const $$RSC_SERVER_ACTION_1 = async function action($$ACTION_CLOSURE_BOUND) { export const $$RSC_SERVER_ACTION_1 = /*#__PURE__*/ registerServerReference(async function action($$ACTION_CLOSURE_BOUND) {
var [$$ACTION_ARG_0, $$ACTION_ARG_1] = await decryptActionBoundArgs("4090b5db271335765a4b0eab01f044b381b5ebd5cd", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0, $$ACTION_ARG_1] = await decryptActionBoundArgs("4090b5db271335765a4b0eab01f044b381b5ebd5cd", $$ACTION_CLOSURE_BOUND);
console.log($$ACTION_ARG_0.find(function(x) { console.log($$ACTION_ARG_0.find(function(x) {
return x === $$ACTION_ARG_1; return x === $$ACTION_ARG_1;
})); }));
}; }, "4090b5db271335765a4b0eab01f044b381b5ebd5cd", null);
registerServerReference($$RSC_SERVER_ACTION_1, "4090b5db271335765a4b0eab01f044b381b5ebd5cd", null);
export function ComponentB({ list, y }) { export function ComponentB({ list, y }) {
return <form action={$$RSC_SERVER_ACTION_1.bind(null, encryptActionBoundArgs("4090b5db271335765a4b0eab01f044b381b5ebd5cd", list, y))}> return <form action={$$RSC_SERVER_ACTION_1.bind(null, encryptActionBoundArgs("4090b5db271335765a4b0eab01f044b381b5ebd5cd", list, y))}>
<button>submit</button> <button>submit</button>
......
...@@ -11,11 +11,9 @@ const $$RSC_SERVER_CACHE_0_INNER = async function getCachedData() { ...@@ -11,11 +11,9 @@ const $$RSC_SERVER_CACHE_0_INNER = async function getCachedData() {
// expect this to be cached? // expect this to be cached?
return getStuff(); return getStuff();
}; };
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function getCachedData() { export var $$RSC_SERVER_CACHE_0 = /*#__PURE__*/ Object["defineProperty"](/*#__PURE__*/ registerServerReference(/*#__PURE__*/ $$reactCache__(function getCachedData() {
return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, []); return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, []);
}); }), "803128060c414d59f8552e4788b846c0d2b7f74743", null), "name", {
registerServerReference($$RSC_SERVER_CACHE_0, "803128060c414d59f8552e4788b846c0d2b7f74743", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", {
value: "getCachedData" value: "getCachedData"
}); });
export const getCachedData = $$RSC_SERVER_CACHE_0; export const getCachedData = $$RSC_SERVER_CACHE_0;
...@@ -26,87 +24,71 @@ const Sync = wrap(()=><div>Sync</div>); ...@@ -26,87 +24,71 @@ const Sync = wrap(()=><div>Sync</div>);
const wrapped = wrap(async ()=>'foo', async ()=>'bar', async ()=>async ()=>'baz', ()=>'sync'); const wrapped = wrap(async ()=>'foo', async ()=>'bar', async ()=>async ()=>'baz', ()=>'sync');
export { staticallyKnownFunction }; export { staticallyKnownFunction };
const $$RSC_SERVER_CACHE_1_INNER = async function staticallyKnownFunction() {}; const $$RSC_SERVER_CACHE_1_INNER = async function staticallyKnownFunction() {};
export var $$RSC_SERVER_CACHE_1 = $$reactCache__(function staticallyKnownFunction() { export var $$RSC_SERVER_CACHE_1 = /*#__PURE__*/ Object["defineProperty"](/*#__PURE__*/ registerServerReference(/*#__PURE__*/ $$reactCache__(function staticallyKnownFunction() {
return $$cache__("default", "80951c375b4a6a6e89d67b743ec5808127cfde405d", 0, $$RSC_SERVER_CACHE_1_INNER, []); return $$cache__("default", "80951c375b4a6a6e89d67b743ec5808127cfde405d", 0, $$RSC_SERVER_CACHE_1_INNER, []);
}); }), "80951c375b4a6a6e89d67b743ec5808127cfde405d", null), "name", {
registerServerReference($$RSC_SERVER_CACHE_1, "80951c375b4a6a6e89d67b743ec5808127cfde405d", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_1, "name", {
value: "staticallyKnownFunction" value: "staticallyKnownFunction"
}); });
var staticallyKnownFunction = $$RSC_SERVER_CACHE_1; var staticallyKnownFunction = $$RSC_SERVER_CACHE_1;
let $$RSC_SERVER_CACHE_getData = getData; let $$RSC_SERVER_CACHE_getData = getData;
if (typeof getData === "function") { if (typeof getData === "function") {
$$RSC_SERVER_CACHE_getData = $$reactCache__(function() { $$RSC_SERVER_CACHE_getData = /*#__PURE__*/ Object["defineProperty"](/*#__PURE__*/ registerServerReference(/*#__PURE__*/ $$reactCache__(function() {
return $$cache__("default", "ff8fa22f08e492db15701f58a1458cc4ebf782f855", 0, getData, Array.prototype.slice.call(arguments)); return $$cache__("default", "ff8fa22f08e492db15701f58a1458cc4ebf782f855", 0, getData, Array.prototype.slice.call(arguments));
}); }), "ff8fa22f08e492db15701f58a1458cc4ebf782f855", null), "name", {
registerServerReference($$RSC_SERVER_CACHE_getData, "ff8fa22f08e492db15701f58a1458cc4ebf782f855", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_getData, "name", {
value: "getData" value: "getData"
}); });
} }
export { $$RSC_SERVER_CACHE_getData as getData }; export { $$RSC_SERVER_CACHE_getData as getData };
let $$RSC_SERVER_CACHE_aliased = aliased; let $$RSC_SERVER_CACHE_aliased = aliased;
if (typeof aliased === "function") { if (typeof aliased === "function") {
$$RSC_SERVER_CACHE_aliased = $$reactCache__(function() { $$RSC_SERVER_CACHE_aliased = /*#__PURE__*/ Object["defineProperty"](/*#__PURE__*/ registerServerReference(/*#__PURE__*/ $$reactCache__(function() {
return $$cache__("default", "ff27fadf3eeb97c777cea9f14a407b5c0b42ac65bb", 0, aliased, Array.prototype.slice.call(arguments)); return $$cache__("default", "ff27fadf3eeb97c777cea9f14a407b5c0b42ac65bb", 0, aliased, Array.prototype.slice.call(arguments));
}); }), "ff27fadf3eeb97c777cea9f14a407b5c0b42ac65bb", null), "name", {
registerServerReference($$RSC_SERVER_CACHE_aliased, "ff27fadf3eeb97c777cea9f14a407b5c0b42ac65bb", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_aliased, "name", {
value: "aliased" value: "aliased"
}); });
} }
export { $$RSC_SERVER_CACHE_aliased as aliased }; export { $$RSC_SERVER_CACHE_aliased as aliased };
let $$RSC_SERVER_CACHE_Sync = Sync; let $$RSC_SERVER_CACHE_Sync = Sync;
if (typeof Sync === "function") { if (typeof Sync === "function") {
$$RSC_SERVER_CACHE_Sync = $$reactCache__(function() { $$RSC_SERVER_CACHE_Sync = /*#__PURE__*/ Object["defineProperty"](/*#__PURE__*/ registerServerReference(/*#__PURE__*/ $$reactCache__(function() {
return $$cache__("default", "ff84effee663e5ce4e0948b55df129a8df904c67aa", 0, Sync, Array.prototype.slice.call(arguments)); return $$cache__("default", "ff84effee663e5ce4e0948b55df129a8df904c67aa", 0, Sync, Array.prototype.slice.call(arguments));
}); }), "ff84effee663e5ce4e0948b55df129a8df904c67aa", null), "name", {
registerServerReference($$RSC_SERVER_CACHE_Sync, "ff84effee663e5ce4e0948b55df129a8df904c67aa", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_Sync, "name", {
value: "Sync" value: "Sync"
}); });
} }
export { $$RSC_SERVER_CACHE_Sync as Sync }; export { $$RSC_SERVER_CACHE_Sync as Sync };
let $$RSC_SERVER_CACHE_wrapped = wrapped; let $$RSC_SERVER_CACHE_wrapped = wrapped;
if (typeof wrapped === "function") { if (typeof wrapped === "function") {
$$RSC_SERVER_CACHE_wrapped = $$reactCache__(function() { $$RSC_SERVER_CACHE_wrapped = /*#__PURE__*/ Object["defineProperty"](/*#__PURE__*/ registerServerReference(/*#__PURE__*/ $$reactCache__(function() {
return $$cache__("default", "ff438bb59117ff1af890c80ca3e39d9e888fc93033", 0, wrapped, Array.prototype.slice.call(arguments)); return $$cache__("default", "ff438bb59117ff1af890c80ca3e39d9e888fc93033", 0, wrapped, Array.prototype.slice.call(arguments));
}); }), "ff438bb59117ff1af890c80ca3e39d9e888fc93033", null), "name", {
registerServerReference($$RSC_SERVER_CACHE_wrapped, "ff438bb59117ff1af890c80ca3e39d9e888fc93033", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_wrapped, "name", {
value: "wrapped" value: "wrapped"
}); });
} }
export { $$RSC_SERVER_CACHE_wrapped as wrapped }; export { $$RSC_SERVER_CACHE_wrapped as wrapped };
let $$RSC_SERVER_CACHE_default = Layout; let $$RSC_SERVER_CACHE_default = Layout;
if (typeof Layout === "function") { if (typeof Layout === "function") {
$$RSC_SERVER_CACHE_default = $$reactCache__(function() { $$RSC_SERVER_CACHE_default = /*#__PURE__*/ Object["defineProperty"](/*#__PURE__*/ registerServerReference(/*#__PURE__*/ $$reactCache__(function() {
return $$cache__("default", "ffc18c215a6b7cdc64bf709f3a714ffdef1bf9651d", 0, Layout, Array.prototype.slice.call(arguments)); return $$cache__("default", "ffc18c215a6b7cdc64bf709f3a714ffdef1bf9651d", 0, Layout, Array.prototype.slice.call(arguments));
}); }), "ffc18c215a6b7cdc64bf709f3a714ffdef1bf9651d", null), "name", {
registerServerReference($$RSC_SERVER_CACHE_default, "ffc18c215a6b7cdc64bf709f3a714ffdef1bf9651d", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_default, "name", {
value: "Layout" value: "Layout"
}); });
} }
export default $$RSC_SERVER_CACHE_default; export default $$RSC_SERVER_CACHE_default;
let $$RSC_SERVER_CACHE_Other = Other; let $$RSC_SERVER_CACHE_Other = Other;
if (typeof Other === "function") { if (typeof Other === "function") {
$$RSC_SERVER_CACHE_Other = $$reactCache__(function() { $$RSC_SERVER_CACHE_Other = /*#__PURE__*/ Object["defineProperty"](/*#__PURE__*/ registerServerReference(/*#__PURE__*/ $$reactCache__(function() {
return $$cache__("default", "ff1acff246876a467753785a92d1f95ac6fe32c9b9", 0, Other, Array.prototype.slice.call(arguments)); return $$cache__("default", "ff1acff246876a467753785a92d1f95ac6fe32c9b9", 0, Other, Array.prototype.slice.call(arguments));
}); }), "ff1acff246876a467753785a92d1f95ac6fe32c9b9", null), "name", {
registerServerReference($$RSC_SERVER_CACHE_Other, "ff1acff246876a467753785a92d1f95ac6fe32c9b9", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_Other, "name", {
value: "Other" value: "Other"
}); });
} }
export { $$RSC_SERVER_CACHE_Other as Other }; export { $$RSC_SERVER_CACHE_Other as Other };
let $$RSC_SERVER_CACHE_getStuff = getStuff; let $$RSC_SERVER_CACHE_getStuff = getStuff;
if (typeof getStuff === "function") { if (typeof getStuff === "function") {
$$RSC_SERVER_CACHE_getStuff = $$reactCache__(function() { $$RSC_SERVER_CACHE_getStuff = /*#__PURE__*/ Object["defineProperty"](/*#__PURE__*/ registerServerReference(/*#__PURE__*/ $$reactCache__(function() {
return $$cache__("default", "ff980f8c891ae27674b86a4804d306bdb3065c2e4f", 0, getStuff, Array.prototype.slice.call(arguments)); return $$cache__("default", "ff980f8c891ae27674b86a4804d306bdb3065c2e4f", 0, getStuff, Array.prototype.slice.call(arguments));
}); }), "ff980f8c891ae27674b86a4804d306bdb3065c2e4f", null), "name", {
registerServerReference($$RSC_SERVER_CACHE_getStuff, "ff980f8c891ae27674b86a4804d306bdb3065c2e4f", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_getStuff, "name", {
value: "getStuff" value: "getStuff"
}); });
} }
......
...@@ -8,11 +8,9 @@ const Page = withSlug(function Page({ slug }) { ...@@ -8,11 +8,9 @@ const Page = withSlug(function Page({ slug }) {
}); });
let $$RSC_SERVER_CACHE_default = Page; let $$RSC_SERVER_CACHE_default = Page;
if (typeof Page === "function") { if (typeof Page === "function") {
$$RSC_SERVER_CACHE_default = $$reactCache__(function() { $$RSC_SERVER_CACHE_default = /*#__PURE__*/ Object["defineProperty"](/*#__PURE__*/ registerServerReference(/*#__PURE__*/ $$reactCache__(function() {
return $$cache__("default", "ffc18c215a6b7cdc64bf709f3a714ffdef1bf9651d", 0, Page, Array.prototype.slice.call(arguments)); return $$cache__("default", "ffc18c215a6b7cdc64bf709f3a714ffdef1bf9651d", 0, Page, Array.prototype.slice.call(arguments));
}); }), "ffc18c215a6b7cdc64bf709f3a714ffdef1bf9651d", null), "name", {
registerServerReference($$RSC_SERVER_CACHE_default, "ffc18c215a6b7cdc64bf709f3a714ffdef1bf9651d", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_default, "name", {
value: "Page" value: "Page"
}); });
} }
......
...@@ -5,10 +5,9 @@ import { cache as $$reactCache__ } from "react"; ...@@ -5,10 +5,9 @@ import { cache as $$reactCache__ } from "react";
import { wrapItLikeItsHot } from './wrap-it-like-its-hot'; import { wrapItLikeItsHot } from './wrap-it-like-its-hot';
// @ts-ignore // @ts-ignore
import { ClientComponent } from './client-component'; import { ClientComponent } from './client-component';
export const $$RSC_SERVER_ACTION_0 = async function action() { export const $$RSC_SERVER_ACTION_0 = /*#__PURE__*/ registerServerReference(async function action() {
console.log('hot action'); console.log('hot action');
}; }, "006a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
registerServerReference($$RSC_SERVER_ACTION_0, "006a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
const $$RSC_SERVER_CACHE_1 = wrapItLikeItsHot(({ hot })=>{ const $$RSC_SERVER_CACHE_1 = wrapItLikeItsHot(({ hot })=>{
return <ClientComponent action={$$RSC_SERVER_ACTION_0}> return <ClientComponent action={$$RSC_SERVER_ACTION_0}>
{hot} {hot}
...@@ -16,9 +15,8 @@ const $$RSC_SERVER_CACHE_1 = wrapItLikeItsHot(({ hot })=>{ ...@@ -16,9 +15,8 @@ const $$RSC_SERVER_CACHE_1 = wrapItLikeItsHot(({ hot })=>{
}); });
let $$RSC_SERVER_CACHE_default = $$RSC_SERVER_CACHE_1; let $$RSC_SERVER_CACHE_default = $$RSC_SERVER_CACHE_1;
if (typeof $$RSC_SERVER_CACHE_1 === "function") { if (typeof $$RSC_SERVER_CACHE_1 === "function") {
$$RSC_SERVER_CACHE_default = $$reactCache__(function() { $$RSC_SERVER_CACHE_default = /*#__PURE__*/ registerServerReference(/*#__PURE__*/ $$reactCache__(function() {
return $$cache__("default", "ffc18c215a6b7cdc64bf709f3a714ffdef1bf9651d", 0, $$RSC_SERVER_CACHE_1, Array.prototype.slice.call(arguments)); return $$cache__("default", "ffc18c215a6b7cdc64bf709f3a714ffdef1bf9651d", 0, $$RSC_SERVER_CACHE_1, Array.prototype.slice.call(arguments));
}); }), "ffc18c215a6b7cdc64bf709f3a714ffdef1bf9651d", null);
registerServerReference($$RSC_SERVER_CACHE_default, "ffc18c215a6b7cdc64bf709f3a714ffdef1bf9651d", null);
} }
export default $$RSC_SERVER_CACHE_default; export default $$RSC_SERVER_CACHE_default;
...@@ -2,11 +2,9 @@ ...@@ -2,11 +2,9 @@
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() {}; const $$RSC_SERVER_CACHE_0_INNER = async function foo() {};
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function foo() { export var $$RSC_SERVER_CACHE_0 = /*#__PURE__*/ Object["defineProperty"](/*#__PURE__*/ registerServerReference(/*#__PURE__*/ $$reactCache__(function foo() {
return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, []); return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, []);
}); }), "803128060c414d59f8552e4788b846c0d2b7f74743", null), "name", {
registerServerReference($$RSC_SERVER_CACHE_0, "803128060c414d59f8552e4788b846c0d2b7f74743", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", {
value: "foo" value: "foo"
}); });
var foo = $$RSC_SERVER_CACHE_0; var foo = $$RSC_SERVER_CACHE_0;
......
...@@ -11,22 +11,18 @@ export { Foo }; ...@@ -11,22 +11,18 @@ export { Foo };
export { type Bar }; export { type Bar };
let $$RSC_SERVER_CACHE_foo = foo; let $$RSC_SERVER_CACHE_foo = foo;
if (typeof foo === "function") { if (typeof foo === "function") {
$$RSC_SERVER_CACHE_foo = $$reactCache__(function() { $$RSC_SERVER_CACHE_foo = /*#__PURE__*/ Object["defineProperty"](/*#__PURE__*/ registerServerReference(/*#__PURE__*/ $$reactCache__(function() {
return $$cache__("default", "ffab21efdafbe611287bc25c0462b1e0510d13e48b", 0, foo, Array.prototype.slice.call(arguments)); return $$cache__("default", "ffab21efdafbe611287bc25c0462b1e0510d13e48b", 0, foo, Array.prototype.slice.call(arguments));
}); }), "ffab21efdafbe611287bc25c0462b1e0510d13e48b", null), "name", {
registerServerReference($$RSC_SERVER_CACHE_foo, "ffab21efdafbe611287bc25c0462b1e0510d13e48b", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_foo, "name", {
value: "foo" value: "foo"
}); });
} }
export { $$RSC_SERVER_CACHE_foo as foo }; export { $$RSC_SERVER_CACHE_foo as foo };
let $$RSC_SERVER_CACHE_bar = bar; let $$RSC_SERVER_CACHE_bar = bar;
if (typeof bar === "function") { if (typeof bar === "function") {
$$RSC_SERVER_CACHE_bar = $$reactCache__(function() { $$RSC_SERVER_CACHE_bar = /*#__PURE__*/ Object["defineProperty"](/*#__PURE__*/ registerServerReference(/*#__PURE__*/ $$reactCache__(function() {
return $$cache__("default", "ffac840dcaf5e8197cb02b7f3a43c119b7a770b272", 0, bar, Array.prototype.slice.call(arguments)); return $$cache__("default", "ffac840dcaf5e8197cb02b7f3a43c119b7a770b272", 0, bar, Array.prototype.slice.call(arguments));
}); }), "ffac840dcaf5e8197cb02b7f3a43c119b7a770b272", null), "name", {
registerServerReference($$RSC_SERVER_CACHE_bar, "ffac840dcaf5e8197cb02b7f3a43c119b7a770b272", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_bar, "name", {
value: "bar" value: "bar"
}); });
} }
......
...@@ -2,42 +2,38 @@ import { registerServerReference } from "private-next-rsc-server-reference"; ...@@ -2,42 +2,38 @@ 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";
/* __next_internal_action_entry_do_not_use__ {"401c36b06e398c97abe5d5d7ae8c672bfddf4e1b91":{"name":"$$RSC_SERVER_ACTION_2"},"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":{"name":"$$RSC_SERVER_ACTION_0"},"4090b5db271335765a4b0eab01f044b381b5ebd5cd":{"name":"$$RSC_SERVER_ACTION_1"},"409ed0cc47abc4e1c64320cf42b74ae60b58c40f00":{"name":"$$RSC_SERVER_ACTION_3"}} */ import { Button } from 'components'; /* __next_internal_action_entry_do_not_use__ {"401c36b06e398c97abe5d5d7ae8c672bfddf4e1b91":{"name":"$$RSC_SERVER_ACTION_2"},"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":{"name":"$$RSC_SERVER_ACTION_0"},"4090b5db271335765a4b0eab01f044b381b5ebd5cd":{"name":"$$RSC_SERVER_ACTION_1"},"409ed0cc47abc4e1c64320cf42b74ae60b58c40f00":{"name":"$$RSC_SERVER_ACTION_3"}} */ import { Button } from 'components';
import deleteFromDb from 'db'; import deleteFromDb from 'db';
export const $$RSC_SERVER_ACTION_0 = async function deleteItem1($$ACTION_CLOSURE_BOUND) { export const $$RSC_SERVER_ACTION_0 = /*#__PURE__*/ registerServerReference(async function deleteItem1($$ACTION_CLOSURE_BOUND) {
var [$$ACTION_ARG_0, $$ACTION_ARG_1, $$ACTION_ARG_2] = await decryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0, $$ACTION_ARG_1, $$ACTION_ARG_2] = await decryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND);
await deleteFromDb($$ACTION_ARG_0.id, $$ACTION_ARG_0?.foo, $$ACTION_ARG_0.bar.baz, $$ACTION_ARG_0[// @ts-expect-error: deliberate useless comma await deleteFromDb($$ACTION_ARG_0.id, $$ACTION_ARG_0?.foo, $$ACTION_ARG_0.bar.baz, $$ACTION_ARG_0[// @ts-expect-error: deliberate useless comma
$$ACTION_ARG_1, $$ACTION_ARG_2]); $$ACTION_ARG_1, $$ACTION_ARG_2]);
}; }, "406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
registerServerReference($$RSC_SERVER_ACTION_0, "406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
export function Item1(product, foo, bar) { export function Item1(product, foo, bar) {
const a = $$RSC_SERVER_ACTION_0.bind(null, encryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", product, foo, bar)); const a = $$RSC_SERVER_ACTION_0.bind(null, encryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", product, foo, bar));
return <Button action={a}>Delete</Button>; return <Button action={a}>Delete</Button>;
} }
export const $$RSC_SERVER_ACTION_1 = async function deleteItem2($$ACTION_CLOSURE_BOUND) { export const $$RSC_SERVER_ACTION_1 = /*#__PURE__*/ registerServerReference(async function deleteItem2($$ACTION_CLOSURE_BOUND) {
var [$$ACTION_ARG_0, $$ACTION_ARG_1, $$ACTION_ARG_2] = await decryptActionBoundArgs("4090b5db271335765a4b0eab01f044b381b5ebd5cd", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0, $$ACTION_ARG_1, $$ACTION_ARG_2] = await decryptActionBoundArgs("4090b5db271335765a4b0eab01f044b381b5ebd5cd", $$ACTION_CLOSURE_BOUND);
await deleteFromDb($$ACTION_ARG_0.id, $$ACTION_ARG_0?.foo, $$ACTION_ARG_0.bar.baz, $$ACTION_ARG_0[// @ts-expect-error: deliberate useless comma await deleteFromDb($$ACTION_ARG_0.id, $$ACTION_ARG_0?.foo, $$ACTION_ARG_0.bar.baz, $$ACTION_ARG_0[// @ts-expect-error: deliberate useless comma
$$ACTION_ARG_1, $$ACTION_ARG_2]); $$ACTION_ARG_1, $$ACTION_ARG_2]);
}; }, "4090b5db271335765a4b0eab01f044b381b5ebd5cd", null);
registerServerReference($$RSC_SERVER_ACTION_1, "4090b5db271335765a4b0eab01f044b381b5ebd5cd", null);
export function Item2(product, foo, bar) { export function Item2(product, foo, bar) {
var deleteItem2 = $$RSC_SERVER_ACTION_1.bind(null, encryptActionBoundArgs("4090b5db271335765a4b0eab01f044b381b5ebd5cd", product, foo, bar)); var deleteItem2 = $$RSC_SERVER_ACTION_1.bind(null, encryptActionBoundArgs("4090b5db271335765a4b0eab01f044b381b5ebd5cd", product, foo, bar));
return <Button action={deleteItem2}>Delete</Button>; return <Button action={deleteItem2}>Delete</Button>;
} }
export const $$RSC_SERVER_ACTION_2 = async function deleteItem3($$ACTION_CLOSURE_BOUND) { export const $$RSC_SERVER_ACTION_2 = /*#__PURE__*/ registerServerReference(async function deleteItem3($$ACTION_CLOSURE_BOUND) {
var [$$ACTION_ARG_0, $$ACTION_ARG_1, $$ACTION_ARG_2] = await decryptActionBoundArgs("401c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0, $$ACTION_ARG_1, $$ACTION_ARG_2] = await decryptActionBoundArgs("401c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", $$ACTION_CLOSURE_BOUND);
await deleteFromDb($$ACTION_ARG_0.id, $$ACTION_ARG_0?.foo, $$ACTION_ARG_0.bar.baz, $$ACTION_ARG_0[// @ts-expect-error: deliberate useless comma await deleteFromDb($$ACTION_ARG_0.id, $$ACTION_ARG_0?.foo, $$ACTION_ARG_0.bar.baz, $$ACTION_ARG_0[// @ts-expect-error: deliberate useless comma
$$ACTION_ARG_1, $$ACTION_ARG_2]); $$ACTION_ARG_1, $$ACTION_ARG_2]);
}; }, "401c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", null);
registerServerReference($$RSC_SERVER_ACTION_2, "401c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", null);
export function Item3(product, foo, bar) { export function Item3(product, foo, bar) {
const deleteItem3 = $$RSC_SERVER_ACTION_2.bind(null, encryptActionBoundArgs("401c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", product, foo, bar)); const deleteItem3 = $$RSC_SERVER_ACTION_2.bind(null, encryptActionBoundArgs("401c36b06e398c97abe5d5d7ae8c672bfddf4e1b91", product, foo, bar));
return <Button action={deleteItem3}>Delete</Button>; return <Button action={deleteItem3}>Delete</Button>;
} }
export const $$RSC_SERVER_ACTION_3 = async function deleteItem4($$ACTION_CLOSURE_BOUND) { export const $$RSC_SERVER_ACTION_3 = /*#__PURE__*/ registerServerReference(async function deleteItem4($$ACTION_CLOSURE_BOUND) {
var [$$ACTION_ARG_0, $$ACTION_ARG_1, $$ACTION_ARG_2] = await decryptActionBoundArgs("409ed0cc47abc4e1c64320cf42b74ae60b58c40f00", $$ACTION_CLOSURE_BOUND); var [$$ACTION_ARG_0, $$ACTION_ARG_1, $$ACTION_ARG_2] = await decryptActionBoundArgs("409ed0cc47abc4e1c64320cf42b74ae60b58c40f00", $$ACTION_CLOSURE_BOUND);
await deleteFromDb($$ACTION_ARG_0.id, $$ACTION_ARG_0?.foo, $$ACTION_ARG_0.bar.baz, $$ACTION_ARG_0[// @ts-expect-error: deliberate useless comma await deleteFromDb($$ACTION_ARG_0.id, $$ACTION_ARG_0?.foo, $$ACTION_ARG_0.bar.baz, $$ACTION_ARG_0[// @ts-expect-error: deliberate useless comma
$$ACTION_ARG_1, $$ACTION_ARG_2]); $$ACTION_ARG_1, $$ACTION_ARG_2]);
}; }, "409ed0cc47abc4e1c64320cf42b74ae60b58c40f00", null);
registerServerReference($$RSC_SERVER_ACTION_3, "409ed0cc47abc4e1c64320cf42b74ae60b58c40f00", null);
export function Item4(product, foo, bar) { export function Item4(product, foo, bar) {
const deleteItem4 = $$RSC_SERVER_ACTION_3.bind(null, encryptActionBoundArgs("409ed0cc47abc4e1c64320cf42b74ae60b58c40f00", product, foo, bar)); const deleteItem4 = $$RSC_SERVER_ACTION_3.bind(null, encryptActionBoundArgs("409ed0cc47abc4e1c64320cf42b74ae60b58c40f00", product, foo, bar));
return <Button action={deleteItem4}>Delete</Button>; return <Button action={deleteItem4}>Delete</Button>;
......
...@@ -6,11 +6,9 @@ import { cache as $$reactCache__ } from "react"; ...@@ -6,11 +6,9 @@ import { cache as $$reactCache__ } from "react";
const $$RSC_SERVER_CACHE_0_INNER = async function action(x) { const $$RSC_SERVER_CACHE_0_INNER = async function action(x) {
return x; return x;
}; };
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function action() { export var $$RSC_SERVER_CACHE_0 = /*#__PURE__*/ Object["defineProperty"](/*#__PURE__*/ registerServerReference(/*#__PURE__*/ $$reactCache__(function action() {
return $$cache__("default", "c03128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, Array.prototype.slice.call(arguments, 0, 1)); return $$cache__("default", "c03128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, Array.prototype.slice.call(arguments, 0, 1));
}); }), "c03128060c414d59f8552e4788b846c0d2b7f74743", null), "name", {
registerServerReference($$RSC_SERVER_CACHE_0, "c03128060c414d59f8552e4788b846c0d2b7f74743", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", {
value: "action" value: "action"
}); });
export var action = $$RSC_SERVER_CACHE_0; export var action = $$RSC_SERVER_CACHE_0;
...@@ -6,11 +6,9 @@ import { cache as $$reactCache__ } from "react"; ...@@ -6,11 +6,9 @@ import { cache as $$reactCache__ } from "react";
const $$RSC_SERVER_CACHE_0_INNER = async function foo() { const $$RSC_SERVER_CACHE_0_INNER = async function foo() {
return 1; return 1;
}; };
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function foo() { export var $$RSC_SERVER_CACHE_0 = /*#__PURE__*/ Object["defineProperty"](/*#__PURE__*/ registerServerReference(/*#__PURE__*/ $$reactCache__(function foo() {
return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, []); return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, []);
}); }), "803128060c414d59f8552e4788b846c0d2b7f74743", null), "name", {
registerServerReference($$RSC_SERVER_CACHE_0, "803128060c414d59f8552e4788b846c0d2b7f74743", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", {
value: "foo" value: "foo"
}); });
export var foo = $$RSC_SERVER_CACHE_0; export var foo = $$RSC_SERVER_CACHE_0;
...@@ -14,11 +14,9 @@ export const metadata = { ...@@ -14,11 +14,9 @@ export const metadata = {
const $$RSC_SERVER_CACHE_0_INNER = async function Page() { const $$RSC_SERVER_CACHE_0_INNER = async function Page() {
return null; return null;
}; };
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function Page() { export var $$RSC_SERVER_CACHE_0 = /*#__PURE__*/ Object["defineProperty"](/*#__PURE__*/ registerServerReference(/*#__PURE__*/ $$reactCache__(function Page() {
return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, []); return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, []);
}); }), "803128060c414d59f8552e4788b846c0d2b7f74743", null), "name", {
registerServerReference($$RSC_SERVER_CACHE_0, "803128060c414d59f8552e4788b846c0d2b7f74743", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", {
value: "Page" value: "Page"
}); });
export default $$RSC_SERVER_CACHE_0; export default $$RSC_SERVER_CACHE_0;
import { registerServerReference } from "private-next-rsc-server-reference"; import { registerServerReference } from "private-next-rsc-server-reference";
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 const $$RSC_SERVER_ACTION_0 = async function actionImpl(count) { export const $$RSC_SERVER_ACTION_0 = /*#__PURE__*/ registerServerReference(async function actionImpl(count) {
if (count === 0) return 'done'; if (count === 0) return 'done';
return actionImpl(count - 1); return actionImpl(count - 1);
}; }, "406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
registerServerReference($$RSC_SERVER_ACTION_0, "406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
/* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":{"name":"$$RSC_SERVER_ACTION_0"},"c0951c375b4a6a6e89d67b743ec5808127cfde405d":{"name":"$$RSC_SERVER_CACHE_1"}} */ export const action = $$RSC_SERVER_ACTION_0; /* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":{"name":"$$RSC_SERVER_ACTION_0"},"c0951c375b4a6a6e89d67b743ec5808127cfde405d":{"name":"$$RSC_SERVER_CACHE_1"}} */ export const action = $$RSC_SERVER_ACTION_0;
const $$RSC_SERVER_CACHE_1_INNER = async function cachedImpl(count) { const $$RSC_SERVER_CACHE_1_INNER = async function cachedImpl(count) {
if (count === 0) return 'done'; if (count === 0) return 'done';
return cachedImpl(count - 1); return cachedImpl(count - 1);
}; };
export var $$RSC_SERVER_CACHE_1 = $$reactCache__(function cachedImpl() { export var $$RSC_SERVER_CACHE_1 = /*#__PURE__*/ Object["defineProperty"](/*#__PURE__*/ registerServerReference(/*#__PURE__*/ $$reactCache__(function cachedImpl() {
return $$cache__("default", "c0951c375b4a6a6e89d67b743ec5808127cfde405d", 0, $$RSC_SERVER_CACHE_1_INNER, Array.prototype.slice.call(arguments, 0, 1)); return $$cache__("default", "c0951c375b4a6a6e89d67b743ec5808127cfde405d", 0, $$RSC_SERVER_CACHE_1_INNER, Array.prototype.slice.call(arguments, 0, 1));
}); }), "c0951c375b4a6a6e89d67b743ec5808127cfde405d", null), "name", {
registerServerReference($$RSC_SERVER_CACHE_1, "c0951c375b4a6a6e89d67b743ec5808127cfde405d", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_1, "name", {
value: "cachedImpl" value: "cachedImpl"
}); });
export const cached = $$RSC_SERVER_CACHE_1; export const cached = $$RSC_SERVER_CACHE_1;
import { registerServerReference } from "private-next-rsc-server-reference"; import { registerServerReference } from "private-next-rsc-server-reference";
/* __next_internal_action_entry_do_not_use__ {"706a88810ecce4a4e8b59d53b8327d7e98bbf251d7":{"name":"$$RSC_SERVER_ACTION_0"}} */ import { Button } from 'components'; /* __next_internal_action_entry_do_not_use__ {"706a88810ecce4a4e8b59d53b8327d7e98bbf251d7":{"name":"$$RSC_SERVER_ACTION_0"}} */ import { Button } from 'components';
export const $$RSC_SERVER_ACTION_0 = async function myAction(a, b, c) { export const $$RSC_SERVER_ACTION_0 = /*#__PURE__*/ registerServerReference(async function myAction(a, b, c) {
// comment // comment
'use strict'; 'use strict';
console.log('a'); console.log('a');
}; }, "706a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
registerServerReference($$RSC_SERVER_ACTION_0, "706a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
var myAction = $$RSC_SERVER_ACTION_0; var myAction = $$RSC_SERVER_ACTION_0;
export default function Page() { export default function Page() {
return <Button action={myAction}>Delete</Button>; return <Button action={myAction}>Delete</Button>;
......
...@@ -2,22 +2,18 @@ ...@@ -2,22 +2,18 @@
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() {}; const $$RSC_SERVER_CACHE_0_INNER = async function foo() {};
export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function foo() { export var $$RSC_SERVER_CACHE_0 = /*#__PURE__*/ Object["defineProperty"](/*#__PURE__*/ registerServerReference(/*#__PURE__*/ $$reactCache__(function foo() {
return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, []); return $$cache__("default", "803128060c414d59f8552e4788b846c0d2b7f74743", 0, $$RSC_SERVER_CACHE_0_INNER, []);
}); }), "803128060c414d59f8552e4788b846c0d2b7f74743", null), "name", {
registerServerReference($$RSC_SERVER_CACHE_0, "803128060c414d59f8552e4788b846c0d2b7f74743", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", {
value: "foo" value: "foo"
}); });
const foo = $$RSC_SERVER_CACHE_0; const foo = $$RSC_SERVER_CACHE_0;
const $$RSC_SERVER_CACHE_1_INNER = async function bar() { const $$RSC_SERVER_CACHE_1_INNER = async function bar() {
return foo(); return foo();
}; };
export var $$RSC_SERVER_CACHE_1 = $$reactCache__(function bar() { export var $$RSC_SERVER_CACHE_1 = /*#__PURE__*/ Object["defineProperty"](/*#__PURE__*/ registerServerReference(/*#__PURE__*/ $$reactCache__(function bar() {
return $$cache__("default", "80951c375b4a6a6e89d67b743ec5808127cfde405d", 0, $$RSC_SERVER_CACHE_1_INNER, []); return $$cache__("default", "80951c375b4a6a6e89d67b743ec5808127cfde405d", 0, $$RSC_SERVER_CACHE_1_INNER, []);
}); }), "80951c375b4a6a6e89d67b743ec5808127cfde405d", null), "name", {
registerServerReference($$RSC_SERVER_CACHE_1, "80951c375b4a6a6e89d67b743ec5808127cfde405d", null);
Object["defineProperty"]($$RSC_SERVER_CACHE_1, "name", {
value: "bar" value: "bar"
}); });
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":";;;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"} {"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,4EAAA,qDAAA,SAAN;WAAM;;;;AAAZ,MAAM;AAIC,MAAA,6BAAA,eAAe;IACpB,OAAO;AACT;WAFO,4EAAA,qDAAA,SAAe;WAAf;;;;AAAP,WAAsB"}
...@@ -206,7 +206,7 @@ declare module 'react-server-dom-webpack/server.edge' { ...@@ -206,7 +206,7 @@ declare module 'react-server-dom-webpack/server.edge' {
reference: T, reference: T,
id: string, id: string,
exportName: string | null exportName: string | null
): unknown ): T
export function createClientModuleProxy(moduleId: string): unknown export function createClientModuleProxy(moduleId: string): unknown
} }
......
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