Skip to content

Commit

Permalink
Update CustomModuleType import (#52133)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkirsz authored and shuding committed Jul 8, 2023
1 parent cdef987 commit 8e6bbf6
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 52 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 @@ -42,11 +42,11 @@ swc_core = { version = "0.78.24" }
testing = { version = "0.33.19" }

# Turbo crates
turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230704.2" }
turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230704.3" }
# [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-230704.2" }
turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230704.3" }
# [TODO]: need to refactor embed_directory! macro usage in next-core
turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230704.2" }
turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230704.3" }

# 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.vercel.app/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-230704.2",
"@vercel/turbopack-node": "https://gitpkg.vercel.app/vercel/turbo/crates/turbopack-node/js?turbopack-230704.2",
"@vercel/turbopack-ecmascript-runtime": "https://gitpkg.vercel.app/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-230704.3",
"@vercel/turbopack-node": "https://gitpkg.vercel.app/vercel/turbo/crates/turbopack-node/js?turbopack-230704.3",
"anser": "^2.1.1",
"css.escape": "^1.5.1",
"next": "*",
Expand Down
9 changes: 6 additions & 3 deletions packages/next-swc/crates/next-core/src/next_image/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@ use turbopack_binding::{
core::{
asset::AssetVc,
context::{AssetContext, AssetContextVc},
plugin::{CustomModuleType, CustomModuleTypeVc},
reference_type::{InnerAssetsVc, ReferenceType},
resolve::ModulePartVc,
},
r#static::StaticModuleAssetVc,
turbopack::{
module_options::{CustomModuleType, CustomModuleTypeVc},
ModuleAssetContextVc,
},
},
};

Expand Down Expand Up @@ -76,9 +79,9 @@ impl CustomModuleType for StructuredImageModuleType {
fn create_module(
&self,
source: AssetVc,
context: AssetContextVc,
context: ModuleAssetContextVc,
_part: Option<ModulePartVc>,
) -> AssetVc {
StructuredImageModuleType::create_module(source, self.blur_placeholder_mode, context)
StructuredImageModuleType::create_module(source, self.blur_placeholder_mode, context.into())
}
}
Loading

0 comments on commit 8e6bbf6

Please sign in to comment.