flams/
lib.rs

1#![recursion_limit = "256"]
2//#![feature(let_chains)]
3/*! Foo Bar
4 *
5 * See [endpoints] for public API endpoints
6*/
7#![cfg_attr(docsrs, feature(doc_cfg))]
8
9/*#[cfg(any(
10    all(feature = "ssr", feature = "hydrate", not(doc)),
11    not(any(feature = "ssr", feature = "hydrate"))
12))]
13compile_error!("exactly one of the features \"ssr\" or \"hydrate\" must be enabled");
14*/
15
16#[cfg(feature = "ssr")]
17pub mod server;
18
19#[cfg(feature = "hydrate")]
20#[wasm_bindgen::prelude::wasm_bindgen]
21pub fn hydrate() {
22    use tracing_subscriber::prelude::*;
23    fn filter(lvl: tracing::Level) -> tracing_subscriber::filter::Targets {
24        tracing_subscriber::filter::Targets::new()
25            .with_target("ftml_dom", lvl)
26            .with_target("ftml_components", lvl)
27            .with_target("ftml_parser", lvl)
28            .with_target("ftml_backend", lvl)
29            .with_target("ssr_example", lvl)
30            .with_target("flams_flodown", lvl)
31            .with_target("flams_router_base", lvl)
32            .with_target(
33                "leptos_posthoc",
34                tracing_subscriber::filter::LevelFilter::ERROR,
35            )
36    }
37    console_error_panic_hook::set_once();
38    tracing_subscriber::registry()
39        .with(tracing_wasm::WASMLayer::default())
40        .with(filter(tracing::Level::WARN))
41        .init();
42    leptos::mount::hydrate_body(flams_router_dashboard::Main);
43}
44
45#[cfg(any(doc, feature = "docs"))]
46pub mod endpoints;