Skip to content
Merged
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
2 changes: 2 additions & 0 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ chromiumoxide = { version = "0.5.4", features = [
# sync with chromiumoxide's tungstenite requirement.
tungstenite = "0.20.1"

allocator-api2 = "0.2.21"
# flate2_zlib requires zlib, use flate2_rust
allsorts = { version = "0.14.0", default-features = false, features = [
"flate2_rust",
Expand All @@ -248,6 +249,7 @@ anyhow = "1.0.100"
async-trait = "0.1.64"
bincode = { version = "2.0.1", features = ["serde"] }
bitfield = "0.19.4"
bumpalo = { version = "3.19.0", features = ["boxed", "collections", "allocator-api2"] }
byteorder = "1.5.0"
bytes = "1.11.1"
bytes-str = "0.2.7"
Expand Down
10 changes: 3 additions & 7 deletions crates/next-api/src/next_server_nft.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ use bincode::{Decode, Encode};
use either::Either;
use next_core::{get_next_package, next_server::get_tracing_compile_time_info};
use serde_json::json;
use turbo_tasks::{
NonLocalValue, ResolvedVc, TaskInput, TryFlatJoinIterExt, TryJoinIterExt, Vc,
trace::TraceRawVcs,
};
use turbo_tasks::{ResolvedVc, TryFlatJoinIterExt, TryJoinIterExt, Vc, trace::TraceRawVcs};
use turbo_tasks_fs::{
DirectoryContent, DirectoryEntry, File, FileContent, FileSystemPath, glob::Glob,
};
Expand All @@ -26,9 +23,8 @@ use turbopack_resolve::ecmascript::cjs_resolve;

use crate::{nft::traced_modules_for_entries, project::Project};

#[derive(
PartialEq, Eq, TraceRawVcs, NonLocalValue, Debug, Clone, Hash, TaskInput, Encode, Decode,
)]
#[turbo_tasks::task_input]
#[derive(PartialEq, Eq, TraceRawVcs, Debug, Clone, Hash, Encode, Decode)]
enum ServerNftType {
Minimal,
Full,
Expand Down
16 changes: 3 additions & 13 deletions 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, NonLocalValue, OperationValue, OperationVc, ResolvedVc, Vc,
debug::ValueDebugFormat, take_effects, trace::TraceRawVcs,
};
use turbopack_core::issue::CollectibleIssuesExt;
Expand Down Expand Up @@ -108,19 +108,9 @@ fn pick_route(entrypoints: OperationVc<Entrypoints>, key: RcStr, route: &Route)
}
}

#[turbo_tasks::task_input]
#[derive(
Debug,
Clone,
TaskInput,
TraceRawVcs,
PartialEq,
Eq,
Hash,
ValueDebugFormat,
NonLocalValue,
OperationValue,
Encode,
Decode,
Debug, Clone, TraceRawVcs, PartialEq, Eq, Hash, ValueDebugFormat, OperationValue, Encode, Decode,
)]
enum EndpointSelector {
RoutePageHtml(RcStr),
Expand Down
15 changes: 8 additions & 7 deletions crates/next-api/src/pages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,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, ResolvedVc, ValueToString, Vc, fxindexmap, fxindexset,
trace::TraceRawVcs,
};
use turbo_tasks_fs::{
self, File, FileContent, FileSystem, FileSystemPath, FileSystemPathOption, VirtualFileSystem,
Expand Down Expand Up @@ -588,9 +588,8 @@ struct PageEndpoint {
pages_structure: ResolvedVc<PagesStructure>,
}

#[derive(
Copy, Clone, PartialEq, Eq, Hash, Debug, TaskInput, TraceRawVcs, NonLocalValue, Encode, Decode,
)]
#[turbo_tasks::task_input]
#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug, TraceRawVcs, Encode, Decode)]
enum PageEndpointType {
Api,
Html,
Expand All @@ -601,14 +600,16 @@ enum PageEndpointType {
SsrOnly,
}

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

#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, TaskInput, TraceRawVcs, Encode, Decode)]
#[turbo_tasks::task_input]
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, TraceRawVcs, Encode, Decode)]
enum EmitManifests {
/// Don't emit any manifests
None,
Expand Down
30 changes: 7 additions & 23 deletions crates/next-api/src/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ 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,
ResolvedVc, State, TransientInstance, TryFlatJoinIterExt, TryJoinIterExt, Vc,
debug::ValueDebugFormat, fxindexmap, trace::TraceRawVcs,
};
use turbo_tasks_env::{EnvMap, ProcessEnv};
Expand Down Expand Up @@ -103,17 +103,16 @@ use crate::{
versioned_content_map::VersionedContentMap,
};

#[turbo_tasks::task_input]
#[derive(
Debug,
Serialize,
Deserialize,
Clone,
TaskInput,
PartialEq,
Eq,
Hash,
TraceRawVcs,
NonLocalValue,
OperationValue,
Encode,
Decode,
Expand All @@ -125,19 +124,18 @@ pub struct DraftModeOptions {
pub preview_mode_signing_key: RcStr,
}

#[turbo_tasks::task_input]
#[derive(
Debug,
Default,
Serialize,
Deserialize,
Copy,
Clone,
TaskInput,
PartialEq,
Eq,
Hash,
TraceRawVcs,
NonLocalValue,
OperationValue,
Encode,
Decode,
Expand All @@ -152,18 +150,17 @@ pub struct WatchOptions {
pub poll_interval: Option<Duration>,
}

#[turbo_tasks::task_input]
#[derive(
Debug,
Default,
Serialize,
Deserialize,
Clone,
TaskInput,
PartialEq,
Eq,
Hash,
TraceRawVcs,
NonLocalValue,
OperationValue,
Encode,
Decode,
Expand All @@ -175,20 +172,8 @@ pub struct DebugBuildPaths {
}

/// Target for HMR operations - client-side (browser) or server-side (Node.js).
#[derive(
Debug,
Default,
Copy,
Clone,
TaskInput,
PartialEq,
Eq,
Hash,
TraceRawVcs,
NonLocalValue,
Encode,
Decode,
)]
#[turbo_tasks::task_input]
#[derive(Debug, Default, Copy, Clone, PartialEq, Eq, Hash, TraceRawVcs, Encode, Decode)]
pub enum HmrTarget {
#[default]
Client,
Expand Down Expand Up @@ -439,17 +424,16 @@ pub struct PartialProjectOptions {
pub debug_build_paths: Option<DebugBuildPaths>,
}

#[turbo_tasks::task_input]
#[derive(
Debug,
Serialize,
Deserialize,
Clone,
TaskInput,
PartialEq,
Eq,
Hash,
TraceRawVcs,
NonLocalValue,
OperationValue,
Encode,
Decode,
Expand Down
22 changes: 5 additions & 17 deletions crates/next-core/src/app_structure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use rustc_hash::FxHashMap;
use tracing::Instrument;
use turbo_rcstr::{RcStr, rcstr};
use turbo_tasks::{
FxIndexMap, FxIndexSet, NonLocalValue, ResolvedVc, TaskInput, TryJoinIterExt, ValueDefault,
FxIndexMap, FxIndexSet, NonLocalValue, ResolvedVc, TryJoinIterExt, ValueDefault,
ValueToStringRef, Vc, debug::ValueDebugFormat, fxindexmap, trace::TraceRawVcs, turbobail,
};
use turbo_tasks_fs::{DirectoryContent, DirectoryEntry, FileSystemEntryType, FileSystemPath};
Expand Down Expand Up @@ -84,9 +84,8 @@ pub enum MetadataWithAltItem {
}

/// A single metadata file.
#[derive(
Clone, Debug, Hash, PartialEq, Eq, TaskInput, TraceRawVcs, NonLocalValue, Encode, Decode,
)]
#[turbo_tasks::task_input]
#[derive(Clone, Debug, Hash, PartialEq, Eq, TraceRawVcs, Encode, Decode)]
pub enum MetadataItem {
Static { path: FileSystemPath },
Dynamic { path: FileSystemPath },
Expand Down Expand Up @@ -561,19 +560,8 @@ impl ValueDefault for FileSystemPathVec {
}
}

#[derive(
Clone,
PartialEq,
Eq,
Hash,
TraceRawVcs,
ValueDebugFormat,
Debug,
TaskInput,
NonLocalValue,
Encode,
Decode,
)]
#[turbo_tasks::task_input]
#[derive(Clone, PartialEq, Eq, Hash, TraceRawVcs, ValueDebugFormat, Debug, Encode, Decode)]
pub enum Entrypoint {
AppPage {
pages: Vec<AppPage>,
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
Loading
Loading