No description
Find a file
Justin Ridgewell feca3ce21c
Turbopack: Implement Server Actions (#53890)
### What?

This implements Server Actions inside the new Turbopack next-api bundles.

### How?

Server Actions requires:
1. A `.next/server/server-reference-manifest.json` manifest describing what loader module to import to invoke a server action
2. A "loader" entry point that then imports server actions from our internal chunk items
3. Importing the bundled `react-experimental` module instead of regular `react`
4. A little 🪄 pixie dust
5. A small change in the magic comment generated in modules that export server actions

I had to change the magic `__next_internal_action_entry_do_not_use__` comment generated by the server actions transformer. When I traverse the module graph to find all exported actions _after chunking_ has been performed, we no longer have access to the original file name needed to generate the server action's id hash. Adding the filename to comment allows me to recover this without overcomplicating our output pipeline.

Closes WEB-1279
Depends on https://github.com/vercel/turbo/pull/5705

Co-authored-by: Tim Neutkens <6324199+timneutkens@users.noreply.github.com>
Co-authored-by: Jiachi Liu <4800338+huozhi@users.noreply.github.com>
2023-10-04 23:33:21 +00:00
.cargo Update rust toolchain to nightly-2023-09-21 (#55774) 2023-09-22 19:12:25 +00:00
.config Remove next-dev and its test suite and benchmarks (#55983) 2023-09-26 05:22:39 +02:00
.devcontainer re-enable next-dev-tests (#47087) 2023-03-14 16:05:19 +01:00
.github Add code freeze GitHub actions for releasing (#56325) 2023-10-02 23:10:40 +02:00
.husky Replace pre-commit with husky (#38350) 2022-07-06 11:14:16 -05:00
.vscode Add next.config.js options to turbopack warning file (#56207) 2023-09-29 14:08:40 +02:00
bench chore: remove chalk in favor of picocolors (#55992) 2023-09-27 21:00:52 +00:00
contributing chore: replace issue triaing actions with nissuer (#55525) 2023-09-19 11:11:00 +00:00
docs Update redirect.mdx (#56414) 2023-10-04 13:01:10 +00:00
errors docs(sharp-missing-in-production.mdx): update standalone command (#56239) 2023-09-30 15:26:02 +00:00
examples Maintenance: minor example dep bumps to fix moderate vulns (#56375) 2023-10-04 11:18:54 -04:00
packages Turbopack: Implement Server Actions (#53890) 2023-10-04 23:33:21 +00:00
scripts Maintenance: minor example dep bumps to fix moderate vulns (#56375) 2023-10-04 11:18:54 -04:00
test Turbopack: Implement Server Actions (#53890) 2023-10-04 23:33:21 +00:00
.alexignore Integrate next-* crates from Turbopack (#47019) 2023-03-13 14:33:17 +01:00
.alexrc docs: Add "special" to the Alex allowlist (#48021) 2023-04-06 16:32:06 +02:00
.eslintignore chore: replace issue triaing actions with nissuer (#55525) 2023-09-19 11:11:00 +00:00
.eslintrc.json server: re-land bundled runtimes (#55139) 2023-09-08 16:05:29 +00:00
.gitattributes chore: update gitattributes with linguist-vendored (#54683) 2023-08-28 21:50:19 +00:00
.gitignore Optimize webpack memory cache garbage collection (#54397) 2023-08-23 15:46:32 +02:00
.node-version misc: add node-version file (#55938) 2023-09-27 14:29:44 +00:00
.npmrc fix: npm publish provenance permissions (#48757) 2023-04-24 14:08:55 +00:00
.prettierignore Remove next-dev and its test suite and benchmarks (#55983) 2023-09-26 05:22:39 +02:00
.prettierignore_staged chore: replace issue triaing actions with nissuer (#55525) 2023-09-19 11:11:00 +00:00
.prettierrc.json Prettier trailingComma default value to es5 since 2.0 (#14391) 2020-06-22 13:25:24 +02:00
.rustfmt.toml build(cargo): move workspaces manifest to top level (#48198) 2023-04-19 18:38:36 +02:00
azure-pipelines.yml Move test/integration/production to test/production (#55981) 2023-09-26 15:38:50 +02:00
Cargo.lock Turbopack: Implement Server Actions (#53890) 2023-10-04 23:33:21 +00:00
Cargo.toml Turbopack: Implement Server Actions (#53890) 2023-10-04 23:33:21 +00:00
CODE_OF_CONDUCT.md updated code of conduct to v2.1 (#34208) 2022-02-10 18:11:42 -06:00
contributing.md chore: improve repo templates (#46629) 2023-03-01 09:25:51 -08:00
jest.config.js remove --turbo, use --experimental-turbo as --turbo (#55063) 2023-09-06 17:46:54 +00:00
jest.replay.config.js Add Replay integration for dev e2e tests (#40955) 2022-09-29 14:45:10 -07:00
lerna.json v13.5.5-canary.2 2023-10-04 19:01:01 +00:00
license.md Update license year (#44403) 2023-01-01 11:12:49 +01:00
lint-staged.config.js add cargo fmt to lint staged (#56430) 2023-10-04 17:46:44 +00:00
package.json App Router - preinitialize chunks during SSR (#54752) 2023-10-03 21:40:25 +00:00
plopfile.js Opt-in to dynamic rendering when reading searchParams (#46205) 2023-03-16 21:46:35 +01:00
pnpm-lock.yaml v13.5.5-canary.2 2023-10-04 19:01:01 +00:00
pnpm-workspace.yaml Remove next-dev and its test suite and benchmarks (#55983) 2023-09-26 05:22:39 +02:00
readme.md Monorepo (#5341) 2018-10-01 01:02:10 +02:00
release.js Fix labels for release sections 2021-11-21 13:11:54 +01:00
run-tests.js turbopack: only skip known flakey test cases (#55976) 2023-09-26 16:58:34 +02:00
rust-toolchain Update rust toolchain to nightly-2023-09-21 (#55774) 2023-09-22 19:12:25 +00:00
socket.yaml chore(ci): add socket.yaml (#54446) 2023-08-23 18:12:51 +00:00
test-file.txt Add additional file serving tests (#12479) 2020-05-04 11:58:19 -05:00
tsconfig-tsec.json Integrate tsec into the linting process (#33746) 2022-02-24 16:59:18 -08:00
tsconfig.json perf: replace zod with superstruct (#56083) 2023-09-28 11:05:36 +02:00
tsec-exemptions.json Move core files to src folder and move JS files to TypeScript (#44405) 2023-01-03 10:05:50 +01:00
turbo.json Implement granular rust caching (#54582) 2023-08-26 18:54:14 -07:00
UPGRADING.md (Fix)Broken upgrading.mdx link (#54234) 2023-08-18 17:10:38 +00:00
vercel.json Silence GH Comments for Preview URLs (#18766) 2020-11-03 21:59:47 +00:00

Next.js

Getting Started

Visit https://nextjs.org/learn to get started with Next.js.

Documentation

Visit https://nextjs.org/docs to view the full documentation.

Who is using Next.js?

Next.js is used by the world's leading companies. Check out the Next.js Showcase to learn more.

Community

The Next.js community can be found on GitHub Discussions, where you can ask questions, voice ideas, and share your projects.

To chat with other community members you can join the Next.js Discord.

Our Code of Conduct applies to all Next.js community channels.

Contributing

Please see our contributing.md.

Good First Issues

We have a list of good first issues that contain bugs that have a relatively limited scope. This is a great place to get started, gain experience, and get familiar with our contribution process.

Authors

Security

If you believe you have found a security vulnerability in Next.js, we encourage you to responsibly disclose this and not open a public issue. We will investigate all legitimate reports. Email security@vercel.com to disclose any security vulnerabilities.

https://vercel.com/security