mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
## What Clean up the Lazy-locks we re-export or use internally in the turbo-tasks crates, migrating to `std::sync::LazyLock` / `std::cell::LazyCell` where still needed and eliminating a couple of them where they weren't. ## Why One less dep, using standard Rust features, a smaller number of Lazy items. ## Details - **Re-exports:** drop unused `macro_helpers::OnceCell` and the now-unused `macro_helpers::phf` (since `TraitType` no longer stores a `phf::Map`). Replace `once_cell::sync::Lazy` with `std::sync::LazyLock` in `macro_helpers::TRAIT_CAST_FNS` and in the two macro-generated call sites. - **`once_cell::sync::Lazy` → `std::sync::LazyLock`** in `scope.rs`, `registry/mod.rs`, and `turbo-tasks-backend-fuzz`'s `graph.rs`. - **`once_cell::unsync::Lazy` → `std::cell::LazyCell`** in `update_cell.rs`. - **`TRAIT_METHOD` → plain const-init static:** `TraitType::methods` changes from `phf::Map<&'static str, TraitMethod>` to `&'static [TraitMethod]` (parallel to `method_names`), and `TraitType::get` becomes a `const fn` that does `index_of_name` + array indexing. The `value_trait` macro now emits a slice literal instead of `phf_map!`, and the `function` macro emits `static TRAIT_METHOD: &'static TraitMethod = TRAIT.get(stringify!(..));` — evaluated at const-eval time rather than behind a `LazyLock<&TraitMethod>`. - **Dropped `once_cell` and `phf` Cargo deps** from `turbo-tasks`, and `once_cell` from `turbo-tasks-backend` and its fuzz crate.
66 lines
1.9 KiB
TOML
66 lines
1.9 KiB
TOML
[package]
|
|
name = "turbo-tasks"
|
|
version = "0.1.0"
|
|
description = "TBD"
|
|
license = "MIT"
|
|
edition = "2024"
|
|
|
|
[lib]
|
|
bench = false
|
|
|
|
[features]
|
|
default = []
|
|
tokio_tracing = ["tokio/tracing"]
|
|
hanging_detection = []
|
|
task_id_details = []
|
|
verify_determinism = []
|
|
|
|
# TODO(bgw): This feature is here to unblock turning on local tasks by default. It's only turned on
|
|
# in unit tests. This will be removed very soon.
|
|
non_operation_vc_strongly_consistent = []
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[dependencies]
|
|
anyhow = { workspace = true }
|
|
async-trait = { workspace = true }
|
|
auto-hash-map = { workspace = true }
|
|
bincode = { workspace = true }
|
|
concurrent-queue = { workspace = true }
|
|
dashmap = { workspace = true }
|
|
either = { workspace = true }
|
|
erased-serde = { workspace = true }
|
|
event-listener = "5.4.0"
|
|
futures = { workspace = true }
|
|
indexmap = { workspace = true, features = ["serde"] }
|
|
inventory = { workspace = true }
|
|
parking_lot = { workspace = true, features = ["serde"]}
|
|
pin-project-lite = { workspace = true }
|
|
rayon = { workspace = true }
|
|
regex = { workspace = true }
|
|
rustc-hash = { workspace = true }
|
|
serde = { workspace = true, features = ["rc", "derive"] }
|
|
serde_json = { workspace = true }
|
|
shrink-to-fit = { workspace = true, features = ["indexmap", "serde_json", "smallvec", "nightly"] }
|
|
smallvec = { workspace = true }
|
|
tokio = { workspace = true, features = ["full"] }
|
|
tokio-util = { workspace = true }
|
|
tracing = { workspace = true }
|
|
triomphe = { workspace = true, features = ["unsize", "unstable"] }
|
|
turbo-bincode = { workspace = true }
|
|
turbo-dyn-eq-hash = { workspace = true }
|
|
turbo-frozenmap = { workspace = true }
|
|
turbo-rcstr = { workspace = true }
|
|
turbo-tasks-hash = { workspace = true }
|
|
turbo-tasks-macros = { workspace = true }
|
|
turbo-tasks-malloc = { workspace = true }
|
|
unsize = { workspace = true }
|
|
|
|
[dev-dependencies]
|
|
criterion = { workspace = true, features = ["async_tokio"] }
|
|
|
|
[[bench]]
|
|
name = "mod"
|
|
harness = false
|