Skip to content

Commit a3572fd

Browse files
Merge branch 'canary' into use-fs-existsSync
2 parents 0b3630a + 09b0ca4 commit a3572fd

File tree

210 files changed

+61044
-8682
lines changed

Some content is hidden

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

210 files changed

+61044
-8682
lines changed

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@
1616
"registry": "https://registry.npmjs.org/"
1717
}
1818
},
19-
"version": "13.5.4"
19+
"version": "13.5.5-canary.0"
2020
}

package.json

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -192,14 +192,16 @@
192192
"random-seed": "0.3.0",
193193
"react": "18.2.0",
194194
"react-17": "npm:[email protected]",
195-
"react-builtin": "npm:[email protected]09285d5a7-20230925",
195+
"react-builtin": "npm:[email protected]d900fadbf-20230929",
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-webpack": "18.3.0-canary-09285d5a7-20230925",
202-
"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-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]",
203205
"react-ssr-prepass": "1.0.8",
204206
"react-virtualized": "9.22.3",
205207
"relay-compiler": "13.0.2",
@@ -209,8 +211,8 @@
209211
"resolve-from": "5.0.0",
210212
"sass": "1.54.0",
211213
"satori": "0.10.6",
212-
"scheduler-builtin": "npm:[email protected]09285d5a7-20230925",
213-
"scheduler-experimental-builtin": "npm:[email protected]09285d5a7-20230925",
214+
"scheduler-builtin": "npm:[email protected]d900fadbf-20230929",
215+
"scheduler-experimental-builtin": "npm:[email protected]d900fadbf-20230929",
214216
"seedrandom": "3.0.5",
215217
"selenium-webdriver": "4.0.0-beta.4",
216218
"semver": "7.3.7",

packages/create-next-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "create-next-app",
3-
"version": "13.5.4",
3+
"version": "13.5.5-canary.0",
44
"keywords": [
55
"react",
66
"next",

packages/eslint-config-next/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eslint-config-next",
3-
"version": "13.5.4",
3+
"version": "13.5.5-canary.0",
44
"description": "ESLint configuration used by Next.js.",
55
"main": "index.js",
66
"license": "MIT",
@@ -10,7 +10,7 @@
1010
},
1111
"homepage": "https://nextjs.org/docs/app/building-your-application/configuring/eslint#eslint-config",
1212
"dependencies": {
13-
"@next/eslint-plugin-next": "13.5.4",
13+
"@next/eslint-plugin-next": "13.5.5-canary.0",
1414
"@rushstack/eslint-patch": "^1.3.3",
1515
"@typescript-eslint/parser": "^5.4.2 || ^6.0.0",
1616
"eslint-import-resolver-node": "^0.3.6",

packages/eslint-plugin-next/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/eslint-plugin-next",
3-
"version": "13.5.4",
3+
"version": "13.5.5-canary.0",
44
"description": "ESLint plugin for Next.js.",
55
"main": "dist/index.js",
66
"license": "MIT",

packages/font/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/font",
3-
"version": "13.5.4",
3+
"version": "13.5.5-canary.0",
44
"repository": {
55
"url": "vercel/next.js",
66
"directory": "packages/font"

packages/next-bundle-analyzer/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/bundle-analyzer",
3-
"version": "13.5.4",
3+
"version": "13.5.5-canary.0",
44
"main": "index.js",
55
"types": "index.d.ts",
66
"license": "MIT",

packages/next-codemod/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/codemod",
3-
"version": "13.5.4",
3+
"version": "13.5.5-canary.0",
44
"license": "MIT",
55
"repository": {
66
"type": "git",

packages/next-env/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/env",
3-
"version": "13.5.4",
3+
"version": "13.5.5-canary.0",
44
"keywords": [
55
"react",
66
"next",

packages/next-mdx/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/mdx",
3-
"version": "13.5.4",
3+
"version": "13.5.5-canary.0",
44
"main": "index.js",
55
"license": "MIT",
66
"repository": {

packages/next-plugin-storybook/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/plugin-storybook",
3-
"version": "13.5.4",
3+
"version": "13.5.5-canary.0",
44
"repository": {
55
"url": "vercel/next.js",
66
"directory": "packages/next-plugin-storybook"

packages/next-polyfill-module/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/polyfill-module",
3-
"version": "13.5.4",
3+
"version": "13.5.5-canary.0",
44
"description": "A standard library polyfill for ES Modules supporting browsers (Edge 16+, Firefox 60+, Chrome 61+, Safari 10.1+)",
55
"main": "dist/polyfill-module.js",
66
"license": "MIT",

packages/next-polyfill-nomodule/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/polyfill-nomodule",
3-
"version": "13.5.4",
3+
"version": "13.5.5-canary.0",
44
"description": "A polyfill for non-dead, nomodule browsers.",
55
"main": "dist/polyfill-nomodule.js",
66
"license": "MIT",

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ impl AppProject {
212212
"next-dynamic".to_string(),
213213
Vc::upcast(NextDynamicTransition::new(self.client_transition())),
214214
),
215+
("next-ssr".to_string(), Vc::upcast(self.ssr_transition())),
215216
]
216217
.into_iter()
217218
.collect();
@@ -636,6 +637,10 @@ impl AppEndpoint {
636637
client_references_chunks,
637638
this.app_project.project().client_chunking_context(),
638639
Vc::upcast(this.app_project.project().ssr_chunking_context()),
640+
this.app_project
641+
.project()
642+
.next_config()
643+
.computed_asset_prefix(),
639644
);
640645
server_assets.push(entry_manifest);
641646
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ pub async fn get_app_entries(
239239
/// to `all_chunks`, and the chunking information will be added to the provided
240240
/// manifests.
241241
pub async fn compute_app_entries_chunks(
242+
next_config: Vc<NextConfig>,
242243
app_entries: &AppEntries,
243244
app_client_reference_graph: Vc<ClientReferenceGraph>,
244245
app_client_references_chunks: Vc<ClientReferencesChunks>,
@@ -340,6 +341,7 @@ pub async fn compute_app_entries_chunks(
340341
app_client_references_chunks,
341342
client_chunking_context,
342343
ssr_chunking_context,
344+
next_config.computed_asset_prefix(),
343345
);
344346

345347
all_chunks.push(entry_manifest);

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

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

333333
compute_app_entries_chunks(
334+
next_config,
334335
&app_entries,
335336
app_client_references,
336337
app_client_references_chunks,

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

Lines changed: 40 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,14 @@ pub async fn get_next_client_import_map(
8989
);
9090
}
9191
ClientContextType::App { app_dir } => {
92+
import_map.insert_exact_alias(
93+
"server-only",
94+
request_to_import_mapping(app_dir, "next/dist/compiled/server-only"),
95+
);
96+
import_map.insert_exact_alias(
97+
"client-only",
98+
request_to_import_mapping(app_dir, "next/dist/compiled/client-only"),
99+
);
92100
import_map.insert_exact_alias(
93101
"react",
94102
request_to_import_mapping(app_dir, "next/dist/compiled/react"),
@@ -107,7 +115,10 @@ pub async fn get_next_client_import_map(
107115
);
108116
import_map.insert_wildcard_alias(
109117
"react-server-dom-webpack/",
110-
request_to_import_mapping(app_dir, "next/dist/compiled/react-server-dom-webpack/*"),
118+
request_to_import_mapping(
119+
app_dir,
120+
"next/dist/compiled/react-server-dom-turbopack/*",
121+
),
111122
);
112123
import_map.insert_exact_alias(
113124
"next/head",
@@ -238,7 +249,6 @@ pub async fn get_next_server_import_map(
238249
import_map.insert_wildcard_alias("react-dom/", external);
239250
import_map.insert_exact_alias("styled-jsx", external);
240251
import_map.insert_wildcard_alias("styled-jsx/", external);
241-
import_map.insert_wildcard_alias("react-server-dom-webpack/", external);
242252
// TODO: we should not bundle next/dist/build/utils in the pages renderer at all
243253
import_map.insert_wildcard_alias("next/dist/build/utils", external);
244254
}
@@ -253,6 +263,10 @@ pub async fn get_next_server_import_map(
253263
"next/dynamic",
254264
request_to_import_mapping(project_path, "next/dist/shared/lib/app-dynamic"),
255265
);
266+
import_map.insert_exact_alias(
267+
"react-server-dom-webpack/",
268+
ImportMapping::External(Some("react-server-dom-turbopack".into())).cell(),
269+
);
256270
}
257271
ServerContextType::Middleware => {}
258272
}
@@ -487,11 +501,13 @@ async fn insert_next_server_special_aliases(
487501
app_dir,
488502
match runtime {
489503
NextRuntime::Edge => {
490-
"next/dist/compiled/react-server-dom-webpack/client.edge"
504+
"next/dist/compiled/react-server-dom-turbopack/client.edge"
491505
}
506+
// When we access the runtime we still use the webpack name. The runtime
507+
// itself will substitute in the turbopack variant
492508
NextRuntime::NodeJs => {
493509
"next/dist/server/future/route-modules/app-page/vendored/ssr/\
494-
react-server-dom-webpack-client-edge"
510+
react-server-dom-turbopack-client-edge"
495511
}
496512
},
497513
),
@@ -505,11 +521,13 @@ async fn insert_next_server_special_aliases(
505521
app_dir,
506522
match runtime {
507523
NextRuntime::Edge => {
508-
"next/dist/compiled/react-server-dom-webpack/client.edge"
524+
"next/dist/compiled/react-server-dom-turbopack/client.edge"
509525
}
526+
// When we access the runtime we still use the webpack name. The runtime
527+
// itself will substitute in the turbopack variant
510528
NextRuntime::NodeJs => {
511529
"next/dist/server/future/route-modules/app-page/vendored/ssr/\
512-
react-server-dom-webpack-client-edge"
530+
react-server-dom-turbopack-client-edge"
513531
}
514532
},
515533
),
@@ -580,6 +598,14 @@ async fn insert_next_server_special_aliases(
580598
},
581599
),
582600
);
601+
import_map.insert_exact_alias(
602+
"server-only",
603+
request_to_import_mapping(app_dir, "next/dist/compiled/server-only"),
604+
);
605+
import_map.insert_exact_alias(
606+
"client-only",
607+
request_to_import_mapping(app_dir, "next/dist/compiled/client-only"),
608+
);
583609
import_map.insert_exact_alias(
584610
"react",
585611
request_to_import_mapping(
@@ -610,11 +636,13 @@ async fn insert_next_server_special_aliases(
610636
app_dir,
611637
match runtime {
612638
NextRuntime::Edge => {
613-
"next/dist/compiled/react-server-dom-webpack/server.edge"
639+
"next/dist/compiled/react-server-dom-turbopack/server.edge"
614640
}
641+
// When we access the runtime we still use the webpack name. The runtime
642+
// itself will substitute in the turbopack variant
615643
NextRuntime::NodeJs => {
616644
"next/dist/server/future/route-modules/app-page/vendored/rsc/\
617-
react-server-dom-webpack-server-edge"
645+
react-server-dom-turbopack-server-edge"
618646
}
619647
},
620648
),
@@ -625,11 +653,13 @@ async fn insert_next_server_special_aliases(
625653
app_dir,
626654
match runtime {
627655
NextRuntime::Edge => {
628-
"next/dist/compiled/react-server-dom-webpack/server.node"
656+
"next/dist/compiled/react-server-dom-turbopack/server.node"
629657
}
658+
// When we access the runtime we still use the webpack name. The runtime
659+
// itself will substitute in the turbopack variant
630660
NextRuntime::NodeJs => {
631661
"next/dist/server/future/route-modules/app-page/vendored/rsc/\
632-
react-server-dom-webpack-server-node"
662+
react-server-dom-turbopack-server-node"
633663
}
634664
},
635665
),

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,15 @@ impl ClientReferenceManifest {
3030
client_references_chunks: Vc<ClientReferencesChunks>,
3131
client_chunking_context: Vc<Box<dyn EcmascriptChunkingContext>>,
3232
ssr_chunking_context: Vc<Box<dyn EcmascriptChunkingContext>>,
33+
asset_prefix: Vc<Option<String>>,
3334
) -> Result<Vc<Box<dyn OutputAsset>>> {
3435
let mut entry_manifest: ClientReferenceManifest = Default::default();
36+
entry_manifest.module_loading.prefix = asset_prefix
37+
.await?
38+
.as_ref()
39+
.map(|p| p.to_owned())
40+
.unwrap_or_default();
41+
entry_manifest.module_loading.cross_origin = None;
3542
let client_references_chunks = client_references_chunks.await?;
3643
let client_relative_path = client_relative_path.await?;
3744
let node_root_ref = node_root.await?;

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ pub enum ActionManifestWorkerEntry {
178178
#[derive(Serialize, Default, Debug)]
179179
#[serde(rename_all = "camelCase")]
180180
pub struct ClientReferenceManifest {
181+
pub module_loading: ModuleLoading,
181182
/// Mapping of module path and export name to client module ID and required
182183
/// client chunks.
183184
pub client_modules: ManifestNode,
@@ -192,6 +193,13 @@ pub struct ClientReferenceManifest {
192193
pub entry_css_files: HashMap<String, Vec<String>>,
193194
}
194195

196+
#[derive(Serialize, Default, Debug)]
197+
#[serde(rename_all = "camelCase")]
198+
pub struct ModuleLoading {
199+
pub prefix: String,
200+
pub cross_origin: Option<String>,
201+
}
202+
195203
#[derive(Serialize, Default, Debug)]
196204
#[serde(rename_all = "camelCase")]
197205
pub struct ManifestNode {

packages/next-swc/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/swc",
3-
"version": "13.5.4",
3+
"version": "13.5.5-canary.0",
44
"private": true,
55
"scripts": {
66
"clean": "node ../../scripts/rm.mjs native",

packages/next/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "next",
3-
"version": "13.5.4",
3+
"version": "13.5.5-canary.0",
44
"description": "The React Framework",
55
"main": "./dist/server/next.js",
66
"license": "MIT",
@@ -90,7 +90,7 @@
9090
]
9191
},
9292
"dependencies": {
93-
"@next/env": "13.5.4",
93+
"@next/env": "13.5.5-canary.0",
9494
"@swc/helpers": "0.5.2",
9595
"busboy": "1.6.0",
9696
"caniuse-lite": "^1.0.30001406",
@@ -144,11 +144,11 @@
144144
"@mswjs/interceptors": "0.23.0",
145145
"@napi-rs/cli": "2.16.2",
146146
"@napi-rs/triples": "1.1.0",
147-
"@next/polyfill-module": "13.5.4",
148-
"@next/polyfill-nomodule": "13.5.4",
149-
"@next/react-dev-overlay": "13.5.4",
150-
"@next/react-refresh-utils": "13.5.4",
151-
"@next/swc": "13.5.4",
147+
"@next/polyfill-module": "13.5.5-canary.0",
148+
"@next/polyfill-nomodule": "13.5.5-canary.0",
149+
"@next/react-dev-overlay": "13.5.5-canary.0",
150+
"@next/react-refresh-utils": "13.5.5-canary.0",
151+
"@next/swc": "13.5.5-canary.0",
152152
"@opentelemetry/api": "1.4.1",
153153
"@playwright/test": "^1.35.1",
154154
"@segment/ajv-human-errors": "2.1.2",
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export function getDeploymentIdQueryOrEmptyString(): string {
2+
if (process.env.NEXT_DEPLOYMENT_ID) {
3+
return `?dpl=${process.env.NEXT_DEPLOYMENT_ID}`
4+
}
5+
return ''
6+
}

0 commit comments

Comments
 (0)