@miaskiewicz/turbo-dom 0.1.53 → 0.1.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Cargo.lock +7 -0
- package/Cargo.toml +1 -0
- package/package.json +1 -1
- package/src/core.rs +8 -8
- package/turbo-dom-parser.darwin-arm64.node +0 -0
- package/turbo-dom-parser.linux-arm64-gnu.node +0 -0
- package/turbo-dom-parser.linux-x64-gnu.node +0 -0
- package/turbo-dom-parser.linux-x64-musl.node +0 -0
- package/turbo-dom-parser.win32-x64-msvc.node +0 -0
package/Cargo.lock
CHANGED
|
@@ -359,6 +359,12 @@ version = "0.8.10"
|
|
|
359
359
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
360
360
|
checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a"
|
|
361
361
|
|
|
362
|
+
[[package]]
|
|
363
|
+
name = "rustc-hash"
|
|
364
|
+
version = "2.1.2"
|
|
365
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
366
|
+
checksum = "94300abf3f1ae2e2b8ffb7b58043de3d399c73fa6f4b73826402a5c457614dbe"
|
|
367
|
+
|
|
362
368
|
[[package]]
|
|
363
369
|
name = "rustversion"
|
|
364
370
|
version = "1.0.22"
|
|
@@ -491,6 +497,7 @@ dependencies = [
|
|
|
491
497
|
"napi",
|
|
492
498
|
"napi-build",
|
|
493
499
|
"napi-derive",
|
|
500
|
+
"rustc-hash",
|
|
494
501
|
"serde",
|
|
495
502
|
"serde-wasm-bindgen",
|
|
496
503
|
"wasm-bindgen",
|
package/Cargo.toml
CHANGED
|
@@ -11,6 +11,7 @@ crate-type = ["cdylib", "rlib"]
|
|
|
11
11
|
# Shared parser core
|
|
12
12
|
html5ever = "0.39"
|
|
13
13
|
markup5ever_rcdom = "0.39"
|
|
14
|
+
rustc-hash = "2" # fast non-crypto FxHashMap for string interning (parse hot path)
|
|
14
15
|
|
|
15
16
|
# napi-rs front-end (native addon). Gated so the wasm build doesn't pull it.
|
|
16
17
|
napi = { version = "2", default-features = false, features = ["napi6"], optional = true }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@miaskiewicz/turbo-dom",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.54",
|
|
4
4
|
"description": "Faster, more spec-correct DOM for test runners — native html5ever (Rust/WASM) parser + lazy copy-on-write DOM. A drop-in-style alternative to jsdom/happy-dom for vitest & jest.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "index.js",
|
package/src/core.rs
CHANGED
|
@@ -101,10 +101,10 @@ pub struct Soa {
|
|
|
101
101
|
|
|
102
102
|
struct SoaBuilder {
|
|
103
103
|
soa: Soa,
|
|
104
|
-
tag_map:
|
|
105
|
-
attr_name_map:
|
|
106
|
-
attr_prefix_map:
|
|
107
|
-
attr_value_map:
|
|
104
|
+
tag_map: rustc_hash::FxHashMap<String, u32>,
|
|
105
|
+
attr_name_map: rustc_hash::FxHashMap<String, u32>,
|
|
106
|
+
attr_prefix_map: rustc_hash::FxHashMap<String, u32>,
|
|
107
|
+
attr_value_map: rustc_hash::FxHashMap<String, u32>,
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
impl SoaBuilder {
|
|
@@ -261,10 +261,10 @@ pub fn parse_html_soa(html: &str) -> Soa {
|
|
|
261
261
|
.expect("RcDom read_from is infallible over a byte slice");
|
|
262
262
|
let mut b = SoaBuilder {
|
|
263
263
|
soa: Soa::default(),
|
|
264
|
-
tag_map:
|
|
265
|
-
attr_name_map:
|
|
266
|
-
attr_prefix_map:
|
|
267
|
-
attr_value_map:
|
|
264
|
+
tag_map: rustc_hash::FxHashMap::default(),
|
|
265
|
+
attr_name_map: rustc_hash::FxHashMap::default(),
|
|
266
|
+
attr_prefix_map: rustc_hash::FxHashMap::default(),
|
|
267
|
+
attr_value_map: rustc_hash::FxHashMap::default(),
|
|
268
268
|
};
|
|
269
269
|
b.alloc(&dom.document, -1);
|
|
270
270
|
b.soa
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|