Unverified Commit e06bdce3 authored by Benjamin Woodruff's avatar Benjamin Woodruff Committed by GitHub

codemod(turbopack): Some more script-generated migrations to ResolvedVc (#72889)

These changes are generated using https://github.com/vercel/turbopack-resolved-vc-codemod, using the fix to the logic that finds `Vc` field: https://github.com/vercel/turbopack-resolved-vc-codemod/commit/5c277f82024aff59d7dce6c7c623123c1db4ed10

This is a combination of applying compiler hints and an LLM to fix some easy cases.
parent c8ba12f2
use anyhow::Result; use anyhow::Result;
use turbo_rcstr::RcStr; use turbo_rcstr::RcStr;
use turbo_tasks::Vc; use turbo_tasks::{ResolvedVc, Vc};
use crate::{case_insensitive_read, EnvMap, ProcessEnv}; use crate::{case_insensitive_read, EnvMap, ProcessEnv};
...@@ -8,14 +8,14 @@ use crate::{case_insensitive_read, EnvMap, ProcessEnv}; ...@@ -8,14 +8,14 @@ use crate::{case_insensitive_read, EnvMap, ProcessEnv};
/// envs if a key is not overridden. /// envs if a key is not overridden.
#[turbo_tasks::value] #[turbo_tasks::value]
pub struct CustomProcessEnv { pub struct CustomProcessEnv {
prior: Vc<Box<dyn ProcessEnv>>, prior: ResolvedVc<Box<dyn ProcessEnv>>,
custom: Vc<EnvMap>, custom: ResolvedVc<EnvMap>,
} }
#[turbo_tasks::value_impl] #[turbo_tasks::value_impl]
impl CustomProcessEnv { impl CustomProcessEnv {
#[turbo_tasks::function] #[turbo_tasks::function]
pub fn new(prior: Vc<Box<dyn ProcessEnv>>, custom: Vc<EnvMap>) -> Vc<Self> { pub fn new(prior: ResolvedVc<Box<dyn ProcessEnv>>, custom: ResolvedVc<EnvMap>) -> Vc<Self> {
CustomProcessEnv { prior, custom }.cell() CustomProcessEnv { prior, custom }.cell()
} }
} }
...@@ -34,7 +34,7 @@ impl ProcessEnv for CustomProcessEnv { ...@@ -34,7 +34,7 @@ impl ProcessEnv for CustomProcessEnv {
#[turbo_tasks::function] #[turbo_tasks::function]
async fn read(&self, name: RcStr) -> Result<Vc<Option<RcStr>>> { async fn read(&self, name: RcStr) -> Result<Vc<Option<RcStr>>> {
let custom = case_insensitive_read(self.custom, name.clone()); let custom = case_insensitive_read(*self.custom, name.clone());
match &*custom.await? { match &*custom.await? {
Some(_) => Ok(custom), Some(_) => Ok(custom),
None => Ok(self.prior.read(name)), None => Ok(self.prior.read(name)),
......
...@@ -13,7 +13,7 @@ use crate::{sorted_env_vars, EnvMap, ProcessEnv, GLOBAL_ENV_LOCK}; ...@@ -13,7 +13,7 @@ use crate::{sorted_env_vars, EnvMap, ProcessEnv, GLOBAL_ENV_LOCK};
#[turbo_tasks::value] #[turbo_tasks::value]
pub struct DotenvProcessEnv { pub struct DotenvProcessEnv {
prior: Option<ResolvedVc<Box<dyn ProcessEnv>>>, prior: Option<ResolvedVc<Box<dyn ProcessEnv>>>,
path: Vc<FileSystemPath>, path: ResolvedVc<FileSystemPath>,
} }
#[turbo_tasks::value_impl] #[turbo_tasks::value_impl]
...@@ -21,7 +21,7 @@ impl DotenvProcessEnv { ...@@ -21,7 +21,7 @@ impl DotenvProcessEnv {
#[turbo_tasks::function] #[turbo_tasks::function]
pub fn new( pub fn new(
prior: Option<ResolvedVc<Box<dyn ProcessEnv>>>, prior: Option<ResolvedVc<Box<dyn ProcessEnv>>>,
path: Vc<FileSystemPath>, path: ResolvedVc<FileSystemPath>,
) -> Vc<Self> { ) -> Vc<Self> {
DotenvProcessEnv { prior, path }.cell() DotenvProcessEnv { prior, path }.cell()
} }
......
use anyhow::Result; use anyhow::Result;
use turbo_rcstr::RcStr; use turbo_rcstr::RcStr;
use turbo_tasks::{FxIndexMap, Vc}; use turbo_tasks::{FxIndexMap, ResolvedVc, Vc};
use crate::{EnvMap, ProcessEnv}; use crate::{EnvMap, ProcessEnv};
...@@ -8,14 +8,14 @@ use crate::{EnvMap, ProcessEnv}; ...@@ -8,14 +8,14 @@ use crate::{EnvMap, ProcessEnv};
/// filtering. /// filtering.
#[turbo_tasks::value] #[turbo_tasks::value]
pub struct FilterProcessEnv { pub struct FilterProcessEnv {
prior: Vc<Box<dyn ProcessEnv>>, prior: ResolvedVc<Box<dyn ProcessEnv>>,
filters: Vec<RcStr>, filters: Vec<RcStr>,
} }
#[turbo_tasks::value_impl] #[turbo_tasks::value_impl]
impl FilterProcessEnv { impl FilterProcessEnv {
#[turbo_tasks::function] #[turbo_tasks::function]
pub fn new(prior: Vc<Box<dyn ProcessEnv>>, filters: Vec<RcStr>) -> Vc<Self> { pub fn new(prior: ResolvedVc<Box<dyn ProcessEnv>>, filters: Vec<RcStr>) -> Vc<Self> {
FilterProcessEnv { FilterProcessEnv {
prior, prior,
filters: filters filters: filters
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
use anyhow::Result; use anyhow::Result;
use turbo_rcstr::RcStr; use turbo_rcstr::RcStr;
use turbo_tasks::{mark_session_dependent, Vc}; use turbo_tasks::{mark_session_dependent, ResolvedVc, Vc};
use turbo_tasks_fs::FileSystemPath; use turbo_tasks_fs::FileSystemPath;
use turbopack_core::issue::{Issue, IssueSeverity, IssueStage, OptionStyledString, StyledString}; use turbopack_core::issue::{Issue, IssueSeverity, IssueStage, OptionStyledString, StyledString};
...@@ -104,7 +104,7 @@ pub enum FetchErrorKind { ...@@ -104,7 +104,7 @@ pub enum FetchErrorKind {
#[turbo_tasks::value(shared)] #[turbo_tasks::value(shared)]
pub struct FetchError { pub struct FetchError {
pub url: Vc<RcStr>, pub url: ResolvedVc<RcStr>,
pub kind: Vc<FetchErrorKind>, pub kind: Vc<FetchErrorKind>,
pub detail: Vc<StyledString>, pub detail: Vc<StyledString>,
} }
...@@ -123,7 +123,7 @@ impl FetchError { ...@@ -123,7 +123,7 @@ impl FetchError {
FetchError { FetchError {
detail: StyledString::Text(error.to_string().into()).cell(), detail: StyledString::Text(error.to_string().into()).cell(),
url: Vc::cell(url.into()), url: ResolvedVc::cell(url.into()),
kind: kind.into(), kind: kind.into(),
} }
} }
...@@ -134,14 +134,14 @@ impl FetchError { ...@@ -134,14 +134,14 @@ impl FetchError {
#[turbo_tasks::function] #[turbo_tasks::function]
pub async fn to_issue( pub async fn to_issue(
self: Vc<Self>, self: Vc<Self>,
severity: Vc<IssueSeverity>, severity: ResolvedVc<IssueSeverity>,
issue_context: Vc<FileSystemPath>, issue_context: ResolvedVc<FileSystemPath>,
) -> Result<Vc<FetchIssue>> { ) -> Result<Vc<FetchIssue>> {
let this = &*self.await?; let this = &*self.await?;
Ok(FetchIssue { Ok(FetchIssue {
issue_context, issue_context,
severity, severity,
url: this.url, url: *this.url,
kind: this.kind, kind: this.kind,
detail: this.detail, detail: this.detail,
} }
...@@ -151,8 +151,8 @@ impl FetchError { ...@@ -151,8 +151,8 @@ impl FetchError {
#[turbo_tasks::value(shared)] #[turbo_tasks::value(shared)]
pub struct FetchIssue { pub struct FetchIssue {
pub issue_context: Vc<FileSystemPath>, pub issue_context: ResolvedVc<FileSystemPath>,
pub severity: Vc<IssueSeverity>, pub severity: ResolvedVc<IssueSeverity>,
pub url: Vc<RcStr>, pub url: Vc<RcStr>,
pub kind: Vc<FetchErrorKind>, pub kind: Vc<FetchErrorKind>,
pub detail: Vc<StyledString>, pub detail: Vc<StyledString>,
...@@ -162,12 +162,12 @@ pub struct FetchIssue { ...@@ -162,12 +162,12 @@ pub struct FetchIssue {
impl Issue for FetchIssue { impl Issue for FetchIssue {
#[turbo_tasks::function] #[turbo_tasks::function]
fn file_path(&self) -> Vc<FileSystemPath> { fn file_path(&self) -> Vc<FileSystemPath> {
self.issue_context *self.issue_context
} }
#[turbo_tasks::function] #[turbo_tasks::function]
fn severity(&self) -> Vc<IssueSeverity> { fn severity(&self) -> Vc<IssueSeverity> {
self.severity *self.severity
} }
#[turbo_tasks::function] #[turbo_tasks::function]
......
...@@ -91,7 +91,7 @@ async fn struct_unit_debug() { ...@@ -91,7 +91,7 @@ async fn struct_unit_debug() {
async fn struct_transparent_debug() { async fn struct_transparent_debug() {
run(&REGISTRATION, || async { run(&REGISTRATION, || async {
let a: Vc<StructWithTransparent> = StructWithTransparent { let a: Vc<StructWithTransparent> = StructWithTransparent {
transparent: Transparent(42).cell(), transparent: Transparent(42).resolved_cell(),
} }
.cell(); .cell();
assert_eq!( assert_eq!(
...@@ -172,7 +172,7 @@ struct StructUnit; ...@@ -172,7 +172,7 @@ struct StructUnit;
#[turbo_tasks::value(shared)] #[turbo_tasks::value(shared)]
struct StructWithTransparent { struct StructWithTransparent {
transparent: Vc<Transparent>, transparent: ResolvedVc<Transparent>,
} }
#[turbo_tasks::value(shared)] #[turbo_tasks::value(shared)]
......
...@@ -17,8 +17,8 @@ use crate::{ecmascript::content::EcmascriptDevChunkContent, BrowserChunkingConte ...@@ -17,8 +17,8 @@ use crate::{ecmascript::content::EcmascriptDevChunkContent, BrowserChunkingConte
/// Development Ecmascript chunk. /// Development Ecmascript chunk.
#[turbo_tasks::value(shared)] #[turbo_tasks::value(shared)]
pub struct EcmascriptDevChunk { pub struct EcmascriptDevChunk {
chunking_context: Vc<BrowserChunkingContext>, chunking_context: ResolvedVc<BrowserChunkingContext>,
chunk: Vc<EcmascriptChunk>, chunk: ResolvedVc<EcmascriptChunk>,
} }
#[turbo_tasks::value_impl] #[turbo_tasks::value_impl]
...@@ -26,8 +26,8 @@ impl EcmascriptDevChunk { ...@@ -26,8 +26,8 @@ impl EcmascriptDevChunk {
/// Creates a new [`Vc<EcmascriptDevChunk>`]. /// Creates a new [`Vc<EcmascriptDevChunk>`].
#[turbo_tasks::function] #[turbo_tasks::function]
pub fn new( pub fn new(
chunking_context: Vc<BrowserChunkingContext>, chunking_context: ResolvedVc<BrowserChunkingContext>,
chunk: Vc<EcmascriptChunk>, chunk: ResolvedVc<EcmascriptChunk>,
) -> Vc<Self> { ) -> Vc<Self> {
EcmascriptDevChunk { EcmascriptDevChunk {
chunking_context, chunking_context,
...@@ -68,7 +68,7 @@ impl EcmascriptDevChunk { ...@@ -68,7 +68,7 @@ impl EcmascriptDevChunk {
async fn own_content(self: Vc<Self>) -> Result<Vc<EcmascriptDevChunkContent>> { async fn own_content(self: Vc<Self>) -> Result<Vc<EcmascriptDevChunkContent>> {
let this = self.await?; let this = self.await?;
Ok(EcmascriptDevChunkContent::new( Ok(EcmascriptDevChunkContent::new(
this.chunking_context, *this.chunking_context,
self, self,
this.chunk.chunk_content(), this.chunk.chunk_content(),
)) ))
...@@ -76,7 +76,7 @@ impl EcmascriptDevChunk { ...@@ -76,7 +76,7 @@ impl EcmascriptDevChunk {
#[turbo_tasks::function] #[turbo_tasks::function]
pub fn chunk(&self) -> Result<Vc<Box<dyn Chunk>>> { pub fn chunk(&self) -> Result<Vc<Box<dyn Chunk>>> {
Ok(Vc::upcast(self.chunk)) Ok(Vc::upcast(*self.chunk))
} }
} }
...@@ -172,10 +172,8 @@ impl Introspectable for EcmascriptDevChunk { ...@@ -172,10 +172,8 @@ impl Introspectable for EcmascriptDevChunk {
#[turbo_tasks::function] #[turbo_tasks::function]
async fn children(&self) -> Result<Vc<IntrospectableChildren>> { async fn children(&self) -> Result<Vc<IntrospectableChildren>> {
let mut children = FxIndexSet::default(); let mut children = FxIndexSet::default();
let chunk = Vc::upcast::<Box<dyn Introspectable>>(self.chunk) let chunk = ResolvedVc::upcast::<Box<dyn Introspectable>>(self.chunk);
.resolve() children.insert((Vc::cell("chunk".into()), *chunk));
.await?;
children.insert((Vc::cell("chunk".into()), chunk));
Ok(Vc::cell(children)) Ok(Vc::cell(children))
} }
} }
...@@ -3,7 +3,7 @@ use std::io::Write; ...@@ -3,7 +3,7 @@ use std::io::Write;
use anyhow::{bail, Result}; use anyhow::{bail, Result};
use indoc::writedoc; use indoc::writedoc;
use turbo_rcstr::RcStr; use turbo_rcstr::RcStr;
use turbo_tasks::Vc; use turbo_tasks::{ResolvedVc, Vc};
use turbo_tasks_fs::File; use turbo_tasks_fs::File;
use turbopack_core::{ use turbopack_core::{
asset::AssetContent, asset::AssetContent,
...@@ -23,21 +23,21 @@ use crate::BrowserChunkingContext; ...@@ -23,21 +23,21 @@ use crate::BrowserChunkingContext;
#[turbo_tasks::value(serialization = "none")] #[turbo_tasks::value(serialization = "none")]
pub struct EcmascriptDevChunkContent { pub struct EcmascriptDevChunkContent {
pub(super) entries: Vc<EcmascriptDevChunkContentEntries>, pub(super) entries: ResolvedVc<EcmascriptDevChunkContentEntries>,
pub(super) chunking_context: Vc<BrowserChunkingContext>, pub(super) chunking_context: ResolvedVc<BrowserChunkingContext>,
pub(super) chunk: Vc<EcmascriptDevChunk>, pub(super) chunk: ResolvedVc<EcmascriptDevChunk>,
} }
#[turbo_tasks::value_impl] #[turbo_tasks::value_impl]
impl EcmascriptDevChunkContent { impl EcmascriptDevChunkContent {
#[turbo_tasks::function] #[turbo_tasks::function]
pub(crate) async fn new( pub(crate) async fn new(
chunking_context: Vc<BrowserChunkingContext>, chunking_context: ResolvedVc<BrowserChunkingContext>,
chunk: Vc<EcmascriptDevChunk>, chunk: ResolvedVc<EcmascriptDevChunk>,
content: Vc<EcmascriptChunkContent>, content: Vc<EcmascriptChunkContent>,
) -> Result<Vc<Self>> { ) -> Result<Vc<Self>> {
let entries = EcmascriptDevChunkContentEntries::new(content) let entries = EcmascriptDevChunkContentEntries::new(content)
.resolve() .to_resolved()
.await?; .await?;
Ok(EcmascriptDevChunkContent { Ok(EcmascriptDevChunkContent {
entries, entries,
...@@ -49,7 +49,7 @@ impl EcmascriptDevChunkContent { ...@@ -49,7 +49,7 @@ impl EcmascriptDevChunkContent {
#[turbo_tasks::function] #[turbo_tasks::function]
pub fn entries(&self) -> Vc<EcmascriptDevChunkContentEntries> { pub fn entries(&self) -> Vc<EcmascriptDevChunkContentEntries> {
self.entries *self.entries
} }
} }
...@@ -60,7 +60,7 @@ impl EcmascriptDevChunkContent { ...@@ -60,7 +60,7 @@ impl EcmascriptDevChunkContent {
EcmascriptDevChunkVersion::new( EcmascriptDevChunkVersion::new(
self.chunking_context.output_root(), self.chunking_context.output_root(),
self.chunk.ident().path(), self.chunk.ident().path(),
self.entries, *self.entries,
) )
} }
......
...@@ -2,7 +2,7 @@ use std::io::Write as _; ...@@ -2,7 +2,7 @@ use std::io::Write as _;
use anyhow::Result; use anyhow::Result;
use tracing::{info_span, Instrument}; use tracing::{info_span, Instrument};
use turbo_tasks::{FxIndexMap, ReadRef, TryJoinIterExt, ValueToString, Vc}; use turbo_tasks::{FxIndexMap, ReadRef, ResolvedVc, TryJoinIterExt, ValueToString, Vc};
use turbopack_core::{ use turbopack_core::{
chunk::{AsyncModuleInfo, ChunkItem, ChunkItemExt, ModuleId}, chunk::{AsyncModuleInfo, ChunkItem, ChunkItemExt, ModuleId},
code_builder::{Code, CodeBuilder}, code_builder::{Code, CodeBuilder},
...@@ -22,8 +22,8 @@ use turbopack_ecmascript::chunk::{ ...@@ -22,8 +22,8 @@ use turbopack_ecmascript::chunk::{
#[turbo_tasks::value] #[turbo_tasks::value]
#[derive(Debug)] #[derive(Debug)]
pub struct EcmascriptDevChunkContentEntry { pub struct EcmascriptDevChunkContentEntry {
pub code: Vc<Code>, pub code: ResolvedVc<Code>,
pub hash: Vc<u64>, pub hash: ResolvedVc<u64>,
} }
impl EcmascriptDevChunkContentEntry { impl EcmascriptDevChunkContentEntry {
...@@ -31,10 +31,10 @@ impl EcmascriptDevChunkContentEntry { ...@@ -31,10 +31,10 @@ impl EcmascriptDevChunkContentEntry {
chunk_item: Vc<Box<dyn EcmascriptChunkItem>>, chunk_item: Vc<Box<dyn EcmascriptChunkItem>>,
async_module_info: Option<Vc<AsyncModuleInfo>>, async_module_info: Option<Vc<AsyncModuleInfo>>,
) -> Result<Self> { ) -> Result<Self> {
let code = chunk_item.code(async_module_info).resolve().await?; let code = chunk_item.code(async_module_info).to_resolved().await?;
Ok(EcmascriptDevChunkContentEntry { Ok(EcmascriptDevChunkContentEntry {
code, code,
hash: code.source_code_hash().resolve().await?, hash: code.source_code_hash().to_resolved().await?,
}) })
} }
} }
......
...@@ -32,10 +32,10 @@ use crate::BrowserChunkingContext; ...@@ -32,10 +32,10 @@ use crate::BrowserChunkingContext;
/// * Evaluates a list of runtime entries. /// * Evaluates a list of runtime entries.
#[turbo_tasks::value(shared)] #[turbo_tasks::value(shared)]
pub(crate) struct EcmascriptDevEvaluateChunk { pub(crate) struct EcmascriptDevEvaluateChunk {
chunking_context: Vc<BrowserChunkingContext>, chunking_context: ResolvedVc<BrowserChunkingContext>,
ident: Vc<AssetIdent>, ident: ResolvedVc<AssetIdent>,
other_chunks: Vc<OutputAssets>, other_chunks: ResolvedVc<OutputAssets>,
evaluatable_assets: Vc<EvaluatableAssets>, evaluatable_assets: ResolvedVc<EvaluatableAssets>,
} }
#[turbo_tasks::value_impl] #[turbo_tasks::value_impl]
...@@ -43,10 +43,10 @@ impl EcmascriptDevEvaluateChunk { ...@@ -43,10 +43,10 @@ impl EcmascriptDevEvaluateChunk {
/// Creates a new [`Vc<EcmascriptDevEvaluateChunk>`]. /// Creates a new [`Vc<EcmascriptDevEvaluateChunk>`].
#[turbo_tasks::function] #[turbo_tasks::function]
pub fn new( pub fn new(
chunking_context: Vc<BrowserChunkingContext>, chunking_context: ResolvedVc<BrowserChunkingContext>,
ident: Vc<AssetIdent>, ident: ResolvedVc<AssetIdent>,
other_chunks: Vc<OutputAssets>, other_chunks: ResolvedVc<OutputAssets>,
evaluatable_assets: Vc<EvaluatableAssets>, evaluatable_assets: ResolvedVc<EvaluatableAssets>,
) -> Vc<Self> { ) -> Vc<Self> {
EcmascriptDevEvaluateChunk { EcmascriptDevEvaluateChunk {
chunking_context, chunking_context,
...@@ -59,7 +59,7 @@ impl EcmascriptDevEvaluateChunk { ...@@ -59,7 +59,7 @@ impl EcmascriptDevEvaluateChunk {
#[turbo_tasks::function] #[turbo_tasks::function]
fn chunks_data(&self) -> Vc<ChunksData> { fn chunks_data(&self) -> Vc<ChunksData> {
ChunkData::from_assets(self.chunking_context.output_root(), self.other_chunks) ChunkData::from_assets(self.chunking_context.output_root(), *self.other_chunks)
} }
#[turbo_tasks::function] #[turbo_tasks::function]
...@@ -101,7 +101,7 @@ impl EcmascriptDevEvaluateChunk { ...@@ -101,7 +101,7 @@ impl EcmascriptDevEvaluateChunk {
{ {
Ok(Some( Ok(Some(
placeable placeable
.as_chunk_item(Vc::upcast(chunking_context)) .as_chunk_item(Vc::upcast(*chunking_context))
.id() .id()
.await?, .await?,
)) ))
......
use anyhow::Result; use anyhow::Result;
use turbo_rcstr::RcStr; use turbo_rcstr::RcStr;
use turbo_tasks::{Value, ValueToString, Vc}; use turbo_tasks::{ResolvedVc, Value, ValueToString, Vc};
use turbopack_core::{ use turbopack_core::{
asset::{Asset, AssetContent}, asset::{Asset, AssetContent},
chunk::{ChunkingContext, EvaluatableAssets}, chunk::{ChunkingContext, EvaluatableAssets},
...@@ -25,10 +25,10 @@ use crate::BrowserChunkingContext; ...@@ -25,10 +25,10 @@ use crate::BrowserChunkingContext;
/// * changing a chunk's path. /// * changing a chunk's path.
#[turbo_tasks::value(shared)] #[turbo_tasks::value(shared)]
pub(crate) struct EcmascriptDevChunkList { pub(crate) struct EcmascriptDevChunkList {
pub(super) chunking_context: Vc<BrowserChunkingContext>, pub(super) chunking_context: ResolvedVc<BrowserChunkingContext>,
pub(super) ident: Vc<AssetIdent>, pub(super) ident: ResolvedVc<AssetIdent>,
pub(super) evaluatable_assets: Vc<EvaluatableAssets>, pub(super) evaluatable_assets: ResolvedVc<EvaluatableAssets>,
pub(super) chunks: Vc<OutputAssets>, pub(super) chunks: ResolvedVc<OutputAssets>,
pub(super) source: EcmascriptDevChunkListSource, pub(super) source: EcmascriptDevChunkListSource,
} }
...@@ -37,10 +37,10 @@ impl EcmascriptDevChunkList { ...@@ -37,10 +37,10 @@ impl EcmascriptDevChunkList {
/// Creates a new [`Vc<EcmascriptDevChunkList>`]. /// Creates a new [`Vc<EcmascriptDevChunkList>`].
#[turbo_tasks::function] #[turbo_tasks::function]
pub fn new( pub fn new(
chunking_context: Vc<BrowserChunkingContext>, chunking_context: ResolvedVc<BrowserChunkingContext>,
ident: Vc<AssetIdent>, ident: ResolvedVc<AssetIdent>,
evaluatable_assets: Vc<EvaluatableAssets>, evaluatable_assets: ResolvedVc<EvaluatableAssets>,
chunks: Vc<OutputAssets>, chunks: ResolvedVc<OutputAssets>,
source: Value<EcmascriptDevChunkListSource>, source: Value<EcmascriptDevChunkListSource>,
) -> Vc<Self> { ) -> Vc<Self> {
EcmascriptDevChunkList { EcmascriptDevChunkList {
...@@ -113,7 +113,7 @@ impl OutputAsset for EcmascriptDevChunkList { ...@@ -113,7 +113,7 @@ impl OutputAsset for EcmascriptDevChunkList {
#[turbo_tasks::function] #[turbo_tasks::function]
fn references(&self) -> Vc<OutputAssets> { fn references(&self) -> Vc<OutputAssets> {
self.chunks *self.chunks
} }
} }
......
...@@ -245,7 +245,7 @@ pub(super) async fn update_ecmascript_merged_chunk( ...@@ -245,7 +245,7 @@ pub(super) async fn update_ecmascript_merged_chunk(
if merged_module_map.get(id) != Some(hash) { if merged_module_map.get(id) != Some(hash) {
let entry = let entry =
EcmascriptModuleEntry::from_code(id, entry.code, chunk_path).await?; EcmascriptModuleEntry::from_code(id, *entry.code, chunk_path).await?;
merged_update.entries.insert(id.clone(), entry); merged_update.entries.insert(id.clone(), entry);
} }
} }
......
...@@ -45,16 +45,16 @@ impl ResolveReactRefreshResult { ...@@ -45,16 +45,16 @@ impl ResolveReactRefreshResult {
/// given path. Emits an issue if we can't. /// given path. Emits an issue if we can't.
#[turbo_tasks::function] #[turbo_tasks::function]
pub async fn assert_can_resolve_react_refresh( pub async fn assert_can_resolve_react_refresh(
path: Vc<FileSystemPath>, path: ResolvedVc<FileSystemPath>,
resolve_options_context: Vc<ResolveOptionsContext>, resolve_options_context: Vc<ResolveOptionsContext>,
) -> Result<Vc<ResolveReactRefreshResult>> { ) -> Result<Vc<ResolveReactRefreshResult>> {
let resolve_options = apply_cjs_specific_options(turbopack_resolve::resolve::resolve_options( let resolve_options = apply_cjs_specific_options(turbopack_resolve::resolve::resolve_options(
path, *path,
resolve_options_context, resolve_options_context,
)); ));
for request in [react_refresh_request_in_next(), react_refresh_request()] { for request in [react_refresh_request_in_next(), react_refresh_request()] {
let result = turbopack_core::resolve::resolve( let result = turbopack_core::resolve::resolve(
path, *path,
Value::new(ReferenceType::CommonJs(CommonJsReferenceSubType::Undefined)), Value::new(ReferenceType::CommonJs(CommonJsReferenceSubType::Undefined)),
request, request,
resolve_options, resolve_options,
...@@ -72,7 +72,7 @@ pub async fn assert_can_resolve_react_refresh( ...@@ -72,7 +72,7 @@ pub async fn assert_can_resolve_react_refresh(
/// An issue that occurred while resolving the React Refresh runtime module. /// An issue that occurred while resolving the React Refresh runtime module.
#[turbo_tasks::value(shared)] #[turbo_tasks::value(shared)]
pub struct ReactRefreshResolvingIssue { pub struct ReactRefreshResolvingIssue {
path: Vc<FileSystemPath>, path: ResolvedVc<FileSystemPath>,
} }
#[turbo_tasks::value_impl] #[turbo_tasks::value_impl]
...@@ -94,7 +94,7 @@ impl Issue for ReactRefreshResolvingIssue { ...@@ -94,7 +94,7 @@ impl Issue for ReactRefreshResolvingIssue {
#[turbo_tasks::function] #[turbo_tasks::function]
fn file_path(&self) -> Vc<FileSystemPath> { fn file_path(&self) -> Vc<FileSystemPath> {
self.path *self.path
} }
#[turbo_tasks::function] #[turbo_tasks::function]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment