Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turbopack: use failsafe_parse instead of failsafe_analyse #68097

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 37 additions & 37 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ swc_core = { version = "0.96.9", features = [
testing = { version = "0.36.0" }

# Turbo crates
turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240722.3" }
turbopack-binding = { git = "https://github.com/vercel/turbo.git", branch = "sokra/failsafe-parse" } # last tag: "turbopack-240722.3"
# [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-240722.3" }
turbo-tasks = { git = "https://github.com/vercel/turbo.git", branch = "sokra/failsafe-parse" } # last tag: "turbopack-240722.3"
# [TODO]: need to refactor embed_directory! macro usage in next-core
turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240722.3" }
turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", branch = "sokra/failsafe-parse" } # last tag: "turbopack-240722.3"

# General Deps

Expand Down
2 changes: 1 addition & 1 deletion crates/next-api/src/dynamic_imports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ async fn build_dynamic_imports_map_for_module(

// https://github.com/vercel/next.js/pull/56389#discussion_r1349336374
// don't emit specific error as we expect there's a parse error already reported
let ParseResult::Ok { program, .. } = &*ecmascript_asset.parse().await? else {
let ParseResult::Ok { program, .. } = &*ecmascript_asset.failsafe_parse().await? else {
return Ok(Vc::cell(None));
};

Expand Down
2 changes: 1 addition & 1 deletion crates/next-api/src/server_actions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ async fn parse_actions(module: Vc<Box<dyn Module>>) -> Result<Vc<OptionActionMap
};
let ParseResult::Ok {
comments, program, ..
} = &*ecmascript_asset.parse().await?
} = &*ecmascript_asset.failsafe_parse().await?
else {
// The file might be be parse-able, but this is reported separately.
return Ok(OptionActionMap::none());
Expand Down
2 changes: 1 addition & 1 deletion crates/next-core/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ pub async fn parse_config_from_source(module: Vc<Box<dyn Module>>) -> Result<Vc<
globals,
eval_context,
..
} = &*ecmascript_asset.parse().await?
} = &*ecmascript_asset.failsafe_parse().await?
{
for item in &module_ast.body {
if let Some(decl) = item
Expand Down
2 changes: 1 addition & 1 deletion packages/next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@
"@types/ws": "8.2.0",
"@vercel/ncc": "0.34.0",
"@vercel/nft": "0.27.1",
"@vercel/turbopack-ecmascript-runtime": "https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240722.3",
"@vercel/turbopack-ecmascript-runtime": "https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?aec341c374d6b079beb75d8c6f6d3169dcbf7439",
"acorn": "8.11.3",
"amphtml-validator": "1.0.35",
"anser": "1.4.9",
Expand Down
Loading
Loading