-
Notifications
You must be signed in to change notification settings - Fork 26.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 vercel/turborepo#5705 Co-authored-by: Tim Neutkens <6324199+timneutkens@users.noreply.github.com> Co-authored-by: Jiachi Liu <4800338+huozhi@users.noreply.github.com>
- Loading branch information
1 parent
ad42b61
commit feca3ce
Showing
33 changed files
with
805 additions
and
180 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -476,6 +476,7 @@ impl Project { | |
self.env(), | ||
self.server_addr(), | ||
this.define_env.nodejs(), | ||
self.next_config(), | ||
)) | ||
} | ||
|
||
|
Oops, something went wrong.