Unverified Commit 94709ef1 authored by Tobias Koppers's avatar Tobias Koppers Committed by GitHub

update turbopack and update code for API changes (#53576)

* https://github.com/vercel/turbo/pull/5640
* https://github.com/vercel/turbo/pull/5661
parent 324814f2
This diff is collapsed.
......@@ -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
......
......@@ -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<T>(source: Vc<T>) -> Result<Vec<ReadRef<PlainDiagno
pub struct NapiIssue {
pub severity: String,
pub category: String,
pub context: String,
pub file_path: String,
pub title: String,
pub description: String,
pub detail: String,
......@@ -121,7 +121,7 @@ impl From<&PlainIssue> 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(),
......
......@@ -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,
},
......
......@@ -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": "*",
......
......@@ -176,7 +176,7 @@ impl Issue for NextSegmentConfigParsingIssue {
}
#[turbo_tasks::function]
fn context(&self) -> Vc<FileSystemPath> {
fn file_path(&self) -> Vc<FileSystemPath> {
self.ident.path()
}
......
......@@ -936,7 +936,7 @@ impl Issue for DirectoryTreeIssue {
}
#[turbo_tasks::function]
fn context(&self) -> Vc<FileSystemPath> {
fn file_path(&self) -> Vc<FileSystemPath> {
self.app_dir
}
......
......@@ -160,7 +160,7 @@ impl Issue for BabelIssue {
}
#[turbo_tasks::function]
fn context(&self) -> Vc<FileSystemPath> {
fn file_path(&self) -> Vc<FileSystemPath> {
self.path
}
......
......@@ -25,7 +25,7 @@ impl Issue for UnsupportedDynamicMetadataIssue {
}
#[turbo_tasks::function]
fn context(&self) -> Vc<FileSystemPath> {
fn file_path(&self) -> Vc<FileSystemPath> {
self.app_dir
}
......
......@@ -85,12 +85,12 @@ async fn next_client_free_vars(mode: NextMode) -> Result<Vc<FreeVarReferences>>
..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()),
}
)
......
......@@ -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<FileSystemPath> {
fn file_path(&self) -> Vc<FileSystemPath> {
self.path
}
......
......@@ -50,12 +50,12 @@ fn next_edge_free_vars(project_path: Vc<FileSystemPath>) -> Vc<FreeVarReferences
..defines().into_iter(),
Buffer = FreeVarReference::EcmaScriptModule {
request: "next/dist/compiled/buffer".to_string(),
context: Some(project_path),
lookup_path: Some(project_path),
export: Some("Buffer".to_string()),
},
process = FreeVarReference::EcmaScriptModule {
request: "next/dist/build/polyfills/process".to_string(),
context: Some(project_path),
lookup_path: Some(project_path),
export: Some("default".to_string()),
},
)
......
......@@ -25,7 +25,7 @@ impl Issue for NextFontIssue {
}
#[turbo_tasks::function]
fn context(&self) -> Vc<FileSystemPath> {
fn file_path(&self) -> Vc<FileSystemPath> {
self.path
}
......
......@@ -65,7 +65,7 @@ impl ResolvePlugin for UnsupportedModulesResolvePlugin {
async fn after_resolve(
&self,
_fs_path: Vc<FileSystemPath>,
context: Vc<FileSystemPath>,
file_path: Vc<FileSystemPath>,
request: Vc<Request>,
) -> Result<Vc<ResolveResultOption>> {
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()),
}
......
......@@ -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},
......
......@@ -164,7 +164,7 @@ impl Issue for NextSourceConfigParsingIssue {
}
#[turbo_tasks::function]
fn context(&self) -> Vc<FileSystemPath> {
fn file_path(&self) -> Vc<FileSystemPath> {
self.ident.path()
}
......
......@@ -712,8 +712,8 @@ impl Issue for NormalizedIssue {
}
#[turbo_tasks::function]
fn context(&self) -> Vc<FileSystemPath> {
self.0.context()
fn file_path(&self) -> Vc<FileSystemPath> {
self.0.file_path()
}
#[turbo_tasks::function]
......
......@@ -433,7 +433,7 @@ interface TurboEngineOptions {
interface Issue {
severity: string
category: string
context: string
filePath: string
title: string
description: string
detail: string
......
......@@ -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`
)
}
}
......
......@@ -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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment