diff --git a/examples/animation/Cargo.toml b/examples/animation/Cargo.toml
index 08b0bb4..6519f7d 100644
--- a/examples/animation/Cargo.toml
+++ b/examples/animation/Cargo.toml
@@ -10,6 +10,11 @@ edition = "2018"
[profile.release]
lto = true
+codegen-units = 1
+opt-level = 3 # 3 => fast, s/z => small
+
+[package.metadata.wasm-pack.profile.release]
+wasm-opt = ["-O4"] # O4 => fast, Oz/Os => small
[lib]
crate-type = ["cdylib"]
diff --git a/examples/async/Cargo.toml b/examples/async/Cargo.toml
index f5db0e5..eeaf50e 100644
--- a/examples/async/Cargo.toml
+++ b/examples/async/Cargo.toml
@@ -10,6 +10,11 @@ edition = "2018"
[profile.release]
lto = true
+codegen-units = 1
+opt-level = 3 # 3 => fast, s/z => small
+
+[package.metadata.wasm-pack.profile.release]
+wasm-opt = ["-O4"] # O4 => fast, Oz/Os => small
[lib]
crate-type = ["cdylib"]
diff --git a/examples/counter/Cargo.toml b/examples/counter/Cargo.toml
index 22006e7..4e4d20b 100644
--- a/examples/counter/Cargo.toml
+++ b/examples/counter/Cargo.toml
@@ -10,6 +10,11 @@ edition = "2018"
[profile.release]
lto = true
+codegen-units = 1
+opt-level = 3 # 3 => fast, s/z => small
+
+[package.metadata.wasm-pack.profile.release]
+wasm-opt = ["-O4"] # O4 => fast, Oz/Os => small
[lib]
crate-type = ["cdylib"]
diff --git a/examples/todomvc/Cargo.toml b/examples/todomvc/Cargo.toml
index 95c3ce9..bd1d57c 100644
--- a/examples/todomvc/Cargo.toml
+++ b/examples/todomvc/Cargo.toml
@@ -10,6 +10,11 @@ edition = "2018"
[profile.release]
lto = true
+codegen-units = 1
+opt-level = 3 # 3 => fast, s/z => small
+
+[package.metadata.wasm-pack.profile.release]
+wasm-opt = ["-O4"] # O4 => fast, Oz/Os => small
[lib]
crate-type = ["cdylib"]
diff --git a/src/dom.rs b/src/dom.rs
index 24eabee..edd43a5 100644
--- a/src/dom.rs
+++ b/src/dom.rs
@@ -457,7 +457,7 @@ impl DomBuilder {
#[inline]
pub fn apply(self, f: F) -> Self where F: FnOnce(Self) -> Self {
- self.apply_if(true, f)
+ f(self)
}
#[inline]
@@ -485,6 +485,7 @@ impl DomBuilder where A: Clone {
f(self, element)
}
+ #[deprecated(since = "0.5.20", note = "Use the with_node macro instead")]
#[inline]
pub fn before_inserted(self, f: F) -> Self where F: FnOnce(A) {
let element = self.element.clone();