diff --git a/examples/js-performance-benchmark-sauron/Cargo.toml b/examples/js-performance-benchmark-sauron/Cargo.toml index d644245a..9ea696ae 100644 --- a/examples/js-performance-benchmark-sauron/Cargo.toml +++ b/examples/js-performance-benchmark-sauron/Cargo.toml @@ -10,10 +10,7 @@ crate-type = ["cdylib"] [dependencies] rand = { version = "0.8.5", features = ["small_rng"] } getrandom = { version = "0.2.7", features = ["js"] } -#sauron = { path = "../../../sauron", features = ["with-debug", "with-measure", "log-patches"] } sauron = { path = "../../../sauron", features = ["with-debug", "with-measure", "use-template", "use-skipdiff"] } -#sauron = { path = "../../../sauron", features = ["with-debug", "with-measure", "use-skipdiff"] } -#sauron = { path = "../../../sauron"} log = "0.4" console_log = "0.2" console_error_panic_hook = "0.1" diff --git a/examples/js-performance-benchmark-sauron/src/lib.rs b/examples/js-performance-benchmark-sauron/src/lib.rs index 65ecdb5b..a586fc61 100644 --- a/examples/js-performance-benchmark-sauron/src/lib.rs +++ b/examples/js-performance-benchmark-sauron/src/lib.rs @@ -1,8 +1,8 @@ #![deny(warnings)] use rand::prelude::*; -use sauron::dom::component; use sauron::*; use std::cmp::min; +use sauron::dom::component; static ADJECTIVES: &[&str] = &[ "pretty", @@ -174,8 +174,25 @@ impl Application for App { Cmd::none() } - view! { + view!{
+ {self.view_jumbotron()} + + + {for row in self.rows.iter() { + component(row) + }} + +
+ +
+ } +} + + +impl App{ + fn view_jumbotron(&self) -> Node{ + node!{
@@ -242,15 +259,7 @@ impl Application for App {
- - - {for row in self.rows.iter() { - component(row) - }} - -
- - + } } }