-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Fix deduplication when importing module statically and dynamically #3297
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
Conversation
The `processed_assets` `IndexSet` was performing deduplication on the `AssetVc`, which is the same between static (`import ... from "foo"`) and dynamic (`import("foo")`) imports of the same specifier. But, the _reference_ to those assets is different, and generates different chunking semantics. In order for both to succeed, we need to process both assets. Coupled with #3193's ability to load chunks on the server side, this fixes fixes WEB-381.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
9 Ignored Deployments
|
🟢 CI successful 🟢Thanks |
Benchmark for 3ac5c11Click to view benchmark
|
Benchmark for d703658
Click to view full benchmark
|
Benchmark for 05958a2Click to view benchmark
|
Benchmark for 435d428Click to view benchmark
|
Benchmark for 4d29b37Click to view benchmark
|
@@ -407,7 +409,7 @@ async fn chunk_content_internal<I: FromChunkableAsset>( | |||
for asset in assets | |||
.await? | |||
.iter() | |||
.filter(|asset| processed_assets.insert(**asset)) | |||
.filter(|asset| processed_assets.insert((chunking_type, **asset))) |
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 causes Placed
and PlacedOrParallel
to generate two chunk items.
Can we add a processed_assets.insert((Placed, **asset))
into the placed code path in PlacedOrParallel
and a processed_assets.insert((Parallel, **asset))
into the parallel code path.
…ercel/turborepo#3297) The `processed_assets` `IndexSet` was performing deduplication on the `AssetVc`, which is the same between static (`import ... from "foo"`) and dynamic (`import("foo")`) imports of the same specifier. But, the _reference_ to those assets is different, and generates different chunking semantics. In order for both to succeed, we need to process both assets. Coupled with vercel/turborepo#3193's ability to load chunks on the server side, this fixes fixes WEB-381.
…ercel/turborepo#3297) The `processed_assets` `IndexSet` was performing deduplication on the `AssetVc`, which is the same between static (`import ... from "foo"`) and dynamic (`import("foo")`) imports of the same specifier. But, the _reference_ to those assets is different, and generates different chunking semantics. In order for both to succeed, we need to process both assets. Coupled with vercel/turborepo#3193's ability to load chunks on the server side, this fixes fixes WEB-381.
…ercel/turborepo#3297) The `processed_assets` `IndexSet` was performing deduplication on the `AssetVc`, which is the same between static (`import ... from "foo"`) and dynamic (`import("foo")`) imports of the same specifier. But, the _reference_ to those assets is different, and generates different chunking semantics. In order for both to succeed, we need to process both assets. Coupled with #3193's ability to load chunks on the server side, this fixes fixes WEB-381.
…ercel/turborepo#3297) The `processed_assets` `IndexSet` was performing deduplication on the `AssetVc`, which is the same between static (`import ... from "foo"`) and dynamic (`import("foo")`) imports of the same specifier. But, the _reference_ to those assets is different, and generates different chunking semantics. In order for both to succeed, we need to process both assets. Coupled with #3193's ability to load chunks on the server side, this fixes fixes WEB-381.
…ercel/turborepo#3297) The `processed_assets` `IndexSet` was performing deduplication on the `AssetVc`, which is the same between static (`import ... from "foo"`) and dynamic (`import("foo")`) imports of the same specifier. But, the _reference_ to those assets is different, and generates different chunking semantics. In order for both to succeed, we need to process both assets. Coupled with #3193's ability to load chunks on the server side, this fixes fixes WEB-381.
The
processed_assets
IndexSet
was performing deduplication on theAssetVc
, which is the same between static (import ... from "foo"
) and dynamic (import("foo")
) imports of the same specifier. But, the reference to those assets is different, and generates different chunking semantics. In order for both to succeed, we need to process both assets.Coupled with #3193's ability to load chunks on the server side, this fixes fixes WEB-381.