-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
allow to create internal modules via AssetContext #5095
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
9 Ignored Deployments
|
✅ This change can build |
|
Linux Benchmark for 8bcd5ceClick to view benchmark
|
…nceType::Internal
Is there any reason for us to keep using |
Linux Benchmark for 4861425Click to view benchmark
|
We can't make them private as it's used from |
Linux Benchmark for f1fc798
Click to view full benchmark
|
use crate::{asset::AssetVc, resolve::ModulePartVc}; | ||
|
||
#[turbo_tasks::value(transparent)] | ||
pub struct InnerAssets(IndexMap<String, AssetVc>); |
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.
Add comments to these public structs, explaining why they exist.
@@ -133,6 +132,62 @@ struct MemoizedSuccessfulAnalysis { | |||
exports: EcmascriptExportsReadRef, | |||
} | |||
|
|||
pub struct EcmascriptModuleAssetBuilder { |
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.
Comment this public item and what each argument represents.
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.
ReferenceType
and *ReferenceSubType
could #[derive(TaskInput)]
. We never use them as Vc
anyway.
### What? create internal modules via `context.process` with `ReferenceType::Internal` ### Why? We need this for future refactoring where we want to the internal modules with transitions. ### Turbopack Changes * vercel/turbo#5095 <!-- Tobias Koppers - allow to create internal modules via AssetContext --> * vercel/turbo#5104 <!-- Alex Kirszenberg - Stable chunk list ident --> * vercel/turbo#5106 <!-- Tobias Koppers - followup fix --> --------- Co-authored-by: Alex Kirszenberg <alex.kirszenberg@vercel.com>
### What? create internal modules via `context.process` with `ReferenceType::Internal` ### Why? We need this for future refactoring where we want to the internal modules with transitions. ### Turbopack Changes * vercel/turbo#5095 <!-- Tobias Koppers - allow to create internal modules via AssetContext --> * vercel/turbo#5104 <!-- Alex Kirszenberg - Stable chunk list ident --> * vercel/turbo#5106 <!-- Tobias Koppers - followup fix --> --------- Co-authored-by: Alex Kirszenberg <alex.kirszenberg@vercel.com>
Description
This allows to create an Module with inner asset via AssetContext.
This will also respect transitions.
This change allows use to use
context.process(source, ReferenceType::Internal(inner_assets)
instead ofEcmascriptModuleAssetVc::new_with_inner_assets(..., ..., ..., ..., ..., inner_assets)
next.js PR: vercel/next.js#50338