@siteimprove/alfa-dom 0.93.2 → 0.93.7
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/CHANGELOG.md +16 -0
- package/dist/node.js +8 -1
- package/package.json +25 -25
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @siteimprove/alfa-dom
|
|
2
2
|
|
|
3
|
+
## 0.93.7
|
|
4
|
+
|
|
5
|
+
## 0.93.6
|
|
6
|
+
|
|
7
|
+
## 0.93.5
|
|
8
|
+
|
|
9
|
+
## 0.93.4
|
|
10
|
+
|
|
11
|
+
## 0.93.3
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- **Changed:** `Node.from` and `Page.from` are now cached. ([#1703](https://github.com/Siteimprove/alfa/pull/1703))
|
|
16
|
+
|
|
17
|
+
This makes multiple de-serialisation inexpensive as long as the JSON object is not discarded, thus simplifying logic for callers.
|
|
18
|
+
|
|
3
19
|
## 0.93.2
|
|
4
20
|
|
|
5
21
|
## 0.93.1
|
package/dist/node.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Cache } from "@siteimprove/alfa-cache";
|
|
1
2
|
import { Comparable, Comparison, } from "@siteimprove/alfa-comparable";
|
|
2
3
|
import { Flags } from "@siteimprove/alfa-flags";
|
|
3
4
|
import { Lazy } from "@siteimprove/alfa-lazy";
|
|
@@ -265,8 +266,14 @@ export class Node extends tree.Node {
|
|
|
265
266
|
* nested browsing context container, a common use case.
|
|
266
267
|
*/
|
|
267
268
|
Node.composedNested = Traversal.of(Traversal.composed, Traversal.nested);
|
|
269
|
+
const cacheWithDevice = Cache.empty();
|
|
270
|
+
const cacheWithoutDevice = Cache.empty();
|
|
268
271
|
function from(json, device) {
|
|
269
|
-
return
|
|
272
|
+
return device === undefined
|
|
273
|
+
? cacheWithoutDevice.get(json, () => fromNode(json, device).run())
|
|
274
|
+
: cacheWithDevice
|
|
275
|
+
.get(json, Cache.empty)
|
|
276
|
+
.get(device, () => fromNode(json, device).run());
|
|
270
277
|
}
|
|
271
278
|
Node.from = from;
|
|
272
279
|
/**
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "http://json.schemastore.org/package",
|
|
3
3
|
"name": "@siteimprove/alfa-dom",
|
|
4
4
|
"homepage": "https://alfa.siteimprove.com",
|
|
5
|
-
"version": "0.93.
|
|
5
|
+
"version": "0.93.7",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"description": "Implementations of the core DOM and CSSOM node types",
|
|
8
8
|
"repository": {
|
|
@@ -33,32 +33,32 @@
|
|
|
33
33
|
"dist/**/*.d.ts"
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@siteimprove/alfa-array": "^0.93.
|
|
37
|
-
"@siteimprove/alfa-cache": "^0.93.
|
|
38
|
-
"@siteimprove/alfa-comparable": "^0.93.
|
|
39
|
-
"@siteimprove/alfa-css": "^0.93.
|
|
40
|
-
"@siteimprove/alfa-css-feature": "^0.93.
|
|
41
|
-
"@siteimprove/alfa-device": "^0.93.
|
|
42
|
-
"@siteimprove/alfa-earl": "^0.93.
|
|
43
|
-
"@siteimprove/alfa-equatable": "^0.93.
|
|
44
|
-
"@siteimprove/alfa-flags": "^0.93.
|
|
45
|
-
"@siteimprove/alfa-iterable": "^0.93.
|
|
46
|
-
"@siteimprove/alfa-json": "^0.93.
|
|
47
|
-
"@siteimprove/alfa-lazy": "^0.93.
|
|
48
|
-
"@siteimprove/alfa-map": "^0.93.
|
|
49
|
-
"@siteimprove/alfa-option": "^0.93.
|
|
50
|
-
"@siteimprove/alfa-predicate": "^0.93.
|
|
51
|
-
"@siteimprove/alfa-rectangle": "^0.93.
|
|
52
|
-
"@siteimprove/alfa-refinement": "^0.93.
|
|
53
|
-
"@siteimprove/alfa-sarif": "^0.93.
|
|
54
|
-
"@siteimprove/alfa-selective": "^0.93.
|
|
55
|
-
"@siteimprove/alfa-sequence": "^0.93.
|
|
56
|
-
"@siteimprove/alfa-string": "^0.93.
|
|
57
|
-
"@siteimprove/alfa-trampoline": "^0.93.
|
|
58
|
-
"@siteimprove/alfa-tree": "^0.93.
|
|
36
|
+
"@siteimprove/alfa-array": "^0.93.7",
|
|
37
|
+
"@siteimprove/alfa-cache": "^0.93.7",
|
|
38
|
+
"@siteimprove/alfa-comparable": "^0.93.7",
|
|
39
|
+
"@siteimprove/alfa-css": "^0.93.7",
|
|
40
|
+
"@siteimprove/alfa-css-feature": "^0.93.7",
|
|
41
|
+
"@siteimprove/alfa-device": "^0.93.7",
|
|
42
|
+
"@siteimprove/alfa-earl": "^0.93.7",
|
|
43
|
+
"@siteimprove/alfa-equatable": "^0.93.7",
|
|
44
|
+
"@siteimprove/alfa-flags": "^0.93.7",
|
|
45
|
+
"@siteimprove/alfa-iterable": "^0.93.7",
|
|
46
|
+
"@siteimprove/alfa-json": "^0.93.7",
|
|
47
|
+
"@siteimprove/alfa-lazy": "^0.93.7",
|
|
48
|
+
"@siteimprove/alfa-map": "^0.93.7",
|
|
49
|
+
"@siteimprove/alfa-option": "^0.93.7",
|
|
50
|
+
"@siteimprove/alfa-predicate": "^0.93.7",
|
|
51
|
+
"@siteimprove/alfa-rectangle": "^0.93.7",
|
|
52
|
+
"@siteimprove/alfa-refinement": "^0.93.7",
|
|
53
|
+
"@siteimprove/alfa-sarif": "^0.93.7",
|
|
54
|
+
"@siteimprove/alfa-selective": "^0.93.7",
|
|
55
|
+
"@siteimprove/alfa-sequence": "^0.93.7",
|
|
56
|
+
"@siteimprove/alfa-string": "^0.93.7",
|
|
57
|
+
"@siteimprove/alfa-trampoline": "^0.93.7",
|
|
58
|
+
"@siteimprove/alfa-tree": "^0.93.7"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@siteimprove/alfa-test": "^0.93.
|
|
61
|
+
"@siteimprove/alfa-test": "^0.93.7",
|
|
62
62
|
"@types/jsdom": "^21.1.6",
|
|
63
63
|
"jsdom": "^25.0.0"
|
|
64
64
|
},
|