Quellcode durchsuchen

Merge pull request #1036 from marc2332/feat/native-core-optional-deps

feat: Move layout_attributes behind a feature in native-core
Jon Kelley vor 2 Jahren
Ursprung
Commit
dfb05540c3
3 geänderte Dateien mit 5 neuen und 5 gelöschten Zeilen
  1. 3 4
      packages/native-core/Cargo.toml
  2. 1 0
      packages/native-core/src/lib.rs
  3. 1 1
      packages/rink/Cargo.toml

+ 3 - 4
packages/native-core/Cargo.toml

@@ -14,18 +14,16 @@ keywords = ["dom", "ui", "gui", "react"]
 dioxus-core = { workspace = true, optional = true }
 
 keyboard-types = "0.6.2"
-taffy = "0.3.12"
 smallvec = "1.6"
 rustc-hash = { workspace = true }
 anymap = "1.0.0-beta.2"
 slab = { workspace = true }
 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.3.12", 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 }
@@ -39,5 +37,6 @@ dioxus-native-core-macro = { workspace = true }
 
 [features]
 default = []
+layout-attributes = ["dep:taffy", "dep:lightningcss"]
 dioxus = ["dioxus-core"]
 parallel = ["shipyard/parallel"]

+ 1 - 0
packages/native-core/src/lib.rs

@@ -9,6 +9,7 @@ use rustc_hash::FxHasher;
 
 #[cfg(feature = "dioxus")]
 pub mod dioxus;
+#[cfg(feature = "layout-attributes")]
 pub mod layout_attributes;
 pub mod node;
 pub mod node_ref;

+ 1 - 1
packages/rink/Cargo.toml

@@ -14,7 +14,7 @@ license = "MIT/Apache-2.0"
 
 [dependencies]
 dioxus-html = { workspace = true }
-dioxus-native-core = { workspace = true }
+dioxus-native-core = { workspace = true, features = ["layout-attributes"] }
 dioxus-native-core-macro = { workspace = true }
 
 tui = "0.17.0"