Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Node.js production runtime POC (#4998)
### Description This implements a Node.js production runtime for Turbopack, to first be used for `next build --turbo`, but that can easily be extended to support more production use cases (e.g. ncc). The runtime works differently from the dev runtime we're currently using for `next dev`: instead of having each chunk register itself against a global registry when evaluated, chunks export their module factories as a CommonJS default export. The runtime itself lives in a separate chunk, and then an "exported chunk" is generated that instantiates runtime entries and exports a given entry module. Corresponding Next.js PR: ~~vercel/next.js#49942 vercel/next.js#50375 --------- Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
- Loading branch information
Showing
264 changed files
with
5,557 additions
and
66,006 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
[package] | ||
name = "turbopack-build" | ||
version = "0.1.0" | ||
description = "TBD" | ||
license = "MPL-2.0" | ||
edition = "2021" | ||
autobenches = false | ||
|
||
[lib] | ||
bench = false | ||
|
||
[features] | ||
# enable "HMR" for embedded assets | ||
dynamic_embed_contents = ["turbo-tasks-fs/dynamic_embed_contents"] | ||
# enable test utilities such as `RuntimeType::Dummy` | ||
test = ["turbopack-ecmascript-runtime/test"] | ||
|
||
[dependencies] | ||
anyhow = { workspace = true } | ||
indexmap = { workspace = true } | ||
indoc = { workspace = true } | ||
serde = { workspace = true } | ||
serde_json = { workspace = true } | ||
serde_qs = { workspace = true } | ||
|
||
turbo-tasks = { workspace = true } | ||
turbo-tasks-fs = { workspace = true } | ||
turbopack-core = { workspace = true } | ||
turbopack-css = { workspace = true } | ||
turbopack-ecmascript = { workspace = true } | ||
turbopack-ecmascript-runtime = { workspace = true } | ||
|
||
[build-dependencies] | ||
turbo-tasks-build = { workspace = true } |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
use turbo_tasks_build::generate_register; | ||
|
||
fn main() { | ||
generate_register(); | ||
} |
Oops, something went wrong.
a066e12
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
turbo-site – ./docs
turbo.vercel.app
turbopack.org
www.turborepo.org
turbo-site.vercel.sh
turbo.vercel.sh
www.turborepo.com
www.turbopack.org
www.turbo.build
turbo.build
turborepo.org
turbo-site-git-main.vercel.sh