Skip to content

Commit

Permalink
Merge branch 'canary' into use-fs-existsSync
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] committed Oct 3, 2023
2 parents 0b3630a + 09b0ca4 commit a3572fd
Show file tree
Hide file tree
Showing 210 changed files with 61,044 additions and 8,682 deletions.
2 changes: 1 addition & 1 deletion lerna.json
Expand Up @@ -16,5 +16,5 @@
"registry": "https://registry.npmjs.org/"
}
},
"version": "13.5.4"
"version": "13.5.5-canary.0"
}
18 changes: 10 additions & 8 deletions package.json
Expand Up @@ -192,14 +192,16 @@
"random-seed": "0.3.0",
"react": "18.2.0",
"react-17": "npm:react@17.0.2",
"react-builtin": "npm:react@18.3.0-canary-09285d5a7-20230925",
"react-builtin": "npm:react@18.3.0-canary-d900fadbf-20230929",
"react-dom": "18.2.0",
"react-dom-17": "npm:react-dom@17.0.2",
"react-dom-builtin": "npm:react-dom@18.3.0-canary-09285d5a7-20230925",
"react-dom-experimental-builtin": "npm:react-dom@0.0.0-experimental-09285d5a7-20230925",
"react-experimental-builtin": "npm:react@0.0.0-experimental-09285d5a7-20230925",
"react-server-dom-webpack": "18.3.0-canary-09285d5a7-20230925",
"react-server-dom-webpack-experimental": "npm:react-server-dom-webpack@0.0.0-experimental-09285d5a7-20230925",
"react-dom-builtin": "npm:react-dom@18.3.0-canary-d900fadbf-20230929",
"react-dom-experimental-builtin": "npm:react-dom@0.0.0-experimental-d900fadbf-20230929",
"react-experimental-builtin": "npm:react@0.0.0-experimental-d900fadbf-20230929",
"react-server-dom-turbopack": "18.3.0-canary-d900fadbf-20230929",
"react-server-dom-turbopack-experimental": "npm:react-server-dom-webpack@0.0.0-experimental-d900fadbf-20230929",
"react-server-dom-webpack": "18.3.0-canary-d900fadbf-20230929",
"react-server-dom-webpack-experimental": "npm:react-server-dom-webpack@0.0.0-experimental-d900fadbf-20230929",
"react-ssr-prepass": "1.0.8",
"react-virtualized": "9.22.3",
"relay-compiler": "13.0.2",
Expand All @@ -209,8 +211,8 @@
"resolve-from": "5.0.0",
"sass": "1.54.0",
"satori": "0.10.6",
"scheduler-builtin": "npm:scheduler@0.24.0-canary-09285d5a7-20230925",
"scheduler-experimental-builtin": "npm:scheduler@0.0.0-experimental-09285d5a7-20230925",
"scheduler-builtin": "npm:scheduler@0.24.0-canary-d900fadbf-20230929",
"scheduler-experimental-builtin": "npm:scheduler@0.0.0-experimental-d900fadbf-20230929",
"seedrandom": "3.0.5",
"selenium-webdriver": "4.0.0-beta.4",
"semver": "7.3.7",
Expand Down
2 changes: 1 addition & 1 deletion packages/create-next-app/package.json
@@ -1,6 +1,6 @@
{
"name": "create-next-app",
"version": "13.5.4",
"version": "13.5.5-canary.0",
"keywords": [
"react",
"next",
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-config-next/package.json
@@ -1,6 +1,6 @@
{
"name": "eslint-config-next",
"version": "13.5.4",
"version": "13.5.5-canary.0",
"description": "ESLint configuration used by Next.js.",
"main": "index.js",
"license": "MIT",
Expand All @@ -10,7 +10,7 @@
},
"homepage": "https://nextjs.org/docs/app/building-your-application/configuring/eslint#eslint-config",
"dependencies": {
"@next/eslint-plugin-next": "13.5.4",
"@next/eslint-plugin-next": "13.5.5-canary.0",
"@rushstack/eslint-patch": "^1.3.3",
"@typescript-eslint/parser": "^5.4.2 || ^6.0.0",
"eslint-import-resolver-node": "^0.3.6",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-next/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/eslint-plugin-next",
"version": "13.5.4",
"version": "13.5.5-canary.0",
"description": "ESLint plugin for Next.js.",
"main": "dist/index.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/font/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/font",
"version": "13.5.4",
"version": "13.5.5-canary.0",
"repository": {
"url": "vercel/next.js",
"directory": "packages/font"
Expand Down
2 changes: 1 addition & 1 deletion packages/next-bundle-analyzer/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/bundle-analyzer",
"version": "13.5.4",
"version": "13.5.5-canary.0",
"main": "index.js",
"types": "index.d.ts",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-codemod/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/codemod",
"version": "13.5.4",
"version": "13.5.5-canary.0",
"license": "MIT",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-env/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/env",
"version": "13.5.4",
"version": "13.5.5-canary.0",
"keywords": [
"react",
"next",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-mdx/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/mdx",
"version": "13.5.4",
"version": "13.5.5-canary.0",
"main": "index.js",
"license": "MIT",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/next-plugin-storybook/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/plugin-storybook",
"version": "13.5.4",
"version": "13.5.5-canary.0",
"repository": {
"url": "vercel/next.js",
"directory": "packages/next-plugin-storybook"
Expand Down
2 changes: 1 addition & 1 deletion packages/next-polyfill-module/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/polyfill-module",
"version": "13.5.4",
"version": "13.5.5-canary.0",
"description": "A standard library polyfill for ES Modules supporting browsers (Edge 16+, Firefox 60+, Chrome 61+, Safari 10.1+)",
"main": "dist/polyfill-module.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-polyfill-nomodule/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/polyfill-nomodule",
"version": "13.5.4",
"version": "13.5.5-canary.0",
"description": "A polyfill for non-dead, nomodule browsers.",
"main": "dist/polyfill-nomodule.js",
"license": "MIT",
Expand Down
5 changes: 5 additions & 0 deletions packages/next-swc/crates/next-api/src/app.rs
Expand Up @@ -212,6 +212,7 @@ impl AppProject {
"next-dynamic".to_string(),
Vc::upcast(NextDynamicTransition::new(self.client_transition())),
),
("next-ssr".to_string(), Vc::upcast(self.ssr_transition())),
]
.into_iter()
.collect();
Expand Down Expand Up @@ -636,6 +637,10 @@ impl AppEndpoint {
client_references_chunks,
this.app_project.project().client_chunking_context(),
Vc::upcast(this.app_project.project().ssr_chunking_context()),
this.app_project
.project()
.next_config()
.computed_asset_prefix(),
);
server_assets.push(entry_manifest);
}
Expand Down
Expand Up @@ -239,6 +239,7 @@ pub async fn get_app_entries(
/// to `all_chunks`, and the chunking information will be added to the provided
/// manifests.
pub async fn compute_app_entries_chunks(
next_config: Vc<NextConfig>,
app_entries: &AppEntries,
app_client_reference_graph: Vc<ClientReferenceGraph>,
app_client_references_chunks: Vc<ClientReferencesChunks>,
Expand Down Expand Up @@ -340,6 +341,7 @@ pub async fn compute_app_entries_chunks(
app_client_references_chunks,
client_chunking_context,
ssr_chunking_context,
next_config.computed_asset_prefix(),
);

all_chunks.push(entry_manifest);
Expand Down
1 change: 1 addition & 0 deletions packages/next-swc/crates/next-build/src/next_build.rs
Expand Up @@ -331,6 +331,7 @@ pub(crate) async fn next_build(options: TransientInstance<BuildOptions>) -> Resu
// TODO(alexkirsz) Do some of that in parallel with the above.

compute_app_entries_chunks(
next_config,
&app_entries,
app_client_references,
app_client_references_chunks,
Expand Down
50 changes: 40 additions & 10 deletions packages/next-swc/crates/next-core/src/next_import_map.rs
Expand Up @@ -89,6 +89,14 @@ pub async fn get_next_client_import_map(
);
}
ClientContextType::App { app_dir } => {
import_map.insert_exact_alias(
"server-only",
request_to_import_mapping(app_dir, "next/dist/compiled/server-only"),
);
import_map.insert_exact_alias(
"client-only",
request_to_import_mapping(app_dir, "next/dist/compiled/client-only"),
);
import_map.insert_exact_alias(
"react",
request_to_import_mapping(app_dir, "next/dist/compiled/react"),
Expand All @@ -107,7 +115,10 @@ pub async fn get_next_client_import_map(
);
import_map.insert_wildcard_alias(
"react-server-dom-webpack/",
request_to_import_mapping(app_dir, "next/dist/compiled/react-server-dom-webpack/*"),
request_to_import_mapping(
app_dir,
"next/dist/compiled/react-server-dom-turbopack/*",
),
);
import_map.insert_exact_alias(
"next/head",
Expand Down Expand Up @@ -238,7 +249,6 @@ pub async fn get_next_server_import_map(
import_map.insert_wildcard_alias("react-dom/", external);
import_map.insert_exact_alias("styled-jsx", external);
import_map.insert_wildcard_alias("styled-jsx/", external);
import_map.insert_wildcard_alias("react-server-dom-webpack/", external);
// TODO: we should not bundle next/dist/build/utils in the pages renderer at all
import_map.insert_wildcard_alias("next/dist/build/utils", external);
}
Expand All @@ -253,6 +263,10 @@ pub async fn get_next_server_import_map(
"next/dynamic",
request_to_import_mapping(project_path, "next/dist/shared/lib/app-dynamic"),
);
import_map.insert_exact_alias(
"react-server-dom-webpack/",
ImportMapping::External(Some("react-server-dom-turbopack".into())).cell(),
);
}
ServerContextType::Middleware => {}
}
Expand Down Expand Up @@ -487,11 +501,13 @@ async fn insert_next_server_special_aliases(
app_dir,
match runtime {
NextRuntime::Edge => {
"next/dist/compiled/react-server-dom-webpack/client.edge"
"next/dist/compiled/react-server-dom-turbopack/client.edge"
}
// When we access the runtime we still use the webpack name. The runtime
// itself will substitute in the turbopack variant
NextRuntime::NodeJs => {
"next/dist/server/future/route-modules/app-page/vendored/ssr/\
react-server-dom-webpack-client-edge"
react-server-dom-turbopack-client-edge"
}
},
),
Expand All @@ -505,11 +521,13 @@ async fn insert_next_server_special_aliases(
app_dir,
match runtime {
NextRuntime::Edge => {
"next/dist/compiled/react-server-dom-webpack/client.edge"
"next/dist/compiled/react-server-dom-turbopack/client.edge"
}
// When we access the runtime we still use the webpack name. The runtime
// itself will substitute in the turbopack variant
NextRuntime::NodeJs => {
"next/dist/server/future/route-modules/app-page/vendored/ssr/\
react-server-dom-webpack-client-edge"
react-server-dom-turbopack-client-edge"
}
},
),
Expand Down Expand Up @@ -580,6 +598,14 @@ async fn insert_next_server_special_aliases(
},
),
);
import_map.insert_exact_alias(
"server-only",
request_to_import_mapping(app_dir, "next/dist/compiled/server-only"),
);
import_map.insert_exact_alias(
"client-only",
request_to_import_mapping(app_dir, "next/dist/compiled/client-only"),
);
import_map.insert_exact_alias(
"react",
request_to_import_mapping(
Expand Down Expand Up @@ -610,11 +636,13 @@ async fn insert_next_server_special_aliases(
app_dir,
match runtime {
NextRuntime::Edge => {
"next/dist/compiled/react-server-dom-webpack/server.edge"
"next/dist/compiled/react-server-dom-turbopack/server.edge"
}
// When we access the runtime we still use the webpack name. The runtime
// itself will substitute in the turbopack variant
NextRuntime::NodeJs => {
"next/dist/server/future/route-modules/app-page/vendored/rsc/\
react-server-dom-webpack-server-edge"
react-server-dom-turbopack-server-edge"
}
},
),
Expand All @@ -625,11 +653,13 @@ async fn insert_next_server_special_aliases(
app_dir,
match runtime {
NextRuntime::Edge => {
"next/dist/compiled/react-server-dom-webpack/server.node"
"next/dist/compiled/react-server-dom-turbopack/server.node"
}
// When we access the runtime we still use the webpack name. The runtime
// itself will substitute in the turbopack variant
NextRuntime::NodeJs => {
"next/dist/server/future/route-modules/app-page/vendored/rsc/\
react-server-dom-webpack-server-node"
react-server-dom-turbopack-server-node"
}
},
),
Expand Down
Expand Up @@ -30,8 +30,15 @@ impl ClientReferenceManifest {
client_references_chunks: Vc<ClientReferencesChunks>,
client_chunking_context: Vc<Box<dyn EcmascriptChunkingContext>>,
ssr_chunking_context: Vc<Box<dyn EcmascriptChunkingContext>>,
asset_prefix: Vc<Option<String>>,
) -> Result<Vc<Box<dyn OutputAsset>>> {
let mut entry_manifest: ClientReferenceManifest = Default::default();
entry_manifest.module_loading.prefix = asset_prefix
.await?
.as_ref()
.map(|p| p.to_owned())
.unwrap_or_default();
entry_manifest.module_loading.cross_origin = None;
let client_references_chunks = client_references_chunks.await?;
let client_relative_path = client_relative_path.await?;
let node_root_ref = node_root.await?;
Expand Down
8 changes: 8 additions & 0 deletions packages/next-swc/crates/next-core/src/next_manifests/mod.rs
Expand Up @@ -178,6 +178,7 @@ pub enum ActionManifestWorkerEntry {
#[derive(Serialize, Default, Debug)]
#[serde(rename_all = "camelCase")]
pub struct ClientReferenceManifest {
pub module_loading: ModuleLoading,
/// Mapping of module path and export name to client module ID and required
/// client chunks.
pub client_modules: ManifestNode,
Expand All @@ -192,6 +193,13 @@ pub struct ClientReferenceManifest {
pub entry_css_files: HashMap<String, Vec<String>>,
}

#[derive(Serialize, Default, Debug)]
#[serde(rename_all = "camelCase")]
pub struct ModuleLoading {
pub prefix: String,
pub cross_origin: Option<String>,
}

#[derive(Serialize, Default, Debug)]
#[serde(rename_all = "camelCase")]
pub struct ManifestNode {
Expand Down
2 changes: 1 addition & 1 deletion packages/next-swc/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/swc",
"version": "13.5.4",
"version": "13.5.5-canary.0",
"private": true,
"scripts": {
"clean": "node ../../scripts/rm.mjs native",
Expand Down
14 changes: 7 additions & 7 deletions packages/next/package.json
@@ -1,6 +1,6 @@
{
"name": "next",
"version": "13.5.4",
"version": "13.5.5-canary.0",
"description": "The React Framework",
"main": "./dist/server/next.js",
"license": "MIT",
Expand Down Expand Up @@ -90,7 +90,7 @@
]
},
"dependencies": {
"@next/env": "13.5.4",
"@next/env": "13.5.5-canary.0",
"@swc/helpers": "0.5.2",
"busboy": "1.6.0",
"caniuse-lite": "^1.0.30001406",
Expand Down Expand Up @@ -144,11 +144,11 @@
"@mswjs/interceptors": "0.23.0",
"@napi-rs/cli": "2.16.2",
"@napi-rs/triples": "1.1.0",
"@next/polyfill-module": "13.5.4",
"@next/polyfill-nomodule": "13.5.4",
"@next/react-dev-overlay": "13.5.4",
"@next/react-refresh-utils": "13.5.4",
"@next/swc": "13.5.4",
"@next/polyfill-module": "13.5.5-canary.0",
"@next/polyfill-nomodule": "13.5.5-canary.0",
"@next/react-dev-overlay": "13.5.5-canary.0",
"@next/react-refresh-utils": "13.5.5-canary.0",
"@next/swc": "13.5.5-canary.0",
"@opentelemetry/api": "1.4.1",
"@playwright/test": "^1.35.1",
"@segment/ajv-human-errors": "2.1.2",
Expand Down
6 changes: 6 additions & 0 deletions packages/next/src/build/deployment-id.ts
@@ -0,0 +1,6 @@
export function getDeploymentIdQueryOrEmptyString(): string {
if (process.env.NEXT_DEPLOYMENT_ID) {
return `?dpl=${process.env.NEXT_DEPLOYMENT_ID}`
}
return ''
}

0 comments on commit a3572fd

Please sign in to comment.