diff --git a/Cargo.toml b/Cargo.toml index 176be176f..d3a65359a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dioxus" -version = "0.1.4" +version = "0.1.5" authors = ["Jonathan Kelley"] edition = "2018" description = "Core functionality for Dioxus - a concurrent renderer-agnostic Virtual DOM for interactive user experiences" @@ -11,7 +11,7 @@ documentation = "https://dioxuslabs.com" keywords = ["dom", "ui", "gui", "react", "wasm"] [dependencies] -dioxus-core = { path = "./packages/core", version = "^0.1.4" } +dioxus-core = { path = "./packages/core", version = "^0.1.6" } dioxus-html = { path = "./packages/html", version = "^0.1.1", optional = true } dioxus-core-macro = { path = "./packages/core-macro", version = "^0.1.3", optional = true } dioxus-hooks = { path = "./packages/hooks", version = "^0.1.4", optional = true } diff --git a/packages/core/Cargo.toml b/packages/core/Cargo.toml index 725f111a8..1c37020f7 100644 --- a/packages/core/Cargo.toml +++ b/packages/core/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dioxus-core" -version = "0.1.5" +version = "0.1.6" authors = ["Jonathan Kelley"] edition = "2018" description = "Core functionality for Dioxus - a concurrent renderer-agnostic Virtual DOM for interactive user experiences" diff --git a/packages/core/src/nodes.rs b/packages/core/src/nodes.rs index 9f296d7b4..0acb08829 100644 --- a/packages/core/src/nodes.rs +++ b/packages/core/src/nodes.rs @@ -75,7 +75,7 @@ pub enum VNode<'src> { /// Example {} /// } /// ``` - Fragment(VFragment<'src>), + Fragment(&'src VFragment<'src>), /// Component nodes represent a mounted component with props, children, and a key. /// @@ -156,15 +156,12 @@ impl<'src> VNode<'src> { // Create an "owned" version of the vnode. pub fn decouple(&self) -> VNode<'src> { - match self { - VNode::Text(t) => VNode::Text(*t), - VNode::Element(e) => VNode::Element(*e), - VNode::Component(c) => VNode::Component(*c), - VNode::Placeholder(a) => VNode::Placeholder(*a), - VNode::Fragment(f) => VNode::Fragment(VFragment { - children: f.children, - key: f.key, - }), + match *self { + VNode::Text(t) => VNode::Text(t), + VNode::Element(e) => VNode::Element(e), + VNode::Component(c) => VNode::Component(c), + VNode::Placeholder(a) => VNode::Placeholder(a), + VNode::Fragment(f) => VNode::Fragment(f), } } } @@ -555,10 +552,10 @@ impl<'a> NodeFactory<'a> { if nodes.is_empty() { VNode::Placeholder(self.bump.alloc(VPlaceholder { id: empty_cell() })) } else { - VNode::Fragment(VFragment { + VNode::Fragment(self.bump.alloc(VFragment { children: nodes.into_bump_slice(), key: None, - }) + })) } } @@ -594,10 +591,10 @@ impl<'a> NodeFactory<'a> { ); } - VNode::Fragment(VFragment { + VNode::Fragment(self.bump.alloc(VFragment { children, key: None, - }) + })) } } @@ -620,10 +617,10 @@ impl<'a> NodeFactory<'a> { } else { let children = nodes.into_bump_slice(); - Some(VNode::Fragment(VFragment { + Some(VNode::Fragment(self.bump.alloc(VFragment { children, key: None, - })) + }))) } } } diff --git a/packages/desktop/Cargo.toml b/packages/desktop/Cargo.toml index e533f3bf9..1b8ead959 100644 --- a/packages/desktop/Cargo.toml +++ b/packages/desktop/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dioxus-desktop" -version = "0.1.2" +version = "0.1.3" authors = ["Jonathan Kelley"] edition = "2018" description = "Dioxus VirtualDOM renderer for a remote webview instance" @@ -12,7 +12,7 @@ keywords = ["dom", "ui", "gui", "react", "wasm"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dioxus-core = { path = "../core", version = "^0.1.3", features = ["serialize"] } +dioxus-core = { path = "../core", version = "^0.1.6", features = ["serialize"] } argh = "0.1.4" serde = "1.0.120" serde_json = "1.0.61" diff --git a/packages/hooks/Cargo.toml b/packages/hooks/Cargo.toml index e1994bfb2..d85424f04 100644 --- a/packages/hooks/Cargo.toml +++ b/packages/hooks/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dioxus-hooks" -version = "0.1.4" +version = "0.1.5" authors = ["Jonathan Kelley"] edition = "2018" description = "Dioxus VirtualDOM renderer for a remote webview instance" @@ -12,4 +12,4 @@ keywords = ["dom", "ui", "gui", "react", "wasm"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dioxus-core = { path = "../../packages/core", version = "0.1.5" } +dioxus-core = { path = "../../packages/core", version = "^0.1.6" } diff --git a/packages/html/Cargo.toml b/packages/html/Cargo.toml index 93e62ba70..55cd9b28a 100644 --- a/packages/html/Cargo.toml +++ b/packages/html/Cargo.toml @@ -11,7 +11,7 @@ documentation = "https://docs.rs/dioxus" keywords = ["dom", "ui", "gui", "react", "wasm"] [dependencies] -dioxus-core = { path = "../core", version = "^0.1.4" } +dioxus-core = { path = "../core", version = "^0.1.6" } serde = { version = "1", features = ["derive"], optional = true } serde_repr = { version = "0.1", optional = true } diff --git a/packages/router/Cargo.toml b/packages/router/Cargo.toml index 0588a2038..158a233fa 100644 --- a/packages/router/Cargo.toml +++ b/packages/router/Cargo.toml @@ -11,7 +11,7 @@ keywords = ["dom", "ui", "gui", "react", "wasm"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dioxus-core = { path = "../core", version = "^0.1.3", default-features = false } +dioxus-core = { path = "../core", version = "^0.1.6", default-features = false } dioxus-html = { path = "../html", version = "^0.1.0", default-features = false } dioxus-core-macro = { path = "../core-macro", version = "^0.1.2" } diff --git a/packages/ssr/Cargo.toml b/packages/ssr/Cargo.toml index 0dda9d5e6..99f830a09 100644 --- a/packages/ssr/Cargo.toml +++ b/packages/ssr/Cargo.toml @@ -13,7 +13,7 @@ keywords = ["dom", "ui", "gui", "react", "wasm"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dioxus-core = { path = "../core", version = "^0.1.3", features = ["serialize"] } +dioxus-core = { path = "../core", version = "^0.1.6", features = ["serialize"] } [dev-dependencies] diff --git a/packages/web/Cargo.toml b/packages/web/Cargo.toml index 4da9ecc50..bb9eef1bc 100644 --- a/packages/web/Cargo.toml +++ b/packages/web/Cargo.toml @@ -11,7 +11,7 @@ documentation = "https://dioxuslabs.com" keywords = ["dom", "ui", "gui", "react", "wasm"] [dependencies] -dioxus-core = { path = "../core", version = "^0.1.4" } +dioxus-core = { path = "../core", version = "^0.1.6" } dioxus-html = { path = "../html", version = "^0.1.1" } js-sys = "0.3" wasm-bindgen = { version = "0.2.78", features = ["enable-interning"] }