Skip to content

Commit

Permalink
refactor(turbopack): Make various types directly or indirectly includ…
Browse files Browse the repository at this point in the history
…ed 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).
  • Loading branch information
bgw authored Dec 17, 2024
1 parent bb0e59f commit a2d221b
Show file tree
Hide file tree
Showing 20 changed files with 311 additions and 90 deletions.
41 changes: 36 additions & 5 deletions crates/next-api/src/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ use turbo_tasks::{
fxindexmap,
graph::{AdjacencyMap, GraphTraversal},
trace::TraceRawVcs,
Completion, Completions, FxIndexMap, IntoTraitRef, NonLocalValue, ReadRef, ResolvedVc, State,
TaskInput, TransientInstance, TryFlatJoinIterExt, Value, Vc,
Completion, Completions, FxIndexMap, IntoTraitRef, NonLocalValue, OperationValue, ReadRef,
ResolvedVc, State, TaskInput, TransientInstance, TryFlatJoinIterExt, Value, Vc,
};
use turbo_tasks_env::{EnvMap, ProcessEnv};
use turbo_tasks_fs::{DiskFileSystem, FileSystem, FileSystemPath, VirtualFileSystem};
Expand Down Expand Up @@ -73,7 +73,17 @@ use crate::{
};

#[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")]
pub struct DraftModeOptions {
Expand All @@ -95,6 +105,7 @@ pub struct DraftModeOptions {
Hash,
TraceRawVcs,
NonLocalValue,
OperationValue,
)]
#[serde(rename_all = "camelCase")]
pub struct WatchOptions {
Expand All @@ -107,7 +118,17 @@ pub struct WatchOptions {
}

#[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")]
pub struct ProjectOptions {
Expand Down Expand Up @@ -192,7 +213,17 @@ pub struct PartialProjectOptions {
}

#[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")]
pub struct DefineEnv {
Expand Down
Loading

0 comments on commit a2d221b

Please sign in to comment.