From 8a6242ef180590b69e433722576fe26c2692cf0a Mon Sep 17 00:00:00 2001 From: Locria Cyber <74560659+locriacyber@users.noreply.github.com> Date: Fri, 13 Jan 2023 03:55:47 +0000 Subject: [PATCH] Port todomvc project to use Trunk. --- .gitignore | 3 ++- dom/examples/todo/README.md | 7 ++----- dom/examples/todo/index.html | 10 +--------- dom/examples/todo/src/lib.rs | 2 ++ 4 files changed, 7 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index 6a829dbe4..b86807d77 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ target/ node_modules/ .idea/ pkg/ +dist/ cargo-timing*.html **/cypress/screenshots -**/cypress/videos \ No newline at end of file +**/cypress/videos diff --git a/dom/examples/todo/README.md b/dom/examples/todo/README.md index b229ea685..6179bd90c 100644 --- a/dom/examples/todo/README.md +++ b/dom/examples/todo/README.md @@ -4,15 +4,12 @@ Commands all assume the working directory is the repository root. ## Serving -Build the example and start the project's local HTTP server: +First install [Trunk](https://trunkrs.dev/). ``` -$ cargo build-dom-todo # for live-watching rebuilds use `cargo dom-flow` -$ cargo ofl serve +$ trunk serve ``` -In VSCode the same can be accomplished by running the `dom crates` and `project server` tasks. - ## Using To use the example locally, follow the directions for [serving](#serving) the project and diff --git a/dom/examples/todo/index.html b/dom/examples/todo/index.html index 9889fcdae..6184815ac 100644 --- a/dom/examples/todo/index.html +++ b/dom/examples/todo/index.html @@ -20,14 +20,6 @@

Created by anp

Part of moxie-dom

- - - \ No newline at end of file + diff --git a/dom/examples/todo/src/lib.rs b/dom/examples/todo/src/lib.rs index ee8dfef0f..f556c2fe6 100644 --- a/dom/examples/todo/src/lib.rs +++ b/dom/examples/todo/src/lib.rs @@ -96,6 +96,8 @@ pub fn setup_tracing() { info!("tracing initialized"); }); console_error_panic_hook::set_once(); + use moxie_dom::raw::sys::window; + boot(window().unwrap().document().unwrap().get_element_by_id("content").unwrap().into()); } #[wasm_bindgen]