这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@sokra
Copy link
Member

@sokra sokra commented Feb 15, 2024

Description

Refactors PatternMatching to support a map of multiple matches by key. Based on the new RequestKey support for resolving.

Code Generation for require("./dir/"+ expr) will emit a map of __turbopack_lookup__({ "./a": () => ..., "./b": () => ... }, "./dir/" + expr).

The output format isn't really optimized yet, that's work for future PRs.

Testing Instructions

added a test case, enabled one previously skipped test case

Closes PACK-2512

@vercel
Copy link
Contributor

vercel bot commented Feb 15, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
rust-docs ❌ Failed (Inspect) Feb 15, 2024 0:21am
10 Ignored Deployments
Name Status Preview Comments Updated (UTC)
examples-basic-web ⬜️ Ignored (Inspect) Visit Preview Feb 15, 2024 0:21am
examples-designsystem-docs ⬜️ Ignored (Inspect) Visit Preview Feb 15, 2024 0:21am
examples-gatsby-web ⬜️ Ignored (Inspect) Visit Preview Feb 15, 2024 0:21am
examples-kitchensink-blog ⬜️ Ignored (Inspect) Visit Preview Feb 15, 2024 0:21am
examples-native-web ⬜️ Ignored (Inspect) Visit Preview Feb 15, 2024 0:21am
examples-nonmonorepo ⬜️ Ignored (Inspect) Visit Preview Feb 15, 2024 0:21am
examples-svelte-web ⬜️ Ignored (Inspect) Visit Preview Feb 15, 2024 0:21am
examples-tailwind-web ⬜️ Ignored (Inspect) Visit Preview Feb 15, 2024 0:21am
examples-vite-web ⬜️ Ignored (Inspect) Visit Preview Feb 15, 2024 0:21am
turbo-site ⬜️ Ignored (Inspect) Visit Preview Feb 15, 2024 0:21am

@github-actions
Copy link
Contributor

github-actions bot commented Feb 15, 2024

🟢 Turbopack Benchmark CI successful 🟢

Thanks

@github-actions
Copy link
Contributor

github-actions bot commented Feb 15, 2024

⚠️ CI failed ⚠️

The following steps have failed in CI:

  • Turbopack Rust tests (mac/win, non-blocking)

See workflow summary for details

@github-actions
Copy link
Contributor

✅ This change can build next-swc

@sokra sokra marked this pull request as ready for review February 15, 2024 12:28
@sokra sokra requested a review from a team as a code owner February 15, 2024 12:28
@sokra sokra merged commit 509a4cb into main Feb 15, 2024
@sokra sokra deleted the sokra/dynamc-requests branch February 15, 2024 14:12
sokra added a commit to vercel/next.js that referenced this pull request Feb 15, 2024
…#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
if let Expr::Call(call_expr) = expr {
let args = std::mem::take(&mut call_expr.args);
*expr = match args.into_iter().next() {
Some(ExprOrSpread { expr, spread: None }) => pm.create_require(*expr),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately I just noticed this now, but this looks very wrong, this should insert a string, not a require call

ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Jul 25, 2024
…rborepo#7398)

### Description

Refactors `PatternMatching` to support a map of multiple matches by key.
Based on the new `RequestKey` support for resolving.

Code Generation for `require("./dir/"+ expr)` will emit a map of
`__turbopack_lookup__({ "./a": () => ..., "./b": () => ... }, "./dir/" +
expr)`.

The output format isn't really optimized yet, that's work for future
PRs.

### Testing Instructions

added a test case, enabled one previously skipped test case



Closes PACK-2512
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Jul 29, 2024
…rborepo#7398)

### Description

Refactors `PatternMatching` to support a map of multiple matches by key.
Based on the new `RequestKey` support for resolving.

Code Generation for `require("./dir/"+ expr)` will emit a map of
`__turbopack_lookup__({ "./a": () => ..., "./b": () => ... }, "./dir/" +
expr)`.

The output format isn't really optimized yet, that's work for future
PRs.

### Testing Instructions

added a test case, enabled one previously skipped test case



Closes PACK-2512
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Jul 29, 2024
…rborepo#7398)

### Description

Refactors `PatternMatching` to support a map of multiple matches by key.
Based on the new `RequestKey` support for resolving.

Code Generation for `require("./dir/"+ expr)` will emit a map of
`__turbopack_lookup__({ "./a": () => ..., "./b": () => ... }, "./dir/" +
expr)`.

The output format isn't really optimized yet, that's work for future
PRs.

### Testing Instructions

added a test case, enabled one previously skipped test case



Closes PACK-2512
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Aug 1, 2024
…rborepo#7398)

### Description

Refactors `PatternMatching` to support a map of multiple matches by key.
Based on the new `RequestKey` support for resolving.

Code Generation for `require("./dir/"+ expr)` will emit a map of
`__turbopack_lookup__({ "./a": () => ..., "./b": () => ... }, "./dir/" +
expr)`.

The output format isn't really optimized yet, that's work for future
PRs.

### Testing Instructions

added a test case, enabled one previously skipped test case



Closes PACK-2512
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants