Unverified Commit 844776ef authored by Shu Ding's avatar Shu Ding Committed by GitHub

Support named exports for server references (#46558)

NEXT-424

Note that this change also prepares for upcoming PRs to support arrow functions.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] [e2e](https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
parent d167ecce
// app/send.ts
"use server";
async function foo () {}
export { foo }
async function bar() {}
export { bar as baz }
async function qux() {}
export { qux as default }
// app/send.ts
/* __next_internal_action_entry_do_not_use__ foo,bar,qux */ async function foo() {}
foo.$$typeof = Symbol.for("react.server.reference");
foo.$$filepath = "/app/item.js";
foo.$$name = "foo";
foo.$$bound = [];
export { foo };
async function bar() {}
bar.$$typeof = Symbol.for("react.server.reference");
bar.$$filepath = "/app/item.js";
bar.$$name = "bar";
bar.$$bound = [];
export { bar as baz };
async function qux() {}
qux.$$typeof = Symbol.for("react.server.reference");
qux.$$filepath = "/app/item.js";
qux.$$name = "qux";
qux.$$bound = [];
export { qux as default };
\ No newline at end of file
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