Frontend:

- Remove we_alloce
- Replace webpack by rspack
This commit is contained in:
Greg Burri 2024-11-06 17:48:51 +01:00
parent 1f03c01d1d
commit ebdcb6a90a
10 changed files with 60 additions and 100 deletions

View file

@ -1,4 +1,6 @@
use wasm_bindgen::prelude::*;
use web_sys::Document;
pub fn edit_recipe(doc: &Document) {}
pub fn edit_recipe(doc: &Document) {
let title_input = doc.get_element_by_id("title_field").unwrap();
}

View file

@ -4,12 +4,6 @@ mod utils;
use wasm_bindgen::prelude::*;
use web_sys::console;
// When the `wee_alloc` feature is enabled, use `wee_alloc` as the global
// allocator.
#[cfg(feature = "wee_alloc")]
#[global_allocator]
static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;
#[wasm_bindgen]
extern "C" {
fn alert(s: &str);
@ -27,7 +21,7 @@ pub fn main() -> Result<(), JsValue> {
let window = web_sys::window().expect("no global `window` exists");
let document = window.document().expect("should have a document on window");
//let body = document.body().expect("document should have a body");
// let body = document.body().expect("document should have a body");
let location = window.location().pathname()?;
let path: Vec<&str> = location.split('/').skip(1).collect();
@ -46,14 +40,10 @@ pub fn main() -> Result<(), JsValue> {
console_log!("recipe edit ID: {}", id);
handles::edit_recipe(&document);
let title_input = document.get_element_by_id("title_field").unwrap();
}
_ => (),
}
//alert(&path);
// TEST
// let val = document.create_element("p")?;
// val.set_inner_html("Hello from Rust!");