Skip to content

Commit

Permalink
Turbopack: add support for dynamic requests in require() and import() (
Browse files Browse the repository at this point in the history
…#62092)

### What?

see vercel/turborepo#7398

### Turbopack Changes

* vercel/turborepo#7367 <!-- Tobias Koppers - add
custom_extensions to resolve options context -->
* vercel/turborepo#7398 <!-- Tobias Koppers - add
support for dynamic requests in require() and import() -->


Closes PACK-2513
  • Loading branch information
sokra authored Feb 15, 2024
1 parent 25809e8 commit e1787bb
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 45 deletions.
68 changes: 34 additions & 34 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 @@ -37,11 +37,11 @@ swc_core = { version = "0.90.8", features = [
testing = { version = "0.35.18" }

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

# General Deps

Expand Down
4 changes: 2 additions & 2 deletions packages/next-swc/crates/next-core/src/next_import_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -908,12 +908,12 @@ fn export_value_to_import_mapping(
None
} else {
Some(if result.len() == 1 {
ImportMapping::PrimaryAlternative(result[0].to_string(), Some(project_path)).cell()
ImportMapping::PrimaryAlternative(result[0].0.to_string(), Some(project_path)).cell()
} else {
ImportMapping::Alternatives(
result
.iter()
.map(|m| {
.map(|(m, _)| {
ImportMapping::PrimaryAlternative(m.to_string(), Some(project_path)).cell()
})
.collect(),
Expand Down
2 changes: 1 addition & 1 deletion packages/next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
"@types/ws": "8.2.0",
"@vercel/ncc": "0.34.0",
"@vercel/nft": "0.26.4",
"@vercel/turbopack-ecmascript-runtime": "https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240215.3",
"@vercel/turbopack-ecmascript-runtime": "https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240215.4",
"acorn": "8.5.0",
"amphtml-validator": "1.0.35",
"anser": "1.4.9",
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

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

0 comments on commit e1787bb

Please sign in to comment.