Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

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

14 changes: 12 additions & 2 deletions crates/next-api/src/next_server_nft.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use next_core::{get_next_package, next_server::get_tracing_compile_time_info};
use serde_json::{Value, json};
use turbo_rcstr::RcStr;
use turbo_tasks::{
NonLocalValue, ResolvedVc, TaskInput, TryFlatJoinIterExt, TryJoinIterExt, Vc,
IsTransient, NonLocalValue, ResolvedVc, TaskInput, TryFlatJoinIterExt, TryJoinIterExt, Vc,
trace::TraceRawVcs,
};
use turbo_tasks_fs::{
Expand All @@ -32,7 +32,17 @@ use crate::{
};

#[derive(
PartialEq, Eq, TraceRawVcs, NonLocalValue, Debug, Clone, Hash, TaskInput, Encode, Decode,
PartialEq,
Eq,
TraceRawVcs,
NonLocalValue,
Debug,
Clone,
Hash,
TaskInput,
IsTransient,
Encode,
Decode,
)]
enum ServerNftType {
Minimal,
Expand Down
3 changes: 2 additions & 1 deletion crates/next-api/src/operation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use anyhow::Result;
use bincode::{Decode, Encode};
use turbo_rcstr::RcStr;
use turbo_tasks::{
FxIndexMap, NonLocalValue, OperationValue, OperationVc, ResolvedVc, TaskInput, Vc,
FxIndexMap, IsTransient, NonLocalValue, OperationValue, OperationVc, ResolvedVc, TaskInput, Vc,
debug::ValueDebugFormat, take_effects, trace::TraceRawVcs,
};
use turbopack_core::issue::CollectibleIssuesExt;
Expand Down Expand Up @@ -112,6 +112,7 @@ fn pick_route(entrypoints: OperationVc<Entrypoints>, key: RcStr, route: &Route)
Debug,
Clone,
TaskInput,
IsTransient,
TraceRawVcs,
PartialEq,
Eq,
Expand Down
25 changes: 20 additions & 5 deletions crates/next-api/src/pages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ use next_core::{
use tracing::Instrument;
use turbo_rcstr::{RcStr, rcstr};
use turbo_tasks::{
Completion, FxIndexMap, NonLocalValue, ResolvedVc, TaskInput, ValueToString, Vc, fxindexmap,
fxindexset, trace::TraceRawVcs,
Completion, FxIndexMap, IsTransient, NonLocalValue, ResolvedVc, TaskInput, ValueToString, Vc,
fxindexmap, fxindexset, trace::TraceRawVcs,
};
use turbo_tasks_fs::{
self, File, FileContent, FileSystem, FileSystemPath, FileSystemPathOption, VirtualFileSystem,
Expand Down Expand Up @@ -586,7 +586,18 @@ struct PageEndpoint {
}

#[derive(
Copy, Clone, PartialEq, Eq, Hash, Debug, TaskInput, TraceRawVcs, NonLocalValue, Encode, Decode,
Copy,
Clone,
PartialEq,
Eq,
Hash,
Debug,
TaskInput,
IsTransient,
TraceRawVcs,
NonLocalValue,
Encode,
Decode,
)]
enum PageEndpointType {
Api,
Expand All @@ -598,14 +609,18 @@ enum PageEndpointType {
SsrOnly,
}

#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug, TaskInput, TraceRawVcs, Encode, Decode)]
#[derive(
Copy, Clone, PartialEq, Eq, Hash, Debug, TaskInput, IsTransient, TraceRawVcs, Encode, Decode,
)]
enum SsrChunkType {
Page,
Data,
Api,
}

#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, TaskInput, TraceRawVcs, Encode, Decode)]
#[derive(
Copy, Clone, Debug, PartialEq, Eq, Hash, TaskInput, IsTransient, TraceRawVcs, Encode, Decode,
)]
enum EmitManifests {
/// Don't emit any manifests
None,
Expand Down
11 changes: 8 additions & 3 deletions crates/next-api/src/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ use serde::{Deserialize, Serialize};
use tracing::{Instrument, field::Empty};
use turbo_rcstr::{RcStr, rcstr};
use turbo_tasks::{
Completion, Completions, FxIndexMap, NonLocalValue, OperationValue, OperationVc, ReadRef,
ResolvedVc, State, TaskInput, TransientInstance, TryFlatJoinIterExt, TryJoinIterExt, Vc,
debug::ValueDebugFormat, fxindexmap, trace::TraceRawVcs,
Completion, Completions, FxIndexMap, IsTransient, NonLocalValue, OperationValue, OperationVc,
ReadRef, ResolvedVc, State, TaskInput, TransientInstance, TryFlatJoinIterExt, TryJoinIterExt,
Vc, debug::ValueDebugFormat, fxindexmap, trace::TraceRawVcs,
};
use turbo_tasks_env::{EnvMap, ProcessEnv};
use turbo_tasks_fs::{
Expand Down Expand Up @@ -107,6 +107,7 @@ use crate::{
Deserialize,
Clone,
TaskInput,
IsTransient,
PartialEq,
Eq,
Hash,
Expand All @@ -131,6 +132,7 @@ pub struct DraftModeOptions {
Copy,
Clone,
TaskInput,
IsTransient,
PartialEq,
Eq,
Hash,
Expand All @@ -157,6 +159,7 @@ pub struct WatchOptions {
Deserialize,
Clone,
TaskInput,
IsTransient,
PartialEq,
Eq,
Hash,
Expand All @@ -179,6 +182,7 @@ pub struct DebugBuildPaths {
Copy,
Clone,
TaskInput,
IsTransient,
PartialEq,
Eq,
Hash,
Expand Down Expand Up @@ -427,6 +431,7 @@ pub struct PartialProjectOptions {
Deserialize,
Clone,
TaskInput,
IsTransient,
PartialEq,
Eq,
Hash,
Expand Down
18 changes: 15 additions & 3 deletions crates/next-core/src/app_structure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ use rustc_hash::FxHashMap;
use tracing::Instrument;
use turbo_rcstr::{RcStr, rcstr};
use turbo_tasks::{
FxIndexMap, FxIndexSet, NonLocalValue, ResolvedVc, TaskInput, TryJoinIterExt, ValueDefault,
ValueToStringRef, Vc, debug::ValueDebugFormat, fxindexmap, trace::TraceRawVcs, turbobail,
FxIndexMap, FxIndexSet, IsTransient, NonLocalValue, ResolvedVc, TaskInput, TryJoinIterExt,
ValueDefault, ValueToStringRef, Vc, debug::ValueDebugFormat, fxindexmap, trace::TraceRawVcs,
turbobail,
};
use turbo_tasks_fs::{DirectoryContent, DirectoryEntry, FileSystemEntryType, FileSystemPath};
use turbopack_core::issue::{Issue, IssueExt, IssueSeverity, IssueStage, StyledString};
Expand Down Expand Up @@ -85,7 +86,17 @@ pub enum MetadataWithAltItem {

/// A single metadata file.
#[derive(
Clone, Debug, Hash, PartialEq, Eq, TaskInput, TraceRawVcs, NonLocalValue, Encode, Decode,
Clone,
Debug,
Hash,
PartialEq,
Eq,
TaskInput,
IsTransient,
TraceRawVcs,
NonLocalValue,
Encode,
Decode,
)]
pub enum MetadataItem {
Static { path: FileSystemPath },
Expand Down Expand Up @@ -570,6 +581,7 @@ impl ValueDefault for FileSystemPathVec {
ValueDebugFormat,
Debug,
TaskInput,
IsTransient,
NonLocalValue,
Encode,
Decode,
Expand Down
5 changes: 2 additions & 3 deletions crates/next-core/src/mode.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
use turbo_rcstr::{RcStr, rcstr};
use turbo_tasks::TaskInput;
use turbopack_ecmascript_runtime::RuntimeType;

use crate::next_shared::webpack_rules::WebpackLoaderBuiltinCondition;

/// The mode in which Next.js is running.
#[turbo_tasks::value(shared)]
#[derive(Debug, Copy, Clone, TaskInput, Ord, PartialOrd, Hash)]
#[turbo_tasks::value(shared, task_input)]
#[derive(Debug, Copy, Clone, Ord, PartialOrd, Hash)]
pub enum NextMode {
/// `next dev --turbopack`
Development,
Expand Down
7 changes: 6 additions & 1 deletion crates/next-core/src/next_app/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use std::{
use anyhow::{Result, bail};
use bincode::{Decode, Encode};
use turbo_rcstr::RcStr;
use turbo_tasks::{NonLocalValue, TaskInput, trace::TraceRawVcs};
use turbo_tasks::{IsTransient, NonLocalValue, TaskInput, trace::TraceRawVcs};

pub use crate::next_app::{
app_client_references_chunks::{ClientReferencesChunks, get_app_client_references_chunks},
Expand All @@ -34,6 +34,7 @@ pub use crate::next_app::{
PartialOrd,
Ord,
TaskInput,
IsTransient,
TraceRawVcs,
NonLocalValue,
Encode,
Expand Down Expand Up @@ -139,6 +140,7 @@ impl Display for PageSegment {
PartialOrd,
Ord,
TaskInput,
IsTransient,
TraceRawVcs,
NonLocalValue,
Encode,
Expand Down Expand Up @@ -169,6 +171,7 @@ impl Display for PageType {
Eq,
Default,
TaskInput,
IsTransient,
TraceRawVcs,
NonLocalValue,
Encode,
Expand Down Expand Up @@ -365,6 +368,7 @@ impl PartialOrd for AppPage {
PartialOrd,
Ord,
TaskInput,
IsTransient,
TraceRawVcs,
NonLocalValue,
Encode,
Expand Down Expand Up @@ -417,6 +421,7 @@ impl Display for PathSegment {
Eq,
Default,
TaskInput,
IsTransient,
TraceRawVcs,
NonLocalValue,
Encode,
Expand Down
10 changes: 6 additions & 4 deletions crates/next-core/src/next_client/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::collections::BTreeSet;
use anyhow::Result;
use bincode::{Decode, Encode};
use turbo_rcstr::{RcStr, rcstr};
use turbo_tasks::{ResolvedVc, TaskInput, Vc, trace::TraceRawVcs};
use turbo_tasks::{IsTransient, ResolvedVc, TaskInput, Vc, trace::TraceRawVcs};
use turbo_tasks_fs::FileSystemPath;
use turbopack::module_options::{
CssOptionsContext, EcmascriptOptionsContext, JsxTransformOptions, ModuleRule,
Expand Down Expand Up @@ -135,8 +135,8 @@ pub async fn get_client_compile_time_info(
.await
}

#[turbo_tasks::value(shared)]
#[derive(Debug, Clone, Hash, TaskInput)]
#[turbo_tasks::value(shared, task_input)]
#[derive(Debug, Clone, Hash)]
pub enum ClientContextType {
Pages { pages_dir: FileSystemPath },
App { app_dir: FileSystemPath },
Expand Down Expand Up @@ -454,7 +454,9 @@ pub async fn get_client_module_options_context(
Ok(module_options_context)
}

#[derive(Clone, Debug, PartialEq, Eq, Hash, TaskInput, TraceRawVcs, Encode, Decode)]
#[derive(
Clone, Debug, PartialEq, Eq, Hash, TaskInput, IsTransient, TraceRawVcs, Encode, Decode,
)]
pub struct ClientChunkingContextOptions {
pub mode: Vc<NextMode>,
pub root_path: FileSystemPath,
Expand Down
5 changes: 3 additions & 2 deletions crates/next-core/src/next_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ use serde_json::Value as JsonValue;
use turbo_esregex::EsRegex;
use turbo_rcstr::{RcStr, rcstr};
use turbo_tasks::{
FxIndexMap, NonLocalValue, OperationValue, ResolvedVc, TaskInput, Vc, debug::ValueDebugFormat,
trace::TraceRawVcs,
FxIndexMap, IsTransient, NonLocalValue, OperationValue, ResolvedVc, TaskInput, Vc,
debug::ValueDebugFormat, trace::TraceRawVcs,
};
use turbo_tasks_env::EnvMap;
use turbo_tasks_fetch::FetchClientConfig;
Expand Down Expand Up @@ -358,6 +358,7 @@ pub struct OptionOutputType(Option<OutputType>);
Ord,
PartialOrd,
TaskInput,
IsTransient,
TraceRawVcs,
Serialize,
Deserialize,
Expand Down
6 changes: 4 additions & 2 deletions crates/next-core/src/next_edge/context.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use anyhow::Result;
use bincode::{Decode, Encode};
use turbo_rcstr::{RcStr, rcstr};
use turbo_tasks::{ResolvedVc, TaskInput, Vc, trace::TraceRawVcs};
use turbo_tasks::{IsTransient, ResolvedVc, TaskInput, Vc, trace::TraceRawVcs};
use turbo_tasks_fs::FileSystemPath;
use turbopack_browser::BrowserChunkingContext;
use turbopack_core::{
Expand Down Expand Up @@ -183,7 +183,9 @@ pub async fn get_edge_resolve_options_context(
.cell())
}

#[derive(Clone, Debug, PartialEq, Eq, Hash, TaskInput, TraceRawVcs, Encode, Decode)]
#[derive(
Clone, Debug, PartialEq, Eq, Hash, TaskInput, IsTransient, TraceRawVcs, Encode, Decode,
)]
pub struct EdgeChunkingContextOptions {
pub mode: Vc<NextMode>,
pub root_path: FileSystemPath,
Expand Down
8 changes: 5 additions & 3 deletions crates/next-core/src/next_font/google/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ use bincode::{Decode, Encode};
use serde::Deserialize;
use turbo_rcstr::{RcStr, rcstr};
use turbo_tasks::{
FxIndexMap, FxIndexSet, NonLocalValue, TaskInput, Vc, fxindexset, trace::TraceRawVcs,
FxIndexMap, FxIndexSet, IsTransient, NonLocalValue, TaskInput, Vc, fxindexset,
trace::TraceRawVcs,
};

use super::request::{NextFontRequest, OneOrManyStrings};
Expand All @@ -12,8 +13,8 @@ const ALLOWED_DISPLAY_VALUES: &[&str] = &["auto", "block", "swap", "fallback", "

pub(super) type FontData = FxIndexMap<RcStr, FontDataEntry>;

#[turbo_tasks::value]
#[derive(Clone, Debug, PartialOrd, Ord, Hash, TaskInput)]
#[turbo_tasks::value(task_input)]
#[derive(Clone, Debug, PartialOrd, Ord, Hash)]
pub(super) struct NextFontGoogleOptions {
/// Name of the requested font from Google. Contains literal spaces.
pub font_family: RcStr,
Expand Down Expand Up @@ -56,6 +57,7 @@ impl NextFontGoogleOptions {
TraceRawVcs,
NonLocalValue,
TaskInput,
IsTransient,
Encode,
Decode,
)]
Expand Down
Loading
Loading