From 7975ac84e6115a8579c0607942f48384fca9fc18 Mon Sep 17 00:00:00 2001 From: Nico Burniske Date: Fri, 12 Apr 2024 11:17:00 -0400 Subject: [PATCH] attempt global override with compile time env value --- example/start-axum/.cargo/config.toml | 2 + example/start-axum/Cargo.lock | 68 +++++++++------------------ example/start-axum/Cargo.toml | 4 +- example/start-axum/src/app.rs | 9 +++- example/start-axum/tailwind.config.js | 1 + fuse/benches/merge.rs | 4 +- fuse/src/core/merge/merge_impl.rs | 3 +- fuse/src/core/merge/mod.rs | 42 +++++++---------- fuse/src/lib.rs | 2 +- fuse/tests/override.rs | 8 ++-- 10 files changed, 61 insertions(+), 82 deletions(-) create mode 100644 example/start-axum/.cargo/config.toml diff --git a/example/start-axum/.cargo/config.toml b/example/start-axum/.cargo/config.toml new file mode 100644 index 0000000..d62f4a5 --- /dev/null +++ b/example/start-axum/.cargo/config.toml @@ -0,0 +1,2 @@ +[env] +TW_PREFIX = "tw-" \ No newline at end of file diff --git a/example/start-axum/Cargo.lock b/example/start-axum/Cargo.lock index 543db79..dd1ddf4 100644 --- a/example/start-axum/Cargo.lock +++ b/example/start-axum/Cargo.lock @@ -1979,11 +1979,20 @@ checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" [[package]] name = "tailwind_fuse" -version = "0.1.0" +version = "0.2.0" dependencies = [ - "tw_fuse", - "tw_utils", - "tw_variant_macro", + "nom", + "tailwind_fuse_macro", +] + +[[package]] +name = "tailwind_fuse_macro" +version = "0.2.0" +dependencies = [ + "darling 0.20.8", + "proc-macro2", + "quote", + "syn 2.0.52", ] [[package]] @@ -2190,37 +2199,6 @@ dependencies = [ "once_cell", ] -[[package]] -name = "tw_ast" -version = "0.1.0" -dependencies = [ - "nom", -] - -[[package]] -name = "tw_fuse" -version = "0.1.0" -dependencies = [ - "nom", - "tw_ast", -] - -[[package]] -name = "tw_utils" -version = "0.1.0" - -[[package]] -name = "tw_variant_macro" -version = "0.1.0" -dependencies = [ - "darling 0.20.8", - "proc-macro2", - "quote", - "syn 2.0.52", - "tw_fuse", - "tw_utils", -] - [[package]] name = "typed-builder" version = "0.18.1" @@ -2333,9 +2311,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.89" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -2343,9 +2321,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.89" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", "log", @@ -2370,9 +2348,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.89" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2380,9 +2358,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.89" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", @@ -2393,9 +2371,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.89" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "wasm-streams" diff --git a/example/start-axum/Cargo.toml b/example/start-axum/Cargo.toml index ef61136..588b5df 100644 --- a/example/start-axum/Cargo.toml +++ b/example/start-axum/Cargo.toml @@ -16,11 +16,11 @@ leptos_router = { version = "0.6", features = ["nightly"] } tokio = { version = "1", features = ["rt-multi-thread"], optional = true } tower = { version = "0.4", optional = true } tower-http = { version = "0.5", features = ["fs"], optional = true } -wasm-bindgen = "=0.2.89" +wasm-bindgen = "=0.2.92" thiserror = "1" tracing = { version = "0.1", optional = true } http = "1" -tailwind_fuse = { path = "../../public", features = ["variant"]} +tailwind_fuse = { path = "../../fuse", features = ["variant", "debug"]} [features] hydrate = ["leptos/hydrate", "leptos_meta/hydrate", "leptos_router/hydrate"] diff --git a/example/start-axum/src/app.rs b/example/start-axum/src/app.rs index 4ea583f..edcf304 100644 --- a/example/start-axum/src/app.rs +++ b/example/start-axum/src/app.rs @@ -2,9 +2,10 @@ use crate::{ button::{BtnSize, BtnVariant, Button}, error_template::{AppError, ErrorTemplate}, }; -use leptos::*; +use leptos::{logging::log, *}; use leptos_meta::*; use leptos_router::*; +use tailwind_fuse::{merge::MergeOptions, *}; #[component] pub fn App() -> impl IntoView { @@ -39,8 +40,12 @@ fn HomePage() -> impl IntoView { let (count, set_count) = create_signal(0); let on_click = move |_| set_count.update(|count| *count += 1); + let options = MergeOptions::default(); + log!("MergeOptions {options:?}"); + view! { -
+ // flex-row should be removed. +