Skip to content

Commit

Permalink
Try out new slotmap approach
Browse files Browse the repository at this point in the history
  • Loading branch information
matthunz committed Jan 20, 2024
1 parent c1c963b commit 0007edd
Show file tree
Hide file tree
Showing 18 changed files with 64 additions and 1,226 deletions.
252 changes: 8 additions & 244 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 2 additions & 22 deletions Cargo.toml
Expand Up @@ -6,31 +6,11 @@ license = "MIT OR Apache-2.0"
description = "Cross-platform UI framework"
repository = "https://github.com/matthunz/viewbuilder"

[workspace]
members = [
".",
"web_examples/counter",
"web_examples/todomvc"
]

[features]
web = ["web-sys"]
full = ["web", "tracing"]
full = []

[dependencies]
rustc-hash = "1.1.0"
tracing = { version = "0.1.40", optional = true }

[dependencies.web-sys]
version = "0.3.66"
optional = true
features = [
"Document",
"Event",
"HtmlElement",
"Window",
"Text"
]
slotmap = "1.0.7"

[package.metadata.docs.rs]
features = ["full"]
Expand Down
12 changes: 12 additions & 0 deletions examples/app.rs
@@ -0,0 +1,12 @@
use viewbuilder::{Element, Tree};

struct Text;

impl Element for Text {}

fn main() {
let mut tree = Tree::default();
let root = tree.insert(Text);

dbg!(tree.slice(root));
}

0 comments on commit 0007edd

Please sign in to comment.