Skip to content

Commit

Permalink
Turbopack: move references() to specific traits (#52822)
Browse files Browse the repository at this point in the history
### What?

refactoring

see vercel/turbo#5555

### Turbopack Changes

* vercel/turbo#5544 <!-- Tobias Koppers - add
direct cycle detection -->
* vercel/turbo#5547 <!-- Alex Kirszenberg - Add
missing feature to syn -->
* vercel/turbo#5555 <!-- Tobias Koppers - move
references() to specific traits -->
  • Loading branch information
sokra committed Jul 18, 2023
1 parent 6705c80 commit 3f1b917
Show file tree
Hide file tree
Showing 18 changed files with 177 additions and 166 deletions.
70 changes: 35 additions & 35 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ swc_core = { version = "0.79.13" }
testing = { version = "0.33.20" }

# Turbo crates
turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230717.3" }
turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230718.2" }
# [TODO]: need to refactor embed_directory! macro usages, as well as resolving turbo_tasks::function, macros..
turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230717.3" }
turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230718.2" }
# [TODO]: need to refactor embed_directory! macro usage in next-core
turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230717.3" }
turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230718.2" }

# General Deps

Expand Down
4 changes: 2 additions & 2 deletions packages/next-swc/crates/next-core/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"check": "tsc --noEmit"
},
"dependencies": {
"@vercel/turbopack-ecmascript-runtime": "https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-230717.3",
"@vercel/turbopack-node": "https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-node/js?turbopack-230717.3",
"@vercel/turbopack-ecmascript-runtime": "https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-230718.2",
"@vercel/turbopack-node": "https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-node/js?turbopack-230718.2",
"anser": "^2.1.1",
"css.escape": "^1.5.1",
"next": "*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ impl Module for InChunkingContextAsset {
fn ident(&self) -> Vc<AssetIdent> {
self.asset.ident().with_modifier(modifier())
}

#[turbo_tasks::function]
fn references(&self) -> Vc<AssetReferences> {
self.asset.references()
}
}

#[turbo_tasks::value_impl]
Expand All @@ -39,11 +44,6 @@ impl Asset for InChunkingContextAsset {
fn content(&self) -> Vc<AssetContent> {
self.asset.content()
}

#[turbo_tasks::function]
fn references(&self) -> Vc<AssetReferences> {
self.asset.references()
}
}

#[turbo_tasks::value_impl]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,6 @@ impl Module for WithChunksAsset {
fn ident(&self) -> Vc<AssetIdent> {
self.asset.ident().with_modifier(modifier())
}
}

#[turbo_tasks::value_impl]
impl Asset for WithChunksAsset {
#[turbo_tasks::function]
fn content(&self) -> Vc<AssetContent> {
unimplemented!()
}

#[turbo_tasks::function]
async fn references(self: Vc<Self>) -> Result<Vc<AssetReferences>> {
Expand All @@ -101,6 +93,14 @@ impl Asset for WithChunksAsset {
}
}

#[turbo_tasks::value_impl]
impl Asset for WithChunksAsset {
#[turbo_tasks::function]
fn content(&self) -> Vc<AssetContent> {
unimplemented!()
}
}

#[turbo_tasks::value_impl]
impl ChunkableModule for WithChunksAsset {
#[turbo_tasks::function]
Expand Down
Loading

0 comments on commit 3f1b917

Please sign in to comment.