This commit is contained in:
Adrian Woźniak 2022-08-01 16:00:29 +02:00
parent a9d223d976
commit ac49905e0b
No known key found for this signature in database
GPG Key ID: 0012845A89C7352B
3 changed files with 0 additions and 109 deletions

View File

@ -1,43 +0,0 @@
[package]
name = "web"
version = "0.1.0"
edition = "2021"
[lib]
crate-type = ["cdylib", "rlib"]
name = "web"
path = "src/lib.rs"
[dependencies]
[dependencies.serde]
version = "1.0.140"
features = ['derive']
[dependencies.stdweb]
version = "0.4.20"
features = []
[dependencies.stdweb-derive]
version = "0.5.3"
features = []
[dependencies.stdweb-logger]
version = "0.1.1"
features = []
#[dependencies.wasm-bindgen]
#version = "0.2.81"
#features = []
#
#[dependencies.web-sys]
#version = "0.3.58"
#features = ['HtmlElement']
#
#[dependencies.js-sys]
#version = "0.3.58"
#features = []
[dependencies.wee_alloc]
version = "*"
features = ["static_array_backend"]

View File

@ -1,65 +0,0 @@
use wasm_bindgen::prelude::*;
use web_sys::HtmlElement;
#[global_allocator]
static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;
pub trait Component {
fn tag_name() -> String;
fn created(&mut self) {}
fn connected_callback(&self) {}
fn disconnected_callback(&mut self) {}
fn attribute_changed(
&mut self,
_name: String,
_old_value: Option<String>,
_new_value: Option<String>,
) {
}
}
#[wasm_bindgen(extends = web_sys::HtmlElement, extends = web_sys::Object)]
pub struct FooElement {
el: HtmlElement,
}
#[wasm_bindgen]
impl FooElement {
#[wasm_bindgen]
pub fn tag_name() -> String {
"foo-element".into()
}
#[wasm_bindgen(constructor)]
pub fn new(el: HtmlElement) -> Self {
Self { el }
}
#[wasm_bindgen(js_name = connectedCallback)]
pub fn connected_callback(&self) {}
}
#[wasm_bindgen(extends = web_sys::HtmlElement, extends = web_sys::Object)]
pub struct BarElement {
el: HtmlElement,
}
#[wasm_bindgen]
impl BarElement {
#[wasm_bindgen]
pub fn tag_name() -> String {
"bar-element".into()
}
#[wasm_bindgen(constructor)]
pub fn new(el: HtmlElement) -> Self {
Self { el }
}
#[wasm_bindgen(js_name = connectedCallback)]
pub fn connected_callback(&self) {}
}

View File

@ -1 +0,0 @@