From 94709ef1b921792a79a893b85e2f63006a6d662c Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Fri, 4 Aug 2023 21:14:41 +0200 Subject: [PATCH] update turbopack and update code for API changes (#53576) * https://github.com/vercel/turbo/pull/5640 * https://github.com/vercel/turbo/pull/5661 --- Cargo.lock | 74 +++++++++---------- Cargo.toml | 6 +- .../crates/napi/src/next_api/utils.rs | 6 +- .../crates/next-build/src/next_build.rs | 2 +- .../next-swc/crates/next-core/js/package.json | 4 +- .../next-core/src/app_segment_config.rs | 2 +- .../crates/next-core/src/app_structure.rs | 2 +- .../next-swc/crates/next-core/src/babel.rs | 2 +- .../unsupported_dynamic_metadata_issue.rs | 2 +- .../next-core/src/next_client/context.rs | 4 +- .../crates/next-core/src/next_config.rs | 6 +- .../crates/next-core/src/next_edge/context.rs | 4 +- .../crates/next-core/src/next_font/issue.rs | 2 +- .../next-core/src/next_shared/resolve.rs | 6 +- .../next-swc/crates/next-core/src/router.rs | 2 +- .../next-swc/crates/next-core/src/util.rs | 2 +- .../next-dev-tests/tests/integration.rs | 4 +- packages/next/src/build/swc/index.ts | 2 +- .../src/server/lib/router-utils/setup-dev.ts | 2 +- pnpm-lock.yaml | 33 +++------ 20 files changed, 77 insertions(+), 90 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7ebef70088f16..135741a3eb7a5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -412,7 +412,7 @@ dependencies = [ [[package]] name = "auto-hash-map" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230803.2#04476ffc5fd912bf5c937fd7f1b103cbc7f27929" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230804.1#d8f738fcedd77b7d03685c969163e6e630deaea7" dependencies = [ "serde", ] @@ -3632,7 +3632,7 @@ dependencies = [ [[package]] name = "node-file-trace" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230803.2#04476ffc5fd912bf5c937fd7f1b103cbc7f27929" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230804.1#d8f738fcedd77b7d03685c969163e6e630deaea7" dependencies = [ "anyhow", "serde", @@ -7317,7 +7317,7 @@ dependencies = [ [[package]] name = "turbo-tasks" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230803.2#04476ffc5fd912bf5c937fd7f1b103cbc7f27929" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230804.1#d8f738fcedd77b7d03685c969163e6e630deaea7" dependencies = [ "anyhow", "async-trait", @@ -7349,7 +7349,7 @@ dependencies = [ [[package]] name = "turbo-tasks-build" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230803.2#04476ffc5fd912bf5c937fd7f1b103cbc7f27929" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230804.1#d8f738fcedd77b7d03685c969163e6e630deaea7" dependencies = [ "anyhow", "cargo-lock", @@ -7361,7 +7361,7 @@ dependencies = [ [[package]] name = "turbo-tasks-bytes" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230803.2#04476ffc5fd912bf5c937fd7f1b103cbc7f27929" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230804.1#d8f738fcedd77b7d03685c969163e6e630deaea7" dependencies = [ "anyhow", "bytes", @@ -7376,7 +7376,7 @@ dependencies = [ [[package]] name = "turbo-tasks-env" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230803.2#04476ffc5fd912bf5c937fd7f1b103cbc7f27929" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230804.1#d8f738fcedd77b7d03685c969163e6e630deaea7" dependencies = [ "anyhow", "dotenvs", @@ -7390,7 +7390,7 @@ dependencies = [ [[package]] name = "turbo-tasks-fetch" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230803.2#04476ffc5fd912bf5c937fd7f1b103cbc7f27929" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230804.1#d8f738fcedd77b7d03685c969163e6e630deaea7" dependencies = [ "anyhow", "indexmap 1.9.3", @@ -7407,7 +7407,7 @@ dependencies = [ [[package]] name = "turbo-tasks-fs" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230803.2#04476ffc5fd912bf5c937fd7f1b103cbc7f27929" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230804.1#d8f738fcedd77b7d03685c969163e6e630deaea7" dependencies = [ "anyhow", "auto-hash-map", @@ -7437,7 +7437,7 @@ dependencies = [ [[package]] name = "turbo-tasks-hash" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230803.2#04476ffc5fd912bf5c937fd7f1b103cbc7f27929" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230804.1#d8f738fcedd77b7d03685c969163e6e630deaea7" dependencies = [ "base16", "hex", @@ -7449,7 +7449,7 @@ dependencies = [ [[package]] name = "turbo-tasks-macros" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230803.2#04476ffc5fd912bf5c937fd7f1b103cbc7f27929" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230804.1#d8f738fcedd77b7d03685c969163e6e630deaea7" dependencies = [ "anyhow", "convert_case 0.6.0", @@ -7463,7 +7463,7 @@ dependencies = [ [[package]] name = "turbo-tasks-macros-shared" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230803.2#04476ffc5fd912bf5c937fd7f1b103cbc7f27929" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230804.1#d8f738fcedd77b7d03685c969163e6e630deaea7" dependencies = [ "proc-macro2", "quote", @@ -7473,7 +7473,7 @@ dependencies = [ [[package]] name = "turbo-tasks-malloc" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230803.2#04476ffc5fd912bf5c937fd7f1b103cbc7f27929" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230804.1#d8f738fcedd77b7d03685c969163e6e630deaea7" dependencies = [ "mimalloc", ] @@ -7481,7 +7481,7 @@ dependencies = [ [[package]] name = "turbo-tasks-memory" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230803.2#04476ffc5fd912bf5c937fd7f1b103cbc7f27929" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230804.1#d8f738fcedd77b7d03685c969163e6e630deaea7" dependencies = [ "anyhow", "auto-hash-map", @@ -7504,7 +7504,7 @@ dependencies = [ [[package]] name = "turbo-tasks-testing" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230803.2#04476ffc5fd912bf5c937fd7f1b103cbc7f27929" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230804.1#d8f738fcedd77b7d03685c969163e6e630deaea7" dependencies = [ "anyhow", "auto-hash-map", @@ -7517,7 +7517,7 @@ dependencies = [ [[package]] name = "turbopack" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230803.2#04476ffc5fd912bf5c937fd7f1b103cbc7f27929" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230804.1#d8f738fcedd77b7d03685c969163e6e630deaea7" dependencies = [ "anyhow", "async-recursion", @@ -7548,7 +7548,7 @@ dependencies = [ [[package]] name = "turbopack-bench" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230803.2#04476ffc5fd912bf5c937fd7f1b103cbc7f27929" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230804.1#d8f738fcedd77b7d03685c969163e6e630deaea7" dependencies = [ "anyhow", "chromiumoxide", @@ -7578,7 +7578,7 @@ dependencies = [ [[package]] name = "turbopack-binding" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230803.2#04476ffc5fd912bf5c937fd7f1b103cbc7f27929" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230804.1#d8f738fcedd77b7d03685c969163e6e630deaea7" dependencies = [ "auto-hash-map", "mdxjs", @@ -7620,7 +7620,7 @@ dependencies = [ [[package]] name = "turbopack-build" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230803.2#04476ffc5fd912bf5c937fd7f1b103cbc7f27929" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230804.1#d8f738fcedd77b7d03685c969163e6e630deaea7" dependencies = [ "anyhow", "indexmap 1.9.3", @@ -7642,7 +7642,7 @@ dependencies = [ [[package]] name = "turbopack-cli-utils" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230803.2#04476ffc5fd912bf5c937fd7f1b103cbc7f27929" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230804.1#d8f738fcedd77b7d03685c969163e6e630deaea7" dependencies = [ "anyhow", "clap 4.1.11", @@ -7666,7 +7666,7 @@ dependencies = [ [[package]] name = "turbopack-core" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230803.2#04476ffc5fd912bf5c937fd7f1b103cbc7f27929" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230804.1#d8f738fcedd77b7d03685c969163e6e630deaea7" dependencies = [ "anyhow", "async-recursion", @@ -7695,7 +7695,7 @@ dependencies = [ [[package]] name = "turbopack-create-test-app" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230803.2#04476ffc5fd912bf5c937fd7f1b103cbc7f27929" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230804.1#d8f738fcedd77b7d03685c969163e6e630deaea7" dependencies = [ "anyhow", "clap 4.1.11", @@ -7708,7 +7708,7 @@ dependencies = [ [[package]] name = "turbopack-css" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230803.2#04476ffc5fd912bf5c937fd7f1b103cbc7f27929" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230804.1#d8f738fcedd77b7d03685c969163e6e630deaea7" dependencies = [ "anyhow", "async-trait", @@ -7730,7 +7730,7 @@ dependencies = [ [[package]] name = "turbopack-dev" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230803.2#04476ffc5fd912bf5c937fd7f1b103cbc7f27929" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230804.1#d8f738fcedd77b7d03685c969163e6e630deaea7" dependencies = [ "anyhow", "indexmap 1.9.3", @@ -7754,7 +7754,7 @@ dependencies = [ [[package]] name = "turbopack-dev-server" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230803.2#04476ffc5fd912bf5c937fd7f1b103cbc7f27929" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230804.1#d8f738fcedd77b7d03685c969163e6e630deaea7" dependencies = [ "anyhow", "async-compression", @@ -7791,7 +7791,7 @@ dependencies = [ [[package]] name = "turbopack-ecmascript" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230803.2#04476ffc5fd912bf5c937fd7f1b103cbc7f27929" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230804.1#d8f738fcedd77b7d03685c969163e6e630deaea7" dependencies = [ "anyhow", "async-trait", @@ -7825,7 +7825,7 @@ dependencies = [ [[package]] name = "turbopack-ecmascript-hmr-protocol" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230803.2#04476ffc5fd912bf5c937fd7f1b103cbc7f27929" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230804.1#d8f738fcedd77b7d03685c969163e6e630deaea7" dependencies = [ "serde", "serde_json", @@ -7836,7 +7836,7 @@ dependencies = [ [[package]] name = "turbopack-ecmascript-plugins" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230803.2#04476ffc5fd912bf5c937fd7f1b103cbc7f27929" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230804.1#d8f738fcedd77b7d03685c969163e6e630deaea7" dependencies = [ "anyhow", "async-trait", @@ -7859,7 +7859,7 @@ dependencies = [ [[package]] name = "turbopack-ecmascript-runtime" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230803.2#04476ffc5fd912bf5c937fd7f1b103cbc7f27929" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230804.1#d8f738fcedd77b7d03685c969163e6e630deaea7" dependencies = [ "anyhow", "indoc", @@ -7876,7 +7876,7 @@ dependencies = [ [[package]] name = "turbopack-env" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230803.2#04476ffc5fd912bf5c937fd7f1b103cbc7f27929" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230804.1#d8f738fcedd77b7d03685c969163e6e630deaea7" dependencies = [ "anyhow", "indexmap 1.9.3", @@ -7892,7 +7892,7 @@ dependencies = [ [[package]] name = "turbopack-image" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230803.2#04476ffc5fd912bf5c937fd7f1b103cbc7f27929" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230804.1#d8f738fcedd77b7d03685c969163e6e630deaea7" dependencies = [ "anyhow", "base64 0.21.0", @@ -7912,7 +7912,7 @@ dependencies = [ [[package]] name = "turbopack-json" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230803.2#04476ffc5fd912bf5c937fd7f1b103cbc7f27929" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230804.1#d8f738fcedd77b7d03685c969163e6e630deaea7" dependencies = [ "anyhow", "serde", @@ -7927,7 +7927,7 @@ dependencies = [ [[package]] name = "turbopack-mdx" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230803.2#04476ffc5fd912bf5c937fd7f1b103cbc7f27929" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230804.1#d8f738fcedd77b7d03685c969163e6e630deaea7" dependencies = [ "anyhow", "mdxjs", @@ -7942,7 +7942,7 @@ dependencies = [ [[package]] name = "turbopack-node" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230803.2#04476ffc5fd912bf5c937fd7f1b103cbc7f27929" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230804.1#d8f738fcedd77b7d03685c969163e6e630deaea7" dependencies = [ "anyhow", "async-stream", @@ -7977,7 +7977,7 @@ dependencies = [ [[package]] name = "turbopack-static" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230803.2#04476ffc5fd912bf5c937fd7f1b103cbc7f27929" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230804.1#d8f738fcedd77b7d03685c969163e6e630deaea7" dependencies = [ "anyhow", "serde", @@ -7993,7 +7993,7 @@ dependencies = [ [[package]] name = "turbopack-swc-utils" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230803.2#04476ffc5fd912bf5c937fd7f1b103cbc7f27929" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230804.1#d8f738fcedd77b7d03685c969163e6e630deaea7" dependencies = [ "swc_core", "turbo-tasks", @@ -8004,7 +8004,7 @@ dependencies = [ [[package]] name = "turbopack-test-utils" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230803.2#04476ffc5fd912bf5c937fd7f1b103cbc7f27929" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230804.1#d8f738fcedd77b7d03685c969163e6e630deaea7" dependencies = [ "anyhow", "once_cell", @@ -8022,7 +8022,7 @@ dependencies = [ [[package]] name = "turbopack-wasm" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230803.2#04476ffc5fd912bf5c937fd7f1b103cbc7f27929" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230804.1#d8f738fcedd77b7d03685c969163e6e630deaea7" dependencies = [ "anyhow", "indexmap 1.9.3", diff --git a/Cargo.toml b/Cargo.toml index aee15b053ffc2..cf7c7c0ebcae6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -44,11 +44,11 @@ swc_core = { version = "0.79.40" } testing = { version = "0.33.21" } # Turbo crates -turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230803.2" } +turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230804.1" } # [TODO]: need to refactor embed_directory! macro usages, as well as resolving turbo_tasks::function, macros.. -turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230803.2" } +turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230804.1" } # [TODO]: need to refactor embed_directory! macro usage in next-core -turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230803.2" } +turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230804.1" } # General Deps diff --git a/packages/next-swc/crates/napi/src/next_api/utils.rs b/packages/next-swc/crates/napi/src/next_api/utils.rs index 76649ab28b89d..691a2e62fd462 100644 --- a/packages/next-swc/crates/napi/src/next_api/utils.rs +++ b/packages/next-swc/crates/napi/src/next_api/utils.rs @@ -13,7 +13,7 @@ use turbopack_binding::{ turbopack::core::{ diagnostics::{Diagnostic, DiagnosticContextExt, PlainDiagnostic}, error::PrettyPrintError, - issue::{IssueContextExt, PlainIssue, PlainIssueSource, PlainSource}, + issue::{IssueFilePathExt, PlainIssue, PlainIssueSource, PlainSource}, source_pos::SourcePos, }, }; @@ -107,7 +107,7 @@ pub async fn get_diagnostics(source: Vc) -> Result for NapiIssue { Self { description: issue.description.clone(), category: issue.category.clone(), - context: issue.context.clone(), + file_path: issue.file_path.clone(), detail: issue.detail.clone(), documentation_link: issue.documentation_link.clone(), severity: issue.severity.as_str().to_string(), diff --git a/packages/next-swc/crates/next-build/src/next_build.rs b/packages/next-swc/crates/next-build/src/next_build.rs index df8baccdcb8ff..6a8fa8580880e 100644 --- a/packages/next-swc/crates/next-build/src/next_build.rs +++ b/packages/next-swc/crates/next-build/src/next_build.rs @@ -35,7 +35,7 @@ use turbopack_binding::{ asset::Asset, chunk::ChunkingContext, environment::ServerAddr, - issue::{IssueContextExt, IssueReporter, IssueSeverity}, + issue::{IssueFilePathExt, IssueReporter, IssueSeverity}, output::{OutputAsset, OutputAssets}, virtual_fs::VirtualFileSystem, }, diff --git a/packages/next-swc/crates/next-core/js/package.json b/packages/next-swc/crates/next-core/js/package.json index c54b0766695ca..409dc634965c0 100644 --- a/packages/next-swc/crates/next-core/js/package.json +++ b/packages/next-swc/crates/next-core/js/package.json @@ -10,8 +10,8 @@ "check": "tsc --noEmit" }, "dependencies": { - "@vercel/turbopack-ecmascript-runtime": "https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-230803.2", - "@vercel/turbopack-node": "https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-node/js?turbopack-230803.2", + "@vercel/turbopack-ecmascript-runtime": "https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-230804.1", + "@vercel/turbopack-node": "https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-node/js?turbopack-230804.1", "anser": "^2.1.1", "css.escape": "^1.5.1", "next": "*", diff --git a/packages/next-swc/crates/next-core/src/app_segment_config.rs b/packages/next-swc/crates/next-core/src/app_segment_config.rs index c23ca00ef07e4..9a37570668100 100644 --- a/packages/next-swc/crates/next-core/src/app_segment_config.rs +++ b/packages/next-swc/crates/next-core/src/app_segment_config.rs @@ -176,7 +176,7 @@ impl Issue for NextSegmentConfigParsingIssue { } #[turbo_tasks::function] - fn context(&self) -> Vc { + fn file_path(&self) -> Vc { self.ident.path() } diff --git a/packages/next-swc/crates/next-core/src/app_structure.rs b/packages/next-swc/crates/next-core/src/app_structure.rs index 114c3b1831288..2f849d87eca4f 100644 --- a/packages/next-swc/crates/next-core/src/app_structure.rs +++ b/packages/next-swc/crates/next-core/src/app_structure.rs @@ -936,7 +936,7 @@ impl Issue for DirectoryTreeIssue { } #[turbo_tasks::function] - fn context(&self) -> Vc { + fn file_path(&self) -> Vc { self.app_dir } diff --git a/packages/next-swc/crates/next-core/src/babel.rs b/packages/next-swc/crates/next-core/src/babel.rs index 8ff35fd20c6c2..702d60da1ecd3 100644 --- a/packages/next-swc/crates/next-core/src/babel.rs +++ b/packages/next-swc/crates/next-core/src/babel.rs @@ -160,7 +160,7 @@ impl Issue for BabelIssue { } #[turbo_tasks::function] - fn context(&self) -> Vc { + fn file_path(&self) -> Vc { self.path } diff --git a/packages/next-swc/crates/next-core/src/next_app/unsupported_dynamic_metadata_issue.rs b/packages/next-swc/crates/next-core/src/next_app/unsupported_dynamic_metadata_issue.rs index 347e357972e34..3c5fc2977c4f7 100644 --- a/packages/next-swc/crates/next-core/src/next_app/unsupported_dynamic_metadata_issue.rs +++ b/packages/next-swc/crates/next-core/src/next_app/unsupported_dynamic_metadata_issue.rs @@ -25,7 +25,7 @@ impl Issue for UnsupportedDynamicMetadataIssue { } #[turbo_tasks::function] - fn context(&self) -> Vc { + fn file_path(&self) -> Vc { self.app_dir } diff --git a/packages/next-swc/crates/next-core/src/next_client/context.rs b/packages/next-swc/crates/next-core/src/next_client/context.rs index 2230782c49b0b..488526faf3de0 100644 --- a/packages/next-swc/crates/next-core/src/next_client/context.rs +++ b/packages/next-swc/crates/next-core/src/next_client/context.rs @@ -85,12 +85,12 @@ async fn next_client_free_vars(mode: NextMode) -> Result> ..defines(mode).into_iter(), Buffer = FreeVarReference::EcmaScriptModule { request: "node:buffer".to_string(), - context: None, + lookup_path: None, export: Some("Buffer".to_string()), }, process = FreeVarReference::EcmaScriptModule { request: "node:process".to_string(), - context: None, + lookup_path: None, export: Some("default".to_string()), } ) diff --git a/packages/next-swc/crates/next-core/src/next_config.rs b/packages/next-swc/crates/next-core/src/next_config.rs index 9f38c2cabf844..d708764bbf0f7 100644 --- a/packages/next-swc/crates/next-core/src/next_config.rs +++ b/packages/next-swc/crates/next-core/src/next_config.rs @@ -13,7 +13,7 @@ use turbopack_binding::{ context::AssetContext, file_source::FileSource, ident::AssetIdent, - issue::{Issue, IssueContextExt, IssueExt, IssueSeverity}, + issue::{Issue, IssueExt, IssueFilePathExt, IssueSeverity}, reference_type::{EntryReferenceSubType, InnerAssets, ReferenceType}, resolve::{ find_context_file, @@ -711,7 +711,7 @@ async fn load_config_and_custom_routes( }; load_next_config_and_custom_routes_internal(execution_context, config_file) - .issue_context(config_file, "Loading Next.js config") + .issue_file_path(config_file, "Loading Next.js config") .await } @@ -867,7 +867,7 @@ impl Issue for OutdatedConfigIssue { } #[turbo_tasks::function] - fn context(&self) -> Vc { + fn file_path(&self) -> Vc { self.path } diff --git a/packages/next-swc/crates/next-core/src/next_edge/context.rs b/packages/next-swc/crates/next-core/src/next_edge/context.rs index 6b535b68b22b4..aaff510d94718 100644 --- a/packages/next-swc/crates/next-core/src/next_edge/context.rs +++ b/packages/next-swc/crates/next-core/src/next_edge/context.rs @@ -50,12 +50,12 @@ fn next_edge_free_vars(project_path: Vc) -> Vc Vc { + fn file_path(&self) -> Vc { self.path } diff --git a/packages/next-swc/crates/next-core/src/next_shared/resolve.rs b/packages/next-swc/crates/next-core/src/next_shared/resolve.rs index 3c1d3c50e387c..46ba476b331e9 100644 --- a/packages/next-swc/crates/next-core/src/next_shared/resolve.rs +++ b/packages/next-swc/crates/next-core/src/next_shared/resolve.rs @@ -65,7 +65,7 @@ impl ResolvePlugin for UnsupportedModulesResolvePlugin { async fn after_resolve( &self, _fs_path: Vc, - context: Vc, + file_path: Vc, request: Vc, ) -> Result> { if let Request::Module { @@ -77,7 +77,7 @@ impl ResolvePlugin for UnsupportedModulesResolvePlugin { // Warn if the package is known not to be supported by Turbopack at the moment. if UNSUPPORTED_PACKAGES.contains(module.as_str()) { UnsupportedModuleIssue { - context, + file_path, package: module.into(), package_path: None, } @@ -88,7 +88,7 @@ impl ResolvePlugin for UnsupportedModulesResolvePlugin { if let Pattern::Constant(path) = path { if UNSUPPORTED_PACKAGE_PATHS.contains(&(module, path)) { UnsupportedModuleIssue { - context, + file_path, package: module.into(), package_path: Some(path.to_owned()), } diff --git a/packages/next-swc/crates/next-core/src/router.rs b/packages/next-swc/crates/next-core/src/router.rs index e55f0f600dc5d..15650d606b796 100644 --- a/packages/next-swc/crates/next-core/src/router.rs +++ b/packages/next-swc/crates/next-core/src/router.rs @@ -19,7 +19,7 @@ use turbopack_binding::{ environment::{ServerAddr, ServerInfo}, file_source::FileSource, ident::AssetIdent, - issue::IssueContextExt, + issue::IssueFilePathExt, module::Module, reference_type::{EcmaScriptModulesReferenceSubType, InnerAssets, ReferenceType}, resolve::{find_context_file, FindContextFileResult}, diff --git a/packages/next-swc/crates/next-core/src/util.rs b/packages/next-swc/crates/next-core/src/util.rs index a07280ae2d296..9dab06fa13dc0 100644 --- a/packages/next-swc/crates/next-core/src/util.rs +++ b/packages/next-swc/crates/next-core/src/util.rs @@ -164,7 +164,7 @@ impl Issue for NextSourceConfigParsingIssue { } #[turbo_tasks::function] - fn context(&self) -> Vc { + fn file_path(&self) -> Vc { self.ident.path() } diff --git a/packages/next-swc/crates/next-dev-tests/tests/integration.rs b/packages/next-swc/crates/next-dev-tests/tests/integration.rs index 266106109ffc8..1472bd29a1e56 100644 --- a/packages/next-swc/crates/next-dev-tests/tests/integration.rs +++ b/packages/next-swc/crates/next-dev-tests/tests/integration.rs @@ -712,8 +712,8 @@ impl Issue for NormalizedIssue { } #[turbo_tasks::function] - fn context(&self) -> Vc { - self.0.context() + fn file_path(&self) -> Vc { + self.0.file_path() } #[turbo_tasks::function] diff --git a/packages/next/src/build/swc/index.ts b/packages/next/src/build/swc/index.ts index d6b731d2b0635..1b97a6d906494 100644 --- a/packages/next/src/build/swc/index.ts +++ b/packages/next/src/build/swc/index.ts @@ -433,7 +433,7 @@ interface TurboEngineOptions { interface Issue { severity: string category: string - context: string + filePath: string title: string description: string detail: string diff --git a/packages/next/src/server/lib/router-utils/setup-dev.ts b/packages/next/src/server/lib/router-utils/setup-dev.ts index e4831d68c4c12..3815aaea063ab 100644 --- a/packages/next/src/server/lib/router-utils/setup-dev.ts +++ b/packages/next/src/server/lib/router-utils/setup-dev.ts @@ -268,7 +268,7 @@ async function startWatcher(opts: SetupOpts) { // TODO better formatting if (issue.severity !== 'error' && issue.severity !== 'fatal') continue console.error( - `⚠ ${issue.severity} - ${issue.context}\n${issue.title}\n${issue.description}\n\n` + `⚠ ${issue.severity} - ${issue.filePath}\n${issue.title}\n${issue.description}\n\n` ) } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 82793b9158188..f70f0b6e76417 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -982,8 +982,8 @@ importers: '@types/react': 18.2.7 '@types/react-dom': 18.2.4 '@vercel/ncc': ^0.36.0 - '@vercel/turbopack-ecmascript-runtime': https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-230803.2 - '@vercel/turbopack-node': https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-node/js?turbopack-230803.2 + '@vercel/turbopack-ecmascript-runtime': https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-230804.1 + '@vercel/turbopack-node': https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-node/js?turbopack-230804.1 anser: ^2.1.1 css.escape: ^1.5.1 find-up: ^6.3.0 @@ -995,8 +995,8 @@ importers: stacktrace-parser: ^0.1.10 strip-ansi: ^7.0.1 dependencies: - '@vercel/turbopack-ecmascript-runtime': '@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-230803.2_react-refresh@0.12.0' - '@vercel/turbopack-node': '@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-node/js?turbopack-230803.2' + '@vercel/turbopack-ecmascript-runtime': '@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-230804.1_react-refresh@0.12.0' + '@vercel/turbopack-node': '@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-node/js?turbopack-230804.1' anser: 2.1.1 css.escape: 1.5.1 next: link:../../../../next @@ -6156,7 +6156,7 @@ packages: dependencies: '@mdx-js/mdx': 2.2.1 source-map: 0.7.3 - webpack: 5.86.0 + webpack: 5.86.0_@swc+core@1.3.55 transitivePeerDependencies: - supports-color @@ -6902,7 +6902,6 @@ packages: cpu: [arm64] os: [darwin] requiresBuild: true - dev: true optional: true /@swc/core-darwin-x64/1.3.55: @@ -6911,7 +6910,6 @@ packages: cpu: [x64] os: [darwin] requiresBuild: true - dev: true optional: true /@swc/core-linux-arm-gnueabihf/1.3.55: @@ -6920,7 +6918,6 @@ packages: cpu: [arm] os: [linux] requiresBuild: true - dev: true optional: true /@swc/core-linux-arm64-gnu/1.3.55: @@ -6929,7 +6926,6 @@ packages: cpu: [arm64] os: [linux] requiresBuild: true - dev: true optional: true /@swc/core-linux-arm64-musl/1.3.55: @@ -6938,7 +6934,6 @@ packages: cpu: [arm64] os: [linux] requiresBuild: true - dev: true optional: true /@swc/core-linux-x64-gnu/1.3.55: @@ -6947,7 +6942,6 @@ packages: cpu: [x64] os: [linux] requiresBuild: true - dev: true optional: true /@swc/core-linux-x64-musl/1.3.55: @@ -6956,7 +6950,6 @@ packages: cpu: [x64] os: [linux] requiresBuild: true - dev: true optional: true /@swc/core-win32-arm64-msvc/1.3.55: @@ -6965,7 +6958,6 @@ packages: cpu: [arm64] os: [win32] requiresBuild: true - dev: true optional: true /@swc/core-win32-ia32-msvc/1.3.55: @@ -6974,7 +6966,6 @@ packages: cpu: [ia32] os: [win32] requiresBuild: true - dev: true optional: true /@swc/core-win32-x64-msvc/1.3.55: @@ -6983,7 +6974,6 @@ packages: cpu: [x64] os: [win32] requiresBuild: true - dev: true optional: true /@swc/core/1.3.55_@swc+helpers@0.5.1: @@ -7008,7 +6998,6 @@ packages: '@swc/core-win32-arm64-msvc': 1.3.55 '@swc/core-win32-ia32-msvc': 1.3.55 '@swc/core-win32-x64-msvc': 1.3.55 - dev: true /@swc/helpers/0.4.14: resolution: {integrity: sha512-4C7nX/dvpzB7za4Ql9K81xK3HPxCpHMgwTZVyf+9JQ6VUbn9jjZVN7/Nkdz/Ugzs2CSjqnL/UPXroiVBVHUWUw==} @@ -23897,7 +23886,6 @@ packages: serialize-javascript: 6.0.1 terser: 5.17.7 webpack: 5.86.0_@swc+core@1.3.55 - dev: true /terser/5.10.0: resolution: {integrity: sha512-AMmF99DMfEDiRJfxfY5jj5wNH/bYO09cniSqhfoyxc8sFoYIgkJy86G04UoZU5VjlpnplVu0K6Tx6E9b5+DlHA==} @@ -25269,7 +25257,6 @@ packages: - '@swc/core' - esbuild - uglify-js - dev: true /websocket-driver/0.7.3: resolution: {integrity: sha512-bpxWlvbbB459Mlipc5GBzzZwhoZgGEZLuqPaR0INBGnPAY1vdBX6hPnoFXiw+3yWxDuHyQjO2oXTMyS8A5haFg==} @@ -25678,9 +25665,9 @@ packages: /zwitch/2.0.4: resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==} - '@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-230803.2_react-refresh@0.12.0': - resolution: {tarball: https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-230803.2} - id: '@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-230803.2' + '@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-230804.1_react-refresh@0.12.0': + resolution: {tarball: https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-230804.1} + id: '@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-230804.1' name: '@vercel/turbopack-ecmascript-runtime' version: 0.0.0 dependencies: @@ -25691,8 +25678,8 @@ packages: - webpack dev: false - '@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-node/js?turbopack-230803.2': - resolution: {tarball: https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-node/js?turbopack-230803.2} + '@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-node/js?turbopack-230804.1': + resolution: {tarball: https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-node/js?turbopack-230804.1} name: '@vercel/turbopack-node' version: 0.0.0 dependencies: