From 02355ddd4cf05c039b55f14a2ca7fc1d06531048 Mon Sep 17 00:00:00 2001 From: marc2332 Date: Sat, 20 May 2023 22:06:35 +0200 Subject: [PATCH] feat: Move layout_attributes behind a feature in native-core --- packages/dioxus-tui/Cargo.toml | 2 +- packages/native-core/Cargo.toml | 10 ++++------ packages/native-core/src/lib.rs | 1 + packages/rink/Cargo.toml | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/packages/dioxus-tui/Cargo.toml b/packages/dioxus-tui/Cargo.toml index 43e568b0f..87c12fb82 100644 --- a/packages/dioxus-tui/Cargo.toml +++ b/packages/dioxus-tui/Cargo.toml @@ -16,7 +16,7 @@ license = "MIT/Apache-2.0" dioxus = { path = "../dioxus", version = "^0.3.0" } dioxus-core = { path = "../core", version = "^0.3.0", features = ["serialize"] } dioxus-html = { path = "../html", version = "^0.3.0" } -dioxus-native-core = { path = "../native-core", version = "^0.2.0", features = ["dioxus"] } +dioxus-native-core = { path = "../native-core", version = "^0.2.0", features = ["dioxus", "taffy"] } dioxus-native-core-macro = { path = "../native-core-macro", version = "^0.3.0" } dioxus-hot-reload = { path = "../hot-reload", optional = true } rink = { path = "../rink" } diff --git a/packages/native-core/Cargo.toml b/packages/native-core/Cargo.toml index 9ea6d4c9f..05cbc8393 100644 --- a/packages/native-core/Cargo.toml +++ b/packages/native-core/Cargo.toml @@ -14,18 +14,15 @@ keywords = ["dom", "ui", "gui", "react"] dioxus-core = { path = "../core", version = "^0.3.0", optional = true } keyboard-types = "0.6.2" -taffy = "0.2.1" smallvec = "1.6" rustc-hash = "1.1.0" anymap = "1.0.0-beta.2" -slab = "0.4" parking_lot = { version = "0.12.1", features = ["send_guard"] } -crossbeam-deque = "0.8.2" dashmap = "5.4.0" -hashbrown = { version = "0.13.2", features = ["raw"] } # for parsing attributes -lightningcss = "1.0.0-alpha.39" +taffy = { version = "0.2.1", optional = true } +lightningcss = { version = "1.0.0-alpha.39", optional = true } rayon = "1.6.1" shipyard = { version = "0.6.2", features = ["proc", "std"], default-features = false } @@ -35,10 +32,11 @@ shipyard_hierarchy = "0.6.0" rand = "0.8.5" dioxus = { path = "../dioxus", version = "^0.3.0" } tokio = { version = "*", features = ["full"] } -dioxus-native-core = { path = ".", features = ["dioxus"] } +dioxus-native-core = { path = ".", features = ["dioxus", "taffy"] } dioxus-native-core-macro = { path = "../native-core-macro" } [features] default = [] +taffy = ["dep:taffy", "dep:lightningcss"] dioxus = ["dioxus-core"] parallel = ["shipyard/parallel"] diff --git a/packages/native-core/src/lib.rs b/packages/native-core/src/lib.rs index 0740d881a..d50c7cf0f 100644 --- a/packages/native-core/src/lib.rs +++ b/packages/native-core/src/lib.rs @@ -9,6 +9,7 @@ use rustc_hash::FxHasher; #[cfg(feature = "dioxus")] pub mod dioxus; +#[cfg(feature = "taffy")] pub mod layout_attributes; pub mod node; pub mod node_ref; diff --git a/packages/rink/Cargo.toml b/packages/rink/Cargo.toml index 2f08eb720..3ad0136a1 100644 --- a/packages/rink/Cargo.toml +++ b/packages/rink/Cargo.toml @@ -14,7 +14,7 @@ license = "MIT/Apache-2.0" [dependencies] dioxus-html = { path = "../html", version = "^0.3.0" } -dioxus-native-core = { path = "../native-core", version = "^0.2.0" } +dioxus-native-core = { path = "../native-core", version = "^0.2.0", features = ["taffy"]} dioxus-native-core-macro = { path = "../native-core-macro", version = "^0.3.0" } tui = "0.17.0"