-
Notifications
You must be signed in to change notification settings - Fork 27.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor asset identification (vercel/turborepo#3999)
* 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)
- Loading branch information
Showing
23 changed files
with
111 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.