Native: Split dioxus-native-dom crate out of dioxus-native (#4366)
Signed-off-by: Nico Burns <nico@nicoburns.com>
This commit is contained in:
1 parent
b252528722
commit
a4ebdcb69e
10 files changed
+129
-63
No files matched your search
@@ -0,0 +1,51 @@
|
||||
#![cfg_attr(docsrs, feature(doc_cfg))]
|
||||
|
||||
//! Core headless native renderer for Dioxus.
|
||||
//!
|
||||
//! ## Feature flags
|
||||
//! - `default`: Enables the features listed below.
|
||||
//! - `accessibility`: Enables [`accesskit`](https://docs.rs/accesskit/latest/accesskit/) accessibility support.
|
||||
//! - `hot-reload`: Enables hot-reloading of Dioxus RSX.
|
||||
//! - `menu`: Enables the [`muda`](https://docs.rs/muda/latest/muda/) menubar.
|
||||
//! - `tracing`: Enables tracing support.
|
||||
|
||||
mod dioxus_document;
|
||||
mod events;
|
||||
mod mutation_writer;
|
||||
pub use dioxus_document::DioxusDocument;
|
||||
|
||||
use blitz_dom::{ns, LocalName, Namespace, QualName};
|
||||
type NodeId = usize;
|
||||
|
||||
pub(crate) fn qual_name(local_name: &str, namespace: Option<&str>) -> QualName {
|
||||
QualName {
|
||||
prefix: None,
|
||||
ns: namespace.map(Namespace::from).unwrap_or(ns!(html)),
|
||||
local: LocalName::from(local_name),
|
||||
}
|
||||
}
|
||||
|
||||
// Syntax sugar to make tracing calls less noisy in function below
|
||||
macro_rules! trace {
|
||||
($pattern:literal) => {{
|
||||
#[cfg(feature = "tracing")]
|
||||
tracing::info!($pattern);
|
||||
}};
|
||||
($pattern:literal, $item1:expr) => {{
|
||||
#[cfg(feature = "tracing")]
|
||||
tracing::info!($pattern, $item1);
|
||||
}};
|
||||
($pattern:literal, $item1:expr, $item2:expr) => {{
|
||||
#[cfg(feature = "tracing")]
|
||||
tracing::info!($pattern, $item1, $item2);
|
||||
}};
|
||||
($pattern:literal, $item1:expr, $item2:expr, $item3:expr) => {{
|
||||
#[cfg(feature = "tracing")]
|
||||
tracing::info!($pattern, $item1, $item2);
|
||||
}};
|
||||
($pattern:literal, $item1:expr, $item2:expr, $item3:expr, $item4:expr) => {{
|
||||
#[cfg(feature = "tracing")]
|
||||
tracing::info!($pattern, $item1, $item2, $item3, $item4);
|
||||
}};
|
||||
}
|
||||
pub(crate) use trace;
|
||||
Reference in new issue
Block a user