mirror of
https://github.com/zaphar/wasm-web-components.git
synced 2025-07-21 19:40:30 -04:00
fix: usings and lint stuff found by using in app
This commit is contained in:
parent
cb071f4ffc
commit
55d743f01c
@ -65,7 +65,7 @@ fn get_class_and_element_names(
|
||||
let element_name = match element_name.map(|n| n.token()) {
|
||||
Some(n) => n,
|
||||
None => {
|
||||
let class_kebab = class_name.to_string().to_kebab_case();
|
||||
let class_kebab = class_name.to_string().to_kebab_case().to_lowercase();
|
||||
LitStr::new(&class_kebab, Span::call_site()).token()
|
||||
}
|
||||
};
|
||||
@ -117,7 +117,7 @@ fn expand_struct_trait_shim(struct_name: &Ident, once_name: &Ident, observed_att
|
||||
}
|
||||
|
||||
#[doc = "Defines this web component element if not defined already otherwise returns an error."]
|
||||
pub fn define() -> std::result::Result<#handle_path, JsValue> {
|
||||
pub fn define() -> std::result::Result<#handle_path, wasm_bindgen::JsValue> {
|
||||
use wasm_bindgen::JsCast;
|
||||
use web_sys::{window, Element, HtmlElement};
|
||||
let registry = web_sys::window().unwrap().custom_elements();
|
||||
@ -253,6 +253,8 @@ fn expand_struct(
|
||||
let binding_trait = expand_binding(&struct_name);
|
||||
let expanded = quote! {
|
||||
use std::sync::Once;
|
||||
use wasm_bindgen;
|
||||
#[allow(non_snake_case)]
|
||||
static #struct_once_name: Once = Once::new();
|
||||
#[wasm_bindgen::prelude::wasm_bindgen]
|
||||
#[derive(Default, Debug)]
|
||||
|
@ -16,7 +16,7 @@ wasm-web-component-macros = { path = "../macros" }
|
||||
version = "0.3"
|
||||
|
||||
[dependencies.wasm-bindgen]
|
||||
version = "= 0.2.81"
|
||||
version = "~0.2"
|
||||
|
||||
[dependencies.js-sys]
|
||||
version = "0.3"
|
||||
|
Loading…
x
Reference in New Issue
Block a user