Skip to content

Commit ec19537

Browse files
authored
Named page chunks (#51921)
Depends on vercel/turborepo#5398 (and downstack) on the Turbo side. This PR makes it so the output path of Node.js entry chunks for pages is determined solely from the pathname. This isn't actually necessary for pages, but it makes for easier debugging anyway. See the Turbo PR for more details. This also changes the page structure so it also works if there is no `pages` directory. In this case, we still want to use pages' default _app, _document, and _error pages, even with existing app routes. So an empty page structure should still have an effect. ## Turbopack updates * vercel/turborepo#5415 <!-- Will Binns-Smith - Turbopack: Execution tests in node.js --> * vercel/turborepo#5461 <!-- Tobias Koppers - use a lock to ensure atomic invalidation from file changes --> * vercel/turborepo#5398 <!-- Alex Kirszenberg - Configure the path of the Node.js entry chunk --> * vercel/turborepo#5469 <!-- Tobias Koppers - allow hmr tests to correctly detect hmr event -->
1 parent 2743d0c commit ec19537

File tree

13 files changed

+327
-272
lines changed

13 files changed

+327
-272
lines changed

Cargo.lock

Lines changed: 37 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ swc_core = { version = "0.78.24" }
4242
testing = { version = "0.33.19" }
4343

4444
# Turbo crates
45-
turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230704.5" }
45+
turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230706.3" }
4646
# [TODO]: need to refactor embed_directory! macro usages, as well as resolving turbo_tasks::function, macros..
47-
turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230704.5" }
47+
turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230706.3" }
4848
# [TODO]: need to refactor embed_directory! macro usage in next-core
49-
turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230704.5" }
49+
turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230706.3" }
5050

5151
# General Deps
5252

packages/next-swc/crates/next-build/src/next_build.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ pub(crate) async fn next_build(options: TransientInstance<BuildOptions>) -> Resu
115115

116116
let page_chunks = get_page_chunks(
117117
pages_structure,
118+
next_router_root,
118119
project_root,
119120
execution_context,
120121
node_root,
@@ -411,9 +412,10 @@ pub(crate) async fn next_build(options: TransientInstance<BuildOptions>) -> Resu
411412
continue;
412413
}
413414

414-
let dependencies = pages_manifest
415+
let dependencies = build_manifest
415416
.pages
416417
.get(page)
418+
.unwrap()
417419
.iter()
418420
.map(|dep| dep.as_str())
419421
.filter(|dep| !app_dependencies.contains(*dep))

0 commit comments

Comments
 (0)