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

refactor(turbopack): Make various types directly or indirectly included in…

refactor(turbopack): Make various types directly or indirectly included in `State<T>` types into OperationValues and/or NonLocalValues (#74008)

This is a refactor ahead of #73876

This adds the `OperationValue` trait (and in a few cases, `NonLocalValue`) to a large number of types where it can be trivially done.

These types are needed in #73876 because they're used somewhere inside of a `State<...>` type (most likely transitively).
parent bb0e59f9
...@@ -28,8 +28,8 @@ use turbo_tasks::{ ...@@ -28,8 +28,8 @@ use turbo_tasks::{
fxindexmap, fxindexmap,
graph::{AdjacencyMap, GraphTraversal}, graph::{AdjacencyMap, GraphTraversal},
trace::TraceRawVcs, trace::TraceRawVcs,
Completion, Completions, FxIndexMap, IntoTraitRef, NonLocalValue, ReadRef, ResolvedVc, State, Completion, Completions, FxIndexMap, IntoTraitRef, NonLocalValue, OperationValue, ReadRef,
TaskInput, TransientInstance, TryFlatJoinIterExt, Value, Vc, ResolvedVc, State, TaskInput, TransientInstance, TryFlatJoinIterExt, Value, Vc,
}; };
use turbo_tasks_env::{EnvMap, ProcessEnv}; use turbo_tasks_env::{EnvMap, ProcessEnv};
use turbo_tasks_fs::{DiskFileSystem, FileSystem, FileSystemPath, VirtualFileSystem}; use turbo_tasks_fs::{DiskFileSystem, FileSystem, FileSystemPath, VirtualFileSystem};
...@@ -73,7 +73,17 @@ use crate::{ ...@@ -73,7 +73,17 @@ use crate::{
}; };
#[derive( #[derive(
Debug, Serialize, Deserialize, Clone, TaskInput, PartialEq, Eq, Hash, TraceRawVcs, NonLocalValue, Debug,
Serialize,
Deserialize,
Clone,
TaskInput,
PartialEq,
Eq,
Hash,
TraceRawVcs,
NonLocalValue,
OperationValue,
)] )]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct DraftModeOptions { pub struct DraftModeOptions {
...@@ -95,6 +105,7 @@ pub struct DraftModeOptions { ...@@ -95,6 +105,7 @@ pub struct DraftModeOptions {
Hash, Hash,
TraceRawVcs, TraceRawVcs,
NonLocalValue, NonLocalValue,
OperationValue,
)] )]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct WatchOptions { pub struct WatchOptions {
...@@ -107,7 +118,17 @@ pub struct WatchOptions { ...@@ -107,7 +118,17 @@ pub struct WatchOptions {
} }
#[derive( #[derive(
Debug, Serialize, Deserialize, Clone, TaskInput, PartialEq, Eq, Hash, TraceRawVcs, NonLocalValue, Debug,
Serialize,
Deserialize,
Clone,
TaskInput,
PartialEq,
Eq,
Hash,
TraceRawVcs,
NonLocalValue,
OperationValue,
)] )]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct ProjectOptions { pub struct ProjectOptions {
...@@ -192,7 +213,17 @@ pub struct PartialProjectOptions { ...@@ -192,7 +213,17 @@ pub struct PartialProjectOptions {
} }
#[derive( #[derive(
Debug, Serialize, Deserialize, Clone, TaskInput, PartialEq, Eq, Hash, TraceRawVcs, NonLocalValue, Debug,
Serialize,
Deserialize,
Clone,
TaskInput,
PartialEq,
Eq,
Hash,
TraceRawVcs,
NonLocalValue,
OperationValue,
)] )]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct DefineEnv { pub struct DefineEnv {
......
This diff is collapsed.
...@@ -5,14 +5,23 @@ use async_trait::async_trait; ...@@ -5,14 +5,23 @@ use async_trait::async_trait;
use modularize_imports::{modularize_imports, PackageConfig}; use modularize_imports::{modularize_imports, PackageConfig};
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use swc_core::ecma::ast::Program; use swc_core::ecma::ast::Program;
use turbo_tasks::{trace::TraceRawVcs, FxIndexMap, NonLocalValue, ResolvedVc}; use turbo_tasks::{trace::TraceRawVcs, FxIndexMap, NonLocalValue, OperationValue, ResolvedVc};
use turbopack::module_options::{ModuleRule, ModuleRuleEffect}; use turbopack::module_options::{ModuleRule, ModuleRuleEffect};
use turbopack_ecmascript::{CustomTransformer, EcmascriptInputTransform, TransformContext}; use turbopack_ecmascript::{CustomTransformer, EcmascriptInputTransform, TransformContext};
use super::module_rule_match_js_no_url; use super::module_rule_match_js_no_url;
#[derive( #[derive(
Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize, TraceRawVcs, NonLocalValue, Clone,
Debug,
Default,
PartialEq,
Eq,
Serialize,
Deserialize,
TraceRawVcs,
NonLocalValue,
OperationValue,
)] )]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct ModularizeImportPackageConfig { pub struct ModularizeImportPackageConfig {
...@@ -24,7 +33,16 @@ pub struct ModularizeImportPackageConfig { ...@@ -24,7 +33,16 @@ pub struct ModularizeImportPackageConfig {
} }
#[derive( #[derive(
Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize, TraceRawVcs, NonLocalValue, Clone,
Debug,
Default,
PartialEq,
Eq,
Serialize,
Deserialize,
TraceRawVcs,
NonLocalValue,
OperationValue,
)] )]
#[serde(untagged)] #[serde(untagged)]
pub enum Transform { pub enum Transform {
......
...@@ -67,12 +67,16 @@ macro_rules! impl_auto_marker_trait { ...@@ -67,12 +67,16 @@ macro_rules! impl_auto_marker_trait {
unsafe impl<T: $trait + ?Sized> $trait for ::std::cell::RefCell<T> {} unsafe impl<T: $trait + ?Sized> $trait for ::std::cell::RefCell<T> {}
unsafe impl<T: ?Sized> $trait for ::std::marker::PhantomData<T> {} unsafe impl<T: ?Sized> $trait for ::std::marker::PhantomData<T> {}
unsafe impl<T: $trait + ?Sized> $trait for $crate::TraitRef<T> {}
unsafe impl<T> $trait for $crate::ReadRef<T> unsafe impl<T> $trait for $crate::ReadRef<T>
where where
T: $crate::VcValueType, T: $crate::VcValueType,
<<T as $crate::VcValueType>::Read as $crate::VcRead<T>>::Target: $trait <<T as $crate::VcValueType>::Read as $crate::VcRead<T>>::Target: $trait
{} {}
unsafe impl<T: $trait> $trait for $crate::State<T> {} unsafe impl<T: $trait> $trait for $crate::State<T> {}
unsafe impl<T: $trait> $trait for $crate::Value<T> {}
unsafe impl<T: $trait> $trait for $crate::TransientValue<T> {}
unsafe impl<T: $trait> $trait for $crate::TransientInstance<T> {}
unsafe impl<T: $trait + ?Sized> $trait for &T {} unsafe impl<T: $trait + ?Sized> $trait for &T {}
unsafe impl<T: $trait + ?Sized> $trait for &mut T {} unsafe impl<T: $trait + ?Sized> $trait for &mut T {}
......
...@@ -6,7 +6,7 @@ use std::{ ...@@ -6,7 +6,7 @@ use std::{
use anyhow::{Context, Result}; use anyhow::{Context, Result};
use indexmap::{IndexMap, IndexSet}; use indexmap::{IndexMap, IndexSet};
use turbo_tasks::Vc; use turbo_tasks::{ResolvedVc, Vc};
use turbo_tasks_fs::{ use turbo_tasks_fs::{
rope::{Rope, RopeBuilder}, rope::{Rope, RopeBuilder},
util::uri_from_file, util::uri_from_file,
...@@ -21,14 +21,13 @@ use crate::{ ...@@ -21,14 +21,13 @@ use crate::{
}; };
/// A mapping of byte-offset in the code string to an associated source map. /// A mapping of byte-offset in the code string to an associated source map.
pub type Mapping = (usize, Option<Vc<Box<dyn GenerateSourceMap>>>); pub type Mapping = (usize, Option<ResolvedVc<Box<dyn GenerateSourceMap>>>);
/// Code stores combined output code and the source map of that output code. /// Code stores combined output code and the source map of that output code.
#[turbo_tasks::value(shared, local)] #[turbo_tasks::value(shared)]
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct Code { pub struct Code {
code: Rope, code: Rope,
mappings: Vec<Mapping>, mappings: Vec<Mapping>,
} }
...@@ -36,7 +35,6 @@ pub struct Code { ...@@ -36,7 +35,6 @@ pub struct Code {
#[derive(Default)] #[derive(Default)]
pub struct CodeBuilder { pub struct CodeBuilder {
code: RopeBuilder, code: RopeBuilder,
mappings: Vec<Mapping>, mappings: Vec<Mapping>,
} }
...@@ -63,7 +61,11 @@ impl CodeBuilder { ...@@ -63,7 +61,11 @@ impl CodeBuilder {
/// Pushes original user code with an optional source map if one is /// Pushes original user code with an optional source map if one is
/// available. If it's not, this is no different than pushing Synthetic /// available. If it's not, this is no different than pushing Synthetic
/// code. /// code.
pub fn push_source(&mut self, code: &Rope, map: Option<Vc<Box<dyn GenerateSourceMap>>>) { pub fn push_source(
&mut self,
code: &Rope,
map: Option<ResolvedVc<Box<dyn GenerateSourceMap>>>,
) {
self.push_map(map); self.push_map(map);
self.code += code; self.code += code;
} }
...@@ -98,7 +100,7 @@ impl CodeBuilder { ...@@ -98,7 +100,7 @@ impl CodeBuilder {
/// original code section. By inserting an empty source map when reaching a /// original code section. By inserting an empty source map when reaching a
/// synthetic section directly after an original section, we tell Chrome /// synthetic section directly after an original section, we tell Chrome
/// that the previous map ended at this point. /// that the previous map ended at this point.
fn push_map(&mut self, map: Option<Vc<Box<dyn GenerateSourceMap>>>) { fn push_map(&mut self, map: Option<ResolvedVc<Box<dyn GenerateSourceMap>>>) {
if map.is_none() && matches!(self.mappings.last(), None | Some((_, None))) { if map.is_none() && matches!(self.mappings.last(), None | Some((_, None))) {
// No reason to push an empty map directly after an empty map // No reason to push an empty map directly after an empty map
return; return;
......
...@@ -121,7 +121,7 @@ impl VersionedContentExt for AssetContent { ...@@ -121,7 +121,7 @@ impl VersionedContentExt for AssetContent {
/// Describes the current version of an object, and how to update them from an /// Describes the current version of an object, and how to update them from an
/// earlier version. /// earlier version.
#[turbo_tasks::value_trait(local)] #[turbo_tasks::value_trait]
pub trait Version { pub trait Version {
/// Get a unique identifier of the version as a string. There is no way /// Get a unique identifier of the version as a string. There is no way
/// to convert an id back to its original `Version`, so the original object /// to convert an id back to its original `Version`, so the original object
...@@ -149,7 +149,7 @@ pub trait VersionedContentMerger { ...@@ -149,7 +149,7 @@ pub trait VersionedContentMerger {
#[turbo_tasks::value(transparent)] #[turbo_tasks::value(transparent)]
pub struct VersionedContents(Vec<ResolvedVc<Box<dyn VersionedContent>>>); pub struct VersionedContents(Vec<ResolvedVc<Box<dyn VersionedContent>>>);
#[turbo_tasks::value] #[turbo_tasks::value(operation)]
pub struct NotFoundVersion; pub struct NotFoundVersion;
#[turbo_tasks::value_impl] #[turbo_tasks::value_impl]
...@@ -209,7 +209,7 @@ pub struct PartialUpdate { ...@@ -209,7 +209,7 @@ pub struct PartialUpdate {
/// [`Version`] implementation that hashes a file at a given path and returns /// [`Version`] implementation that hashes a file at a given path and returns
/// the hex encoded hash as a version identifier. /// the hex encoded hash as a version identifier.
#[turbo_tasks::value] #[turbo_tasks::value(operation)]
#[derive(Clone)] #[derive(Clone)]
pub struct FileHashVersion { pub struct FileHashVersion {
hash: RcStr, hash: RcStr,
......
...@@ -94,7 +94,7 @@ impl CssChunk { ...@@ -94,7 +94,7 @@ impl CssChunk {
content.source_map.map(ResolvedVc::upcast) content.source_map.map(ResolvedVc::upcast)
}; };
body.push_source(&content.inner_code, source_map.map(|v| *v)); body.push_source(&content.inner_code, source_map);
writeln!(body, "{close}")?; writeln!(body, "{close}")?;
writeln!(body)?; writeln!(body)?;
......
...@@ -59,7 +59,7 @@ impl SingleItemCssChunk { ...@@ -59,7 +59,7 @@ impl SingleItemCssChunk {
code.push_source( code.push_source(
&content.inner_code, &content.inner_code,
content.source_map.map(ResolvedVc::upcast).map(|v| *v), content.source_map.map(ResolvedVc::upcast),
); );
write!(code, "{close}")?; write!(code, "{close}")?;
......
...@@ -164,7 +164,7 @@ impl DevHtmlAsset { ...@@ -164,7 +164,7 @@ impl DevHtmlAsset {
} }
} }
#[turbo_tasks::value] #[turbo_tasks::value(operation)]
struct DevHtmlAssetContent { struct DevHtmlAssetContent {
chunk_paths: Vec<RcStr>, chunk_paths: Vec<RcStr>,
body: Option<RcStr>, body: Option<RcStr>,
...@@ -234,7 +234,7 @@ impl VersionedContent for DevHtmlAssetContent { ...@@ -234,7 +234,7 @@ impl VersionedContent for DevHtmlAssetContent {
} }
} }
#[turbo_tasks::value] #[turbo_tasks::value(operation)]
struct DevHtmlAssetVersion { struct DevHtmlAssetVersion {
content: ReadRef<DevHtmlAssetContent>, content: ReadRef<DevHtmlAssetContent>,
} }
......
...@@ -33,13 +33,14 @@ use self::{ ...@@ -33,13 +33,14 @@ use self::{
}; };
/// The result of proxying a request to another HTTP server. /// The result of proxying a request to another HTTP server.
#[turbo_tasks::value(shared)] #[turbo_tasks::value(shared, operation)]
pub struct ProxyResult { pub struct ProxyResult {
/// The HTTP status code to return. /// The HTTP status code to return.
pub status: u16, pub status: u16,
/// Headers arranged as contiguous (name, value) pairs. /// Headers arranged as contiguous (name, value) pairs.
pub headers: Vec<(RcStr, RcStr)>, pub headers: Vec<(RcStr, RcStr)>,
/// The body to return. /// The body to return.
#[turbo_tasks(trace_ignore)]
pub body: Body, pub body: Body,
} }
......
use hyper::{HeaderMap, Uri}; use hyper::{HeaderMap, Uri};
use turbo_tasks::NonLocalValue;
use super::Body; use super::Body;
/// A request to a content source. /// A request to a content source.
#[derive(Debug, Clone)] #[derive(Debug, Clone, NonLocalValue)]
pub struct SourceRequest { pub struct SourceRequest {
/// The HTTP method to use. /// The HTTP method to use.
pub method: String, pub method: String,
/// The URI to request. /// The URI to request.
#[turbo_tasks(trace_ignore)]
pub uri: Uri, pub uri: Uri,
/// The headers to send. /// The headers to send.
#[turbo_tasks(trace_ignore)]
pub headers: HeaderMap<hyper::header::HeaderValue>, pub headers: HeaderMap<hyper::header::HeaderValue>,
/// The body to send. /// The body to send.
pub body: Body, pub body: Body,
......
...@@ -14,10 +14,12 @@ use swc_core::{ ...@@ -14,10 +14,12 @@ use swc_core::{
visit::FoldWith, visit::FoldWith,
}, },
}; };
use turbo_tasks::{trace::TraceRawVcs, NonLocalValue, ValueDefault, Vc}; use turbo_tasks::{trace::TraceRawVcs, NonLocalValue, OperationValue, ValueDefault, Vc};
use turbopack_ecmascript::{CustomTransformer, TransformContext}; use turbopack_ecmascript::{CustomTransformer, TransformContext};
#[derive(Clone, PartialEq, Eq, Debug, TraceRawVcs, Serialize, Deserialize, NonLocalValue)] #[derive(
Clone, PartialEq, Eq, Debug, TraceRawVcs, Serialize, Deserialize, NonLocalValue, OperationValue,
)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "kebab-case")]
pub enum EmotionLabelKind { pub enum EmotionLabelKind {
DevOnly, DevOnly,
...@@ -27,7 +29,7 @@ pub enum EmotionLabelKind { ...@@ -27,7 +29,7 @@ pub enum EmotionLabelKind {
//[TODO]: need to support importmap, there are type mismatch between //[TODO]: need to support importmap, there are type mismatch between
//next.config.js to swc's emotion options //next.config.js to swc's emotion options
#[turbo_tasks::value(shared)] #[turbo_tasks::value(shared, operation)]
#[derive(Default, Clone, Debug)] #[derive(Default, Clone, Debug)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct EmotionTransformConfig { pub struct EmotionTransformConfig {
......
...@@ -5,11 +5,13 @@ use async_trait::async_trait; ...@@ -5,11 +5,13 @@ use async_trait::async_trait;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use swc_core::{common::FileName, ecma::ast::Program}; use swc_core::{common::FileName, ecma::ast::Program};
use swc_relay::RelayLanguageConfig; use swc_relay::RelayLanguageConfig;
use turbo_tasks::{trace::TraceRawVcs, NonLocalValue}; use turbo_tasks::{trace::TraceRawVcs, NonLocalValue, OperationValue};
use turbo_tasks_fs::FileSystemPath; use turbo_tasks_fs::FileSystemPath;
use turbopack_ecmascript::{CustomTransformer, TransformContext}; use turbopack_ecmascript::{CustomTransformer, TransformContext};
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TraceRawVcs, NonLocalValue)] #[derive(
Clone, Debug, PartialEq, Serialize, Deserialize, TraceRawVcs, NonLocalValue, OperationValue,
)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct RelayConfig { pub struct RelayConfig {
pub src: String, pub src: String,
...@@ -17,7 +19,9 @@ pub struct RelayConfig { ...@@ -17,7 +19,9 @@ pub struct RelayConfig {
pub language: Option<RelayLanguage>, pub language: Option<RelayLanguage>,
} }
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TraceRawVcs, NonLocalValue)] #[derive(
Clone, Debug, PartialEq, Serialize, Deserialize, TraceRawVcs, NonLocalValue, OperationValue,
)]
#[serde(rename_all = "lowercase")] #[serde(rename_all = "lowercase")]
pub enum RelayLanguage { pub enum RelayLanguage {
TypeScript, TypeScript,
......
...@@ -9,7 +9,7 @@ use swc_core::{ ...@@ -9,7 +9,7 @@ use swc_core::{
use turbo_tasks::{ValueDefault, Vc}; use turbo_tasks::{ValueDefault, Vc};
use turbopack_ecmascript::{CustomTransformer, TransformContext}; use turbopack_ecmascript::{CustomTransformer, TransformContext};
#[turbo_tasks::value(shared)] #[turbo_tasks::value(shared, operation)]
#[derive(Clone, Debug)] #[derive(Clone, Debug)]
#[serde(default, rename_all = "camelCase")] #[serde(default, rename_all = "camelCase")]
pub struct StyledComponentsTransformConfig { pub struct StyledComponentsTransformConfig {
......
...@@ -155,12 +155,11 @@ impl EcmascriptChunkItemContent { ...@@ -155,12 +155,11 @@ impl EcmascriptChunkItemContent {
match source_map { match source_map {
Some(map) => fileify_source_map(map, *rewrite_source_path) Some(map) => fileify_source_map(map, *rewrite_source_path)
.await? .await?
.map(|v| *v) .map(ResolvedVc::upcast),
.map(Vc::upcast),
None => None, None => None,
} }
} else { } else {
self.source_map.map(|v| *v) self.source_map
}; };
code.push_source(&self.inner_code, source_map); code.push_source(&self.inner_code, source_map);
......
...@@ -19,7 +19,7 @@ use swc_core::{ ...@@ -19,7 +19,7 @@ use swc_core::{
transforms::base::fixer::paren_remover, transforms::base::fixer::paren_remover,
}, },
}; };
use turbo_tasks::Vc; use turbo_tasks::{ResolvedVc, Vc};
use turbo_tasks_fs::FileSystemPath; use turbo_tasks_fs::FileSystemPath;
use turbopack_core::{ use turbopack_core::{
code_builder::{Code, CodeBuilder}, code_builder::{Code, CodeBuilder},
...@@ -106,8 +106,8 @@ pub async fn minify(path: Vc<FileSystemPath>, code: Vc<Code>) -> Result<Vc<Code> ...@@ -106,8 +106,8 @@ pub async fn minify(path: Vc<FileSystemPath>, code: Vc<Code>) -> Result<Vc<Code>
let mut builder = CodeBuilder::default(); let mut builder = CodeBuilder::default();
builder.push_source( builder.push_source(
&src.into(), &src.into(),
Some(Vc::upcast( Some(ResolvedVc::upcast(
ParseResultSourceMap::new(cm, src_map_buf, original_map).cell(), ParseResultSourceMap::new(cm, src_map_buf, original_map).resolved_cell(),
)), )),
); );
......
...@@ -54,7 +54,7 @@ impl StaticEcmascriptCode { ...@@ -54,7 +54,7 @@ impl StaticEcmascriptCode {
let mut code = CodeBuilder::default(); let mut code = CodeBuilder::default();
code.push_source( code.push_source(
&runtime_base_content.inner_code, &runtime_base_content.inner_code,
runtime_base_content.source_map.map(|v| *v), runtime_base_content.source_map,
); );
Ok(Code::cell(code.build())) Ok(Code::cell(code.build()))
} }
......
...@@ -24,7 +24,7 @@ fn modifier() -> Vc<RcStr> { ...@@ -24,7 +24,7 @@ fn modifier() -> Vc<RcStr> {
Vc::cell("mdx".into()) Vc::cell("mdx".into())
} }
#[turbo_tasks::value(shared)] #[turbo_tasks::value(shared, operation)]
#[derive(Hash, Debug, Clone)] #[derive(Hash, Debug, Clone)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub enum MdxParseConstructs { pub enum MdxParseConstructs {
...@@ -35,7 +35,7 @@ pub enum MdxParseConstructs { ...@@ -35,7 +35,7 @@ pub enum MdxParseConstructs {
/// Subset of mdxjs::Options to allow to inherit turbopack's jsx-related configs /// Subset of mdxjs::Options to allow to inherit turbopack's jsx-related configs
/// into mdxjs. This is thin, near straightforward subset of mdxjs::Options to /// into mdxjs. This is thin, near straightforward subset of mdxjs::Options to
/// enable turbo tasks. /// enable turbo tasks.
#[turbo_tasks::value(shared)] #[turbo_tasks::value(shared, operation)]
#[derive(Hash, Debug, Clone)] #[derive(Hash, Debug, Clone)]
#[serde(rename_all = "camelCase", default)] #[serde(rename_all = "camelCase", default)]
pub struct MdxTransformOptions { pub struct MdxTransformOptions {
......
...@@ -8,8 +8,8 @@ use serde_json::{json, Value as JsonValue}; ...@@ -8,8 +8,8 @@ use serde_json::{json, Value as JsonValue};
use serde_with::serde_as; use serde_with::serde_as;
use turbo_rcstr::RcStr; use turbo_rcstr::RcStr;
use turbo_tasks::{ use turbo_tasks::{
trace::TraceRawVcs, Completion, NonLocalValue, ResolvedVc, TaskInput, TryJoinIterExt, Value, trace::TraceRawVcs, Completion, NonLocalValue, OperationValue, ResolvedVc, TaskInput,
ValueToString, Vc, TryJoinIterExt, Value, ValueToString, Vc,
}; };
use turbo_tasks_bytes::stream::SingleValue; use turbo_tasks_bytes::stream::SingleValue;
use turbo_tasks_env::ProcessEnv; use turbo_tasks_env::ProcessEnv;
...@@ -75,7 +75,9 @@ struct WebpackLoadersProcessingResult { ...@@ -75,7 +75,9 @@ struct WebpackLoadersProcessingResult {
assets: Option<Vec<EmittedAsset>>, assets: Option<Vec<EmittedAsset>>,
} }
#[derive(Clone, PartialEq, Eq, Debug, TraceRawVcs, Serialize, Deserialize, NonLocalValue)] #[derive(
Clone, PartialEq, Eq, Debug, TraceRawVcs, Serialize, Deserialize, NonLocalValue, OperationValue,
)]
pub struct WebpackLoaderItem { pub struct WebpackLoaderItem {
pub loader: RcStr, pub loader: RcStr,
pub options: serde_json::Map<String, serde_json::Value>, pub options: serde_json::Map<String, serde_json::Value>,
......
...@@ -12,7 +12,7 @@ use turbopack_ecmascript::chunk::EcmascriptChunkContent; ...@@ -12,7 +12,7 @@ use turbopack_ecmascript::chunk::EcmascriptChunkContent;
use super::content::chunk_items; use super::content::chunk_items;
#[turbo_tasks::value(serialization = "none", local)] #[turbo_tasks::value(serialization = "none")]
pub(super) struct EcmascriptBuildNodeChunkVersion { pub(super) struct EcmascriptBuildNodeChunkVersion {
chunk_path: String, chunk_path: String,
chunk_items: Vec<(ReadRef<ModuleId>, ReadRef<Code>)>, chunk_items: Vec<(ReadRef<ModuleId>, ReadRef<Code>)>,
......
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