optimizations for wasm size (#582)

* optimize for size

* fix tests

* revert log feature

* make backtrace not optional

* remove dev feature from web dev-deps
This commit is contained in:
Demonthos authored and GitHub committed 2022-11-16 22:22:13 -08:00
1 parent 8ea61e1b3e
commit f21c8423eb
6 files changed
+61 -28

No files matched your search

+5 -1
View File
@@ -67,6 +67,7 @@ mod cfg;
mod dom;
#[cfg(any(feature = "hot-reload", debug_assertions))]
mod hot_reload;
#[cfg(feature = "hydrate")]
mod rehydrate;
// mod ric_raf;
mod util;
@@ -164,7 +165,8 @@ where
pub async fn run_with_props<T: 'static + Send>(root: Component<T>, root_props: T, cfg: Config) {
let mut dom = VirtualDom::new_with_props(root, root_props);
if cfg!(feature = "panic_hook") && cfg.default_panic_hook {
#[cfg(feature = "panic_hook")]
if cfg.default_panic_hook {
console_error_panic_hook::set_once();
}
@@ -194,6 +196,8 @@ pub async fn run_with_props<T: 'static + Send>(root: Component<T>, root_props: T
// it's a waste to produce edits just to get the vdom loaded
let _ = dom.rebuild();
#[cfg(feature = "hydrate")]
#[allow(unused_variables)]
if let Err(err) = websys_dom.rehydrate(&dom) {
log::error!(
"Rehydration failed {:?}. Rebuild DOM into element from scratch",