From e33ee7ec992fe1a58f65c8e271c695ef83578ef1 Mon Sep 17 00:00:00 2001 From: Sam Judelson <64875465+sjud@users.noreply.github.com> Date: Thu, 15 Feb 2024 17:37:19 -0500 Subject: [PATCH] pub export server is either from leptos_macro or leptos_spin_macro depending on if spin feature is enabled. (#2280) * leptos spin server macro * leptos spin * git chng * based on the fermyon official git for when that works --- leptos/Cargo.toml | 6 +++++- leptos/src/lib.rs | 9 ++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/leptos/Cargo.toml b/leptos/Cargo.toml index 194a472c6..2e718b883 100644 --- a/leptos/Cargo.toml +++ b/leptos/Cargo.toml @@ -15,6 +15,7 @@ leptos_macro = { workspace = true } leptos_reactive = { workspace = true } leptos_server = { workspace = true } leptos_config = { workspace = true } +leptos-spin-macro = { git = "https://github.com/fermyon/leptos-spin", optional = true} tracing = "0.1" typed-builder = "0.18" typed-builder-macro = "0.18" @@ -66,7 +67,10 @@ miniserde = ["leptos_reactive/miniserde"] rkyv = ["leptos_reactive/rkyv"] tracing = ["leptos_macro/tracing"] nonce = ["leptos_dom/nonce"] -spin = ["leptos_reactive/spin"] +spin = [ + "leptos_reactive/spin", + "leptos-spin-macro" +] experimental-islands = [ "leptos_dom/experimental-islands", "leptos_macro/experimental-islands", diff --git a/leptos/src/lib.rs b/leptos/src/lib.rs index 7ffba8638..833df76a5 100644 --- a/leptos/src/lib.rs +++ b/leptos/src/lib.rs @@ -179,7 +179,14 @@ pub mod error { pub use leptos_macro::template; #[cfg(not(all(target_arch = "wasm32", feature = "template_macro")))] pub use leptos_macro::view as template; -pub use leptos_macro::{component, island, server, slice, slot, view, Params}; +pub use leptos_macro::{component, island, slice, slot, view, Params}; +cfg_if::cfg_if!( + if #[cfg(feature="spin")] { + pub use leptos_spin_macro::server; + } else { + pub use leptos_macro::server; + } +); pub use leptos_reactive::*; pub use leptos_server::{ self, create_action, create_multi_action, create_server_action,