feca3ce21c
### 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> |
||
---|---|---|
.. | ||
browsers | ||
next-modes | ||
amp-test-utils.js | ||
create-next-install.js | ||
development-sandbox.ts | ||
e2e-utils.ts | ||
flat-map-polyfill.js | ||
mocks-require-hook.js | ||
next-test-utils.ts | ||
next-webdriver.ts | ||
react-channel-require-hook.js | ||
turbo.ts | ||
use-temp-dir.ts |