Skip to content

Commit 5c6ea29

Browse files
committed
Revert "App Router - preinitialize chunks during SSR (#54752)"
This reverts commit 09b0ca4.
1 parent 8fdd713 commit 5c6ea29

File tree

192 files changed

+8651
-60998
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

192 files changed

+8651
-60998
lines changed

package.json

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -192,16 +192,14 @@
192192
"random-seed": "0.3.0",
193193
"react": "18.2.0",
194194
"react-17": "npm:[email protected]",
195-
"react-builtin": "npm:[email protected]d900fadbf-20230929",
195+
"react-builtin": "npm:[email protected]09285d5a7-20230925",
196196
"react-dom": "18.2.0",
197197
"react-dom-17": "npm:[email protected]",
198-
"react-dom-builtin": "npm:[email protected]",
199-
"react-dom-experimental-builtin": "npm:[email protected]",
200-
"react-experimental-builtin": "npm:[email protected]",
201-
"react-server-dom-turbopack": "18.3.0-canary-d900fadbf-20230929",
202-
"react-server-dom-turbopack-experimental": "npm:[email protected]",
203-
"react-server-dom-webpack": "18.3.0-canary-d900fadbf-20230929",
204-
"react-server-dom-webpack-experimental": "npm:[email protected]",
198+
"react-dom-builtin": "npm:[email protected]",
199+
"react-dom-experimental-builtin": "npm:[email protected]",
200+
"react-experimental-builtin": "npm:[email protected]",
201+
"react-server-dom-webpack": "18.3.0-canary-09285d5a7-20230925",
202+
"react-server-dom-webpack-experimental": "npm:[email protected]",
205203
"react-ssr-prepass": "1.0.8",
206204
"react-virtualized": "9.22.3",
207205
"relay-compiler": "13.0.2",
@@ -211,8 +209,8 @@
211209
"resolve-from": "5.0.0",
212210
"sass": "1.54.0",
213211
"satori": "0.10.6",
214-
"scheduler-builtin": "npm:[email protected]d900fadbf-20230929",
215-
"scheduler-experimental-builtin": "npm:[email protected]d900fadbf-20230929",
212+
"scheduler-builtin": "npm:[email protected]09285d5a7-20230925",
213+
"scheduler-experimental-builtin": "npm:[email protected]09285d5a7-20230925",
216214
"seedrandom": "3.0.5",
217215
"selenium-webdriver": "4.0.0-beta.4",
218216
"semver": "7.3.7",

packages/next-swc/crates/next-api/src/app.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,6 @@ impl AppProject {
214214
"next-dynamic".to_string(),
215215
Vc::upcast(NextDynamicTransition::new(self.client_transition())),
216216
),
217-
("next-ssr".to_string(), Vc::upcast(self.ssr_transition())),
218217
]
219218
.into_iter()
220219
.collect();
@@ -644,10 +643,6 @@ impl AppEndpoint {
644643
client_references_chunks,
645644
this.app_project.project().client_chunking_context(),
646645
Vc::upcast(this.app_project.project().ssr_chunking_context()),
647-
this.app_project
648-
.project()
649-
.next_config()
650-
.computed_asset_prefix(),
651646
);
652647
server_assets.push(entry_manifest);
653648
}

packages/next-swc/crates/next-build/src/next_app/app_entries.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,6 @@ pub async fn get_app_entries(
242242
/// to `all_chunks`, and the chunking information will be added to the provided
243243
/// manifests.
244244
pub async fn compute_app_entries_chunks(
245-
next_config: Vc<NextConfig>,
246245
app_entries: &AppEntries,
247246
app_client_reference_graph: Vc<ClientReferenceGraph>,
248247
app_client_references_chunks: Vc<ClientReferencesChunks>,
@@ -351,7 +350,6 @@ pub async fn compute_app_entries_chunks(
351350
app_client_references_chunks,
352351
client_chunking_context,
353352
ssr_chunking_context,
354-
next_config.computed_asset_prefix(),
355353
);
356354

357355
all_chunks.push(entry_manifest);

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,6 @@ pub(crate) async fn next_build(options: TransientInstance<BuildOptions>) -> Resu
336336
// TODO(alexkirsz) Do some of that in parallel with the above.
337337

338338
compute_app_entries_chunks(
339-
next_config,
340339
&app_entries,
341340
app_client_references,
342341
app_client_references_chunks,

packages/next-swc/crates/next-core/src/next_import_map.rs

Lines changed: 14 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,6 @@ pub async fn get_next_client_import_map(
9494
} else {
9595
""
9696
};
97-
import_map.insert_exact_alias(
98-
"server-only",
99-
request_to_import_mapping(app_dir, "next/dist/compiled/server-only"),
100-
);
101-
import_map.insert_exact_alias(
102-
"client-only",
103-
request_to_import_mapping(app_dir, "next/dist/compiled/client-only"),
104-
);
10597
import_map.insert_exact_alias(
10698
"react",
10799
request_to_import_mapping(
@@ -134,7 +126,7 @@ pub async fn get_next_client_import_map(
134126
"react-server-dom-webpack/",
135127
request_to_import_mapping(
136128
app_dir,
137-
&format!("next/dist/compiled/react-server-dom-turbopack{react_flavor}/*"),
129+
&format!("next/dist/compiled/react-server-dom-webpack{react_flavor}/*"),
138130
),
139131
);
140132
import_map.insert_exact_alias(
@@ -267,6 +259,7 @@ pub async fn get_next_server_import_map(
267259
import_map.insert_wildcard_alias("react-dom/", external);
268260
import_map.insert_exact_alias("styled-jsx", external);
269261
import_map.insert_wildcard_alias("styled-jsx/", external);
262+
import_map.insert_wildcard_alias("react-server-dom-webpack/", external);
270263
// TODO: we should not bundle next/dist/build/utils in the pages renderer at all
271264
import_map.insert_wildcard_alias("next/dist/build/utils", external);
272265
}
@@ -288,10 +281,6 @@ pub async fn get_next_server_import_map(
288281
"next/dynamic",
289282
request_to_import_mapping(project_path, "next/dist/shared/lib/app-dynamic"),
290283
);
291-
import_map.insert_exact_alias(
292-
"react-server-dom-webpack/",
293-
ImportMapping::External(Some("react-server-dom-turbopack".into())).cell(),
294-
);
295284
}
296285
ServerContextType::Middleware => {}
297286
}
@@ -544,16 +533,14 @@ async fn insert_next_server_special_aliases(
544533
app_dir,
545534
match (runtime, server_actions) {
546535
(NextRuntime::Edge, true) => {
547-
"next/dist/compiled/react-server-dom-turbopack-experimental/client.edge"
536+
"next/dist/compiled/react-server-dom-webpack-experimental/client.edge"
548537
}
549538
(NextRuntime::Edge, false) => {
550-
"next/dist/compiled/react-server-dom-turbopack/client.edge"
539+
"next/dist/compiled/react-server-dom-webpack/client.edge"
551540
}
552-
// When we access the runtime we still use the webpack name. The runtime
553-
// itself will substitute in the turbopack variant
554541
(NextRuntime::NodeJs, _) => {
555542
"next/dist/server/future/route-modules/app-page/vendored/ssr/\
556-
react-server-dom-turbopack-client-edge"
543+
react-server-dom-webpack-client-edge"
557544
}
558545
},
559546
),
@@ -567,16 +554,14 @@ async fn insert_next_server_special_aliases(
567554
app_dir,
568555
match (runtime, server_actions) {
569556
(NextRuntime::Edge, true) => {
570-
"next/dist/compiled/react-server-dom-turbopack-experimental/client.edge"
557+
"next/dist/compiled/react-server-dom-webpack-experimental/client.edge"
571558
}
572559
(NextRuntime::Edge, false) => {
573-
"next/dist/compiled/react-server-dom-turbopack/client.edge"
560+
"next/dist/compiled/react-server-dom-webpack/client.edge"
574561
}
575-
// When we access the runtime we still use the webpack name. The runtime
576-
// itself will substitute in the turbopack variant
577562
(NextRuntime::NodeJs, _) => {
578563
"next/dist/server/future/route-modules/app-page/vendored/ssr/\
579-
react-server-dom-turbopack-client-edge"
564+
react-server-dom-webpack-client-edge"
580565
}
581566
},
582567
),
@@ -669,14 +654,6 @@ async fn insert_next_server_special_aliases(
669654
},
670655
),
671656
);
672-
import_map.insert_exact_alias(
673-
"server-only",
674-
request_to_import_mapping(app_dir, "next/dist/compiled/server-only"),
675-
);
676-
import_map.insert_exact_alias(
677-
"client-only",
678-
request_to_import_mapping(app_dir, "next/dist/compiled/client-only"),
679-
);
680657
import_map.insert_exact_alias(
681658
"react",
682659
request_to_import_mapping(
@@ -709,16 +686,14 @@ async fn insert_next_server_special_aliases(
709686
app_dir,
710687
match (runtime, server_actions) {
711688
(NextRuntime::Edge, true) => {
712-
"next/dist/compiled/react-server-dom-turbopack-experimental/server.edge"
689+
"next/dist/compiled/react-server-dom-webpack-experimental/server.edge"
713690
}
714691
(NextRuntime::Edge, false) => {
715-
"next/dist/compiled/react-server-dom-turbopack/server.edge"
692+
"next/dist/compiled/react-server-dom-webpack/server.edge"
716693
}
717-
// When we access the runtime we still use the webpack name. The runtime
718-
// itself will substitute in the turbopack variant
719694
(NextRuntime::NodeJs, _) => {
720695
"next/dist/server/future/route-modules/app-page/vendored/rsc/\
721-
react-server-dom-turbopack-server-edge"
696+
react-server-dom-webpack-server-edge"
722697
}
723698
},
724699
),
@@ -729,16 +704,14 @@ async fn insert_next_server_special_aliases(
729704
app_dir,
730705
match (runtime, server_actions) {
731706
(NextRuntime::Edge, true) => {
732-
"next/dist/compiled/react-server-dom-turbopack-experimental/server.node"
707+
"next/dist/compiled/react-server-dom-webpack-experimental/server.node"
733708
}
734709
(NextRuntime::Edge, false) => {
735-
"next/dist/compiled/react-server-dom-turbopack/server.node"
710+
"next/dist/compiled/react-server-dom-webpack/server.node"
736711
}
737-
// When we access the runtime we still use the webpack name. The runtime
738-
// itself will substitute in the turbopack variant
739712
(NextRuntime::NodeJs, _) => {
740713
"next/dist/server/future/route-modules/app-page/vendored/rsc/\
741-
react-server-dom-turbopack-server-node"
714+
react-server-dom-webpack-server-node"
742715
}
743716
},
744717
),

packages/next-swc/crates/next-core/src/next_manifests/client_reference_manifest.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,8 @@ impl ClientReferenceManifest {
2929
client_references_chunks: Vc<ClientReferencesChunks>,
3030
client_chunking_context: Vc<Box<dyn EcmascriptChunkingContext>>,
3131
ssr_chunking_context: Vc<Box<dyn EcmascriptChunkingContext>>,
32-
asset_prefix: Vc<Option<String>>,
3332
) -> Result<Vc<Box<dyn OutputAsset>>> {
3433
let mut entry_manifest: ClientReferenceManifest = Default::default();
35-
entry_manifest.module_loading.prefix = asset_prefix
36-
.await?
37-
.as_ref()
38-
.map(|p| p.to_owned())
39-
.unwrap_or_default();
40-
entry_manifest.module_loading.cross_origin = None;
4134
let client_references_chunks = client_references_chunks.await?;
4235
let client_relative_path = client_relative_path.await?;
4336
let node_root_ref = node_root.await?;

packages/next-swc/crates/next-core/src/next_manifests/mod.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@ pub enum ActionLayer {
182182
#[derive(Serialize, Default, Debug)]
183183
#[serde(rename_all = "camelCase")]
184184
pub struct ClientReferenceManifest {
185-
pub module_loading: ModuleLoading,
186185
/// Mapping of module path and export name to client module ID and required
187186
/// client chunks.
188187
pub client_modules: ManifestNode,
@@ -197,13 +196,6 @@ pub struct ClientReferenceManifest {
197196
pub entry_css_files: HashMap<String, Vec<String>>,
198197
}
199198

200-
#[derive(Serialize, Default, Debug)]
201-
#[serde(rename_all = "camelCase")]
202-
pub struct ModuleLoading {
203-
pub prefix: String,
204-
pub cross_origin: Option<String>,
205-
}
206-
207199
#[derive(Serialize, Default, Debug)]
208200
#[serde(rename_all = "camelCase")]
209201
pub struct ManifestNode {

packages/next/src/build/deployment-id.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)