-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
feat(contextcondition): support InPath contextcondition #4521
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
9 Ignored Deployments
|
✅ This changes can build |
🟢 CI successful 🟢Thanks |
797378c
to
0c06c8f
Compare
0c06c8f
to
824a79b
Compare
Benchmark for 51f96a4Click to view benchmark
|
824a79b
to
923de39
Compare
Benchmark for 1802874Click to view benchmark
|
crates/turbopack/src/condition.rs
Outdated
path.fs | ||
.root() | ||
.await | ||
.map_or(false, |root| context.is_inside(&root)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This ignores the error here, but it's better to propagate the error upwards
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So change fn matches(...) -> bool
signature to fn matches(..) -> Result<bool>
?
923de39
to
dd6b308
Compare
Benchmark for b669582
Click to view full benchmark
|
dd6b308
to
b2dce94
Compare
Benchmark for 3f7a125Click to view benchmark
|
### What? add support for blur placeholder generation to turbopack add `StructuredImageModuleType` which is used with `ModuleType::Custom` to allow importing an image as `{ url, width, height, blurDataURL, blurWidth, blurHeight }` in contrast to next.js with webpack this will also generate blur placeholder in development instead of using a _next/image reference. This should lead to more production-like experience (at the cost of a little bit of compilation time). turbo PR: vercel/turborepo#4621 ### Why? Turbopack was crashing on `placeholder="blur"` before. fixes WEB-534 ### Turbopack changes * vercel/turborepo#4521 <!-- OJ Kwon - feat(contextcondition): support InPath contextcondition --> * vercel/turborepo#4601 <!-- Alex Kirszenberg - Chunking Context Refactor pt. 3: Address PR comments from pt. 2 --> * vercel/turborepo#4623 <!-- Tobias Koppers - exclude turborepo from turbopack bench tests --> * vercel/turborepo#4399 <!-- Leah - support require.context --> * vercel/turborepo#4610 <!-- OJ Kwon - test(subset): add mdx test into subset --> * vercel/turborepo#4624 <!-- Tobias Koppers - run benchmarks on windows and macOS too --> * vercel/turborepo#4620 <!-- Alex Kirszenberg - Make ContainmentTree fully generic --> * vercel/turborepo#4600 <!-- Tobias Koppers - add getChunkPath method --> * vercel/turborepo#4621 <!-- Tobias Koppers - add turbopack-image --> * vercel/turborepo#4639 <!-- Tobias Koppers - restrict snapshot path for windows path length limit --> * vercel/turborepo#4641 <!-- Tobias Koppers - put webp behind a feature flag -->
### Description Attempt to close WEB-862. Currently turbopack in next-swc applies all of moduleoptionscontext into any kind of internal assets. Current available contextcondition (`ContextCondition::InDirectory`) does not gives enough context to determine where it comes from, makes non trivial to determine if given context need to be treated differently. ~I'm trying to workaround by supplying addtional context for the filesystemkind, and caller can use it for creating a new contextcondition. In case of turbopack, I assume any embedded assets in the binary won't be an external / user's. Next-swc will assign a new condition like vercel/next.js@canary...client-context-embedded-fs#diff-92086db0c6bc192f76dab5d612a562df8fddffea05244c1c00d58e7288879e11R213-R214.~ ~Still bit unsure if this is a legit apporach or would be better way to go. PR is for the POC + further improvement based on the feedback.~ Per review suggestion, this PR now supports `InPath(FileSystemVc)` as new condition instead.
### What? This is necessary changes for the WEB-862, however dependent to vercel/turborepo#4521.
…repo#4521) ### Description Attempt to close WEB-862. Currently turbopack in next-swc applies all of moduleoptionscontext into any kind of internal assets. Current available contextcondition (`ContextCondition::InDirectory`) does not gives enough context to determine where it comes from, makes non trivial to determine if given context need to be treated differently. ~I'm trying to workaround by supplying addtional context for the filesystemkind, and caller can use it for creating a new contextcondition. In case of turbopack, I assume any embedded assets in the binary won't be an external / user's. Next-swc will assign a new condition like canary...client-context-embedded-fs#diff-92086db0c6bc192f76dab5d612a562df8fddffea05244c1c00d58e7288879e11R213-R214.~ ~Still bit unsure if this is a legit apporach or would be better way to go. PR is for the POC + further improvement based on the feedback.~ Per review suggestion, this PR now supports `InPath(FileSystemVc)` as new condition instead.
…repo#4521) ### Description Attempt to close WEB-862. Currently turbopack in next-swc applies all of moduleoptionscontext into any kind of internal assets. Current available contextcondition (`ContextCondition::InDirectory`) does not gives enough context to determine where it comes from, makes non trivial to determine if given context need to be treated differently. ~I'm trying to workaround by supplying addtional context for the filesystemkind, and caller can use it for creating a new contextcondition. In case of turbopack, I assume any embedded assets in the binary won't be an external / user's. Next-swc will assign a new condition like canary...client-context-embedded-fs#diff-92086db0c6bc192f76dab5d612a562df8fddffea05244c1c00d58e7288879e11R213-R214.~ ~Still bit unsure if this is a legit apporach or would be better way to go. PR is for the POC + further improvement based on the feedback.~ Per review suggestion, this PR now supports `InPath(FileSystemVc)` as new condition instead.
…repo#4521) ### Description Attempt to close WEB-862. Currently turbopack in next-swc applies all of moduleoptionscontext into any kind of internal assets. Current available contextcondition (`ContextCondition::InDirectory`) does not gives enough context to determine where it comes from, makes non trivial to determine if given context need to be treated differently. ~I'm trying to workaround by supplying addtional context for the filesystemkind, and caller can use it for creating a new contextcondition. In case of turbopack, I assume any embedded assets in the binary won't be an external / user's. Next-swc will assign a new condition like canary...client-context-embedded-fs#diff-92086db0c6bc192f76dab5d612a562df8fddffea05244c1c00d58e7288879e11R213-R214.~ ~Still bit unsure if this is a legit apporach or would be better way to go. PR is for the POC + further improvement based on the feedback.~ Per review suggestion, this PR now supports `InPath(FileSystemVc)` as new condition instead.
Description
Attempt to close WEB-862.
Currently turbopack in next-swc applies all of moduleoptionscontext into any kind of internal assets. Current available contextcondition (
ContextCondition::InDirectory
) does not gives enough context to determine where it comes from, makes non trivial to determine if given context need to be treated differently.I'm trying to workaround by supplying addtional context for the filesystemkind, and caller can use it for creating a new contextcondition. In case of turbopack, I assume any embedded assets in the binary won't be an external / user's. Next-swc will assign a new condition like vercel/next.js@canary...client-context-embedded-fs#diff-92086db0c6bc192f76dab5d612a562df8fddffea05244c1c00d58e7288879e11R213-R214.Still bit unsure if this is a legit apporach or would be better way to go. PR is for the POC + further improvement based on the feedback.Per review suggestion, this PR now supports
InPath(FileSystemVc)
as new condition instead.