diff --git a/packages/web/Cargo.toml b/packages/web/Cargo.toml index 14ece61d0..6792d5464 100644 --- a/packages/web/Cargo.toml +++ b/packages/web/Cargo.toml @@ -18,7 +18,7 @@ dioxus-interpreter-js = { workspace = true, features = [ ] } js-sys = "0.3.56" -wasm-bindgen = { workspace = true, features = ["enable-interning"] } +wasm-bindgen = { workspace = true } wasm-bindgen-futures = "0.4.29" tracing = { workspace = true } rustc-hash = { workspace = true } diff --git a/packages/web/src/cache.rs b/packages/web/src/cache.rs deleted file mode 100644 index bfd0fd197..000000000 --- a/packages/web/src/cache.rs +++ /dev/null @@ -1,300 +0,0 @@ -pub static BUILTIN_INTERNED_STRINGS: &[&str] = &[ - // Important tags to dioxus - "dioxus-id", - "dioxus", - "dioxus-event-click", // todo: more events - "click", - // All the HTML Tags - "a", - "abbr", - "address", - "area", - "article", - "aside", - "audio", - "b", - "base", - "bdi", - "bdo", - "big", - "blockquote", - "body", - "br", - "button", - "canvas", - "caption", - "cite", - "code", - "col", - "colgroup", - "command", - "data", - "datalist", - "dd", - "del", - "details", - "dfn", - "dialog", - "div", - "dl", - "dt", - "em", - "embed", - "fieldset", - "figcaption", - "figure", - "footer", - "form", - "h1", - "h2", - "h3", - "h4", - "h5", - "h6", - "head", - "header", - "hr", - "html", - "i", - "iframe", - "img", - "input", - "ins", - "kbd", - "keygen", - "label", - "legend", - "li", - "link", - "main", - "map", - "mark", - "menu", - "menuitem", - "meta", - "meter", - "nav", - "noscript", - "object", - "ol", - "optgroup", - "option", - "output", - "p", - "param", - "picture", - "pre", - "progress", - "q", - "rp", - "rt", - "ruby", - "s", - "samp", - "script", - "section", - "select", - "small", - "source", - "span", - "strong", - "style", - "sub", - "summary", - "sup", - "table", - "tbody", - "td", - "textarea", - "tfoot", - "th", - "thead", - "time", - "title", - "tr", - "track", - "u", - "ul", - "var", - "video", - "wbr", - // All the event handlers - "Attribute", - "accept", - "accept-charset", - "accesskey", - "action", - "alt", - "async", - "autocomplete", - "autofocus", - "autoplay", - "charset", - "checked", - "cite", - "class", - "cols", - "colspan", - "content", - "contenteditable", - "controls", - "coords", - "data", - "data-*", - "datetime", - "default", - "defer", - "dir", - "dirname", - "disabled", - "download", - "draggable", - "enctype", - "for", - "form", - "formaction", - "headers", - "height", - "hidden", - "high", - "href", - "hreflang", - "http-equiv", - "id", - "ismap", - "kind", - "label", - "lang", - "list", - "loop", - "low", - "max", - "maxlength", - "media", - "method", - "min", - "multiple", - "muted", - "name", - "novalidate", - "onabort", - "onafterprint", - "onbeforeprint", - "onbeforeunload", - "onblur", - "oncanplay", - "oncanplaythrough", - "onchange", - "onclick", - "oncontextmenu", - "oncopy", - "oncuechange", - "oncut", - "ondoubleclick", - "ondrag", - "ondragend", - "ondragenter", - "ondragleave", - "ondragover", - "ondragstart", - "ondrop", - "ondurationchange", - "onemptied", - "onended", - "onerror", - "onfocus", - "onfocusout", - "onfocusin", - "onhashchange", - "oninput", - "oninvalid", - "onkeydown", - "onkeypress", - "onkeyup", - "onload", - "onloadeddata", - "onloadedmetadata", - "onloadstart", - "onmousedown", - "onmousemove", - "onmouseout", - "onmouseover", - "onmouseup", - "onmousewheel", - "onoffline", - "ononline", - "onpageshow", - "onpaste", - "onpause", - "onplay", - "onplaying", - "onprogress", - "onratechange", - "onreset", - "onresize", - "onscroll", - "onsearch", - "onseeked", - "onseeking", - "onselect", - "onstalled", - "onsubmit", - "onsuspend", - "ontimeupdate", - "ontoggle", - "onunload", - "onvolumechange", - "onwaiting", - "onwheel", - "open", - "optimum", - "pattern", - "placeholder", - "poster", - "preload", - "readonly", - "rel", - "required", - "reversed", - "rows", - "rowspan", - "sandbox", - "scope", - "selected", - "shape", - "size", - "sizes", - "span", - "spellcheck", - "src", - "srcdoc", - "srclang", - "srcset", - "start", - "step", - "style", - "tabindex", - "target", - "title", - "translate", - "type", - "usemap", - "value", - "width", - "wrap", - "0", - "1", - "2", - "3", - "4", - "5", - "6", - "7", - "8", - "9", - "10", - "11", - "12", - "13", - "14", -]; diff --git a/packages/web/src/cfg.rs b/packages/web/src/cfg.rs index 7483a7a8b..afdf7e2e2 100644 --- a/packages/web/src/cfg.rs +++ b/packages/web/src/cfg.rs @@ -11,7 +11,6 @@ pub struct Config { #[cfg(feature = "hydrate")] pub(crate) hydrate: bool, pub(crate) rootname: String, - pub(crate) cached_strings: Vec, pub(crate) default_panic_hook: bool, } @@ -21,7 +20,6 @@ impl Default for Config { #[cfg(feature = "hydrate")] hydrate: false, rootname: "main".to_string(), - cached_strings: Vec::new(), default_panic_hook: true, } } @@ -55,15 +53,6 @@ impl Config { self } - /// Sets a string cache for wasm bindgen to [intern](https://docs.rs/wasm-bindgen/0.2.84/wasm_bindgen/fn.intern.html). This can help reduce the time it takes for wasm bindgen to pass - /// strings from rust to javascript. This can significantly improve pefromance when passing strings to javascript, but can have a negative impact on startup time. - /// - /// > Currently this cache is only used when creating static elements and attributes. - pub fn with_string_cache(mut self, cache: Vec) -> Self { - self.cached_strings = cache; - self - } - /// Set whether or not Dioxus should use the built-in panic hook or defer to your own. /// /// The panic hook is set to true normally so even the simplest apps have helpful error messages. diff --git a/packages/web/src/lib.rs b/packages/web/src/lib.rs index 8f7faf93f..29edcc5b6 100644 --- a/packages/web/src/lib.rs +++ b/packages/web/src/lib.rs @@ -66,7 +66,6 @@ use futures_util::{ pin_mut, FutureExt, StreamExt, }; -mod cache; mod cfg; mod dom; #[cfg(feature = "eval")] @@ -107,7 +106,7 @@ mod rehydrate; /// } /// ``` pub fn launch(root_component: fn(()) -> Element) { - launch_with_props( root_component, (), Config::default()); + launch_with_props(root_component, (), Config::default()); } /// Launch your app and run the event loop, with configuration. @@ -202,13 +201,6 @@ pub async fn run_with_props( #[cfg(all(feature = "hot_reload", debug_assertions))] let mut hotreload_rx = hot_reload::init(); - for s in crate::cache::BUILTIN_INTERNED_STRINGS { - wasm_bindgen::intern(s); - } - for s in &cfg.cached_strings { - wasm_bindgen::intern(s); - } - let (tx, mut rx) = futures_channel::mpsc::unbounded(); #[cfg(feature = "hydrate")]