-
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
refactor asset identification #3999
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
8 Ignored Deployments
|
for param in ident.params.iter() { | ||
match *param { | ||
AssetParam::Query(query) => { | ||
0_u8.deterministic_hash(&mut hasher); |
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.
We need a DeterministicHash
derive.
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.
That won't work here well since it is async. We would need a AsyncDeterministicHash
where deterministic_hash
is an async method. That's a lot work...
Benchmark for e9524fdClick to view benchmark
|
02ac202
to
86a36fb
Compare
Benchmark for b370524
Click to view full benchmark
|
|
Benchmark for 471bfb8
Click to view full benchmark
|
add ChunkItem::ident() instead of ChunkItem::to_string() base chunk_path on AssetIdent instead of path only
make AssetIdent having an identity
a4afc6a
to
aff7e79
Compare
aff7e79
to
51b3b69
Compare
Benchmark for a7827ce
Click to view full benchmark
|
|
||
"[project]/crates/turbopack-tests/tests/snapshot/basic/async_chunk/input/import.js/manifest-loader.js": (({ r: __turbopack_require__, x: __turbopack_external_require__, i: __turbopack_import__, s: __turbopack_esm__, v: __turbopack_export_value__, c: __turbopack_cache__, l: __turbopack_load__, j: __turbopack_cjs__, p: process, g: global, __dirname }) => (() => { | ||
"[project]/crates/turbopack-tests/tests/snapshot/basic/async_chunk/input/import.js (ecmascript, manifest chunk, loader)": (({ r: __turbopack_require__, x: __turbopack_external_require__, i: __turbopack_import__, s: __turbopack_esm__, v: __turbopack_export_value__, c: __turbopack_cache__, l: __turbopack_load__, j: __turbopack_cjs__, p: process, g: global, __dirname }) => (() => { |
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 is much better.
### Description * get rid of attached filesystem for our embedded modules * get rid of import "." in favor of inner assets depends on #3999 ### Testing Instructions existing tests <!-- When the below is checked (default) our PR bot will automatically assign labels to your PR based on the content to help the team organize and review it faster. --> [X] Auto label
# New Features * vercel/turborepo#4011 # Performance Improvements * vercel/turborepo#3955 * vercel/turborepo#4018 # Bug Fixes * vercel/turborepo#4037 * vercel/turborepo#4028 # Other * vercel/turborepo#3974 * vercel/turborepo#4015 * vercel/turborepo#3999 * vercel/turborepo#4026 * vercel/turborepo#4053 * vercel/turborepo#3891 Co-authored-by: JJ Kasper <[email protected]>
* add Asset::ident() as unique identifier of an Asset * add ChunkItem::ident() instead of ChunkItem::to_string() (ValueToString) * base `chunk_path` on AssetIdent instead of path only Motivation: We want to get rid of the `import "."` in favor of inner assets. When doing this we no longer need to place virtual assets below the actual file path and they can stay in their original path. But placing virtual assets below the actual asset also made the `Asset::path` unique, which would no longer be the case after using inner assets. Some parts of the code base relied on `Asset::path` being unique (e. g. module ids and chunk paths). But actually we never guaranteed that to be unique. After this PR `Asset::ident` is intended to be unique and allow to carry more information than only the path: * Query string (`module?query`) * Fragment (`module#fragment`) * Asset (additional wrapped assets by key value pairs) * Modifiers (additional transformations applied on the module, e. g. `chunks`, `client chunks`) * In future: Part (select a subpart of the module, e. g. only export abc, or the module evaluation, or some internal part)
### Description * get rid of attached filesystem for our embedded modules * get rid of import "." in favor of inner assets depends on vercel/turborepo#3999 ### Testing Instructions existing tests <!-- When the below is checked (default) our PR bot will automatically assign labels to your PR based on the content to help the team organize and review it faster. --> [X] Auto label
* add Asset::ident() as unique identifier of an Asset * add ChunkItem::ident() instead of ChunkItem::to_string() (ValueToString) * base `chunk_path` on AssetIdent instead of path only Motivation: We want to get rid of the `import "."` in favor of inner assets. When doing this we no longer need to place virtual assets below the actual file path and they can stay in their original path. But placing virtual assets below the actual asset also made the `Asset::path` unique, which would no longer be the case after using inner assets. Some parts of the code base relied on `Asset::path` being unique (e. g. module ids and chunk paths). But actually we never guaranteed that to be unique. After this PR `Asset::ident` is intended to be unique and allow to carry more information than only the path: * Query string (`module?query`) * Fragment (`module#fragment`) * Asset (additional wrapped assets by key value pairs) * Modifiers (additional transformations applied on the module, e. g. `chunks`, `client chunks`) * In future: Part (select a subpart of the module, e. g. only export abc, or the module evaluation, or some internal part)
### Description * get rid of attached filesystem for our embedded modules * get rid of import "." in favor of inner assets depends on vercel/turborepo#3999 ### Testing Instructions existing tests <!-- When the below is checked (default) our PR bot will automatically assign labels to your PR based on the content to help the team organize and review it faster. --> [X] Auto label
* add Asset::ident() as unique identifier of an Asset * add ChunkItem::ident() instead of ChunkItem::to_string() (ValueToString) * base `chunk_path` on AssetIdent instead of path only Motivation: We want to get rid of the `import "."` in favor of inner assets. When doing this we no longer need to place virtual assets below the actual file path and they can stay in their original path. But placing virtual assets below the actual asset also made the `Asset::path` unique, which would no longer be the case after using inner assets. Some parts of the code base relied on `Asset::path` being unique (e. g. module ids and chunk paths). But actually we never guaranteed that to be unique. After this PR `Asset::ident` is intended to be unique and allow to carry more information than only the path: * Query string (`module?query`) * Fragment (`module#fragment`) * Asset (additional wrapped assets by key value pairs) * Modifiers (additional transformations applied on the module, e. g. `chunks`, `client chunks`) * In future: Part (select a subpart of the module, e. g. only export abc, or the module evaluation, or some internal part)
### Description * get rid of attached filesystem for our embedded modules * get rid of import "." in favor of inner assets depends on vercel/turborepo#3999 ### Testing Instructions existing tests <!-- When the below is checked (default) our PR bot will automatically assign labels to your PR based on the content to help the team organize and review it faster. --> [X] Auto label
* add Asset::ident() as unique identifier of an Asset * add ChunkItem::ident() instead of ChunkItem::to_string() (ValueToString) * base `chunk_path` on AssetIdent instead of path only Motivation: We want to get rid of the `import "."` in favor of inner assets. When doing this we no longer need to place virtual assets below the actual file path and they can stay in their original path. But placing virtual assets below the actual asset also made the `Asset::path` unique, which would no longer be the case after using inner assets. Some parts of the code base relied on `Asset::path` being unique (e. g. module ids and chunk paths). But actually we never guaranteed that to be unique. After this PR `Asset::ident` is intended to be unique and allow to carry more information than only the path: * Query string (`module?query`) * Fragment (`module#fragment`) * Asset (additional wrapped assets by key value pairs) * Modifiers (additional transformations applied on the module, e. g. `chunks`, `client chunks`) * In future: Part (select a subpart of the module, e. g. only export abc, or the module evaluation, or some internal part)
### Description * get rid of attached filesystem for our embedded modules * get rid of import "." in favor of inner assets depends on vercel/turborepo#3999 ### Testing Instructions existing tests <!-- When the below is checked (default) our PR bot will automatically assign labels to your PR based on the content to help the team organize and review it faster. --> [X] Auto label
* add Asset::ident() as unique identifier of an Asset * add ChunkItem::ident() instead of ChunkItem::to_string() (ValueToString) * base `chunk_path` on AssetIdent instead of path only Motivation: We want to get rid of the `import "."` in favor of inner assets. When doing this we no longer need to place virtual assets below the actual file path and they can stay in their original path. But placing virtual assets below the actual asset also made the `Asset::path` unique, which would no longer be the case after using inner assets. Some parts of the code base relied on `Asset::path` being unique (e. g. module ids and chunk paths). But actually we never guaranteed that to be unique. After this PR `Asset::ident` is intended to be unique and allow to carry more information than only the path: * Query string (`module?query`) * Fragment (`module#fragment`) * Asset (additional wrapped assets by key value pairs) * Modifiers (additional transformations applied on the module, e. g. `chunks`, `client chunks`) * In future: Part (select a subpart of the module, e. g. only export abc, or the module evaluation, or some internal part)
### Description * get rid of attached filesystem for our embedded modules * get rid of import "." in favor of inner assets depends on vercel/turborepo#3999 ### Testing Instructions existing tests <!-- When the below is checked (default) our PR bot will automatically assign labels to your PR based on the content to help the team organize and review it faster. --> [X] Auto label
chunk_path
on AssetIdent instead of path onlyMotivation:
We want to get rid of the
import "."
in favor of inner assets. When doing this we no longer need to place virtual assets below the actual file path and they can stay in their original path. But placing virtual assets below the actual asset also made theAsset::path
unique, which would no longer be the case after using inner assets. Some parts of the code base relied onAsset::path
being unique (e. g. module ids and chunk paths). But actually we never guaranteed that to be unique.After this PR
Asset::ident
is intended to be unique and allow to carry more information than only the path:module?query
)module#fragment
)chunks
,client chunks
)