percy_dom/
lib.rs

1//! percy-dom provides a virtual dom implementation as well as an `html!` macro
2//! that you can use to generate a virtual dom.
3//!
4//! The virtual dom works on both the client and server. On the client we'll render
5//! to an `HtmlElement`, and on the server we render to a `String`.
6
7#![deny(missing_docs)]
8
9extern crate wasm_bindgen;
10
11pub use wasm_bindgen::JsCast;
12// Used so that `html!` calls work when people depend on this crate since `html!` needs
13// access to `Closure` when creating event handlers.
14pub use wasm_bindgen::prelude::Closure;
15
16#[cfg(feature = "macro")]
17pub use html_macro::html;
18pub use virtual_node::*;
19
20pub use crate::diff::*;
21pub use crate::patch::*;
22
23pub use self::pdom::PercyDom;
24
25mod diff;
26mod patch;
27mod pdom;
28
29pub mod render;
30pub mod single_page_app;
31
32/// Exports structs and macros that you'll almost always want access to in a virtual-dom
33/// powered application
34pub mod prelude {
35    // TODO: look through this prelude and remove anything that isn't necessary.
36
37    pub use std::vec::IntoIter;
38
39    pub use wasm_bindgen::prelude::Closure;
40
41    #[cfg(feature = "macro")]
42    pub use html_macro::html;
43    pub use virtual_node::{EventAttribFn, IterableNodes, View};
44
45    pub use crate::pdom::PercyDom;
46    pub use crate::VirtualNode;
47
48    // Used by the html-macro crate.
49    #[doc(hidden)]
50    pub mod __html_macro_helpers__ {
51        pub use virtual_node::event;
52        pub use web_sys;
53    }
54}