@rasamjs/core 0.1.0 → 0.1.2
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 +21 -0
- package/README.md +2 -2
- package/RELEASING.md +18 -8
- package/dist/changes/restore.js +2 -0
- package/dist/changes/restore.js.map +1 -1
- package/dist/elements/text.js +4 -4
- package/dist/elements/text.js.map +1 -1
- package/dist/mixins/sizable.js +8 -6
- package/dist/mixins/sizable.js.map +1 -1
- package/dist/text/rich-textual.js +3 -3
- package/dist/text/rich-textual.js.map +1 -1
- package/package.json +1 -1
- package/reports/adoption.json +20 -20
- package/reports/animation-benchmark.json +616 -616
- package/reports/benchmark.json +53 -53
- package/reports/creation.json +26 -26
- package/reports/interchange-benchmark.json +85 -85
- package/reports/size-parity.json +7 -7
- package/reports/size.json +1 -1
- package/reports/svgjs-comparison.json +3450 -3450
- package/reports/svgjs-comparison.md +19 -19
- package/reports/svgjs-parity-current.json +26 -30
- package/src/changes/restore.ts +2 -0
- package/src/elements/text.ts +3 -3
- package/src/mixins/sizable.ts +6 -6
- package/src/text/rich-textual.ts +2 -2
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
# Rasam vs SVG.js
|
|
2
2
|
|
|
3
|
-
SVG.js 3.2.8; Rasam 0.1.
|
|
3
|
+
SVG.js 3.2.8; Rasam 0.1.2 workspace. CPU: Intel(R) Core(TM) i7-10610U CPU @ 1.80GHz.
|
|
4
4
|
|
|
5
5
|
All timings below are medians in milliseconds. Ratios above 1 mean Rasam took longer.
|
|
6
6
|
|
|
7
7
|
| Browser | Workload | Nodes | Samples | Rasam | SVG.js | Rasam / SVG.js |
|
|
8
8
|
| --- | --- | ---: | ---: | ---: | ---: | ---: |
|
|
9
|
-
| chromium 156.0.8078.4 | creation | 2000 | 15 | 9.
|
|
10
|
-
| chromium 156.0.8078.4 | creation | 8000 | 15 |
|
|
11
|
-
| chromium 156.0.8078.4 | fill | 1000 | 100 | 0.
|
|
12
|
-
| chromium 156.0.8078.4 | repeated-fill | 1000 | 100 | 0.
|
|
13
|
-
| chromium 156.0.8078.4 | pointer-one | 8000 | 40 |
|
|
14
|
-
| chromium 156.0.8078.4 | pointer-all | 8000 | 40 |
|
|
15
|
-
| firefox 157.0 | creation | 2000 | 15 |
|
|
16
|
-
| firefox 157.0 | creation | 8000 | 15 |
|
|
17
|
-
| firefox 157.0 | fill | 1000 | 100 | 1.20 | 1.
|
|
18
|
-
| firefox 157.0 | repeated-fill | 1000 | 100 | 1.
|
|
19
|
-
| firefox 157.0 | pointer-one | 8000 | 40 | 4.40 | 3.
|
|
20
|
-
| firefox 157.0 | pointer-all | 8000 | 40 | 4.
|
|
21
|
-
| webkit 27.2 | creation | 2000 | 15 |
|
|
22
|
-
| webkit 27.2 | creation | 8000 | 15 |
|
|
23
|
-
| webkit 27.2 | fill | 1000 | 100 | 0.70 | 1.
|
|
24
|
-
| webkit 27.2 | repeated-fill | 1000 | 100 |
|
|
25
|
-
| webkit 27.2 | pointer-one | 8000 | 40 | 4.40 | 3.
|
|
26
|
-
| webkit 27.2 | pointer-all | 8000 | 40 | 4.
|
|
9
|
+
| chromium 156.0.8078.4 | creation | 2000 | 15 | 9.70 | 12.20 | 0.80 |
|
|
10
|
+
| chromium 156.0.8078.4 | creation | 8000 | 15 | 36.50 | 45.10 | 0.81 |
|
|
11
|
+
| chromium 156.0.8078.4 | fill | 1000 | 100 | 0.50 | 1.39 | 0.36 |
|
|
12
|
+
| chromium 156.0.8078.4 | repeated-fill | 1000 | 100 | 0.71 | 4.23 | 0.17 |
|
|
13
|
+
| chromium 156.0.8078.4 | pointer-one | 8000 | 40 | 4.00 | 3.82 | 1.05 |
|
|
14
|
+
| chromium 156.0.8078.4 | pointer-all | 8000 | 40 | 4.02 | 3.80 | 1.06 |
|
|
15
|
+
| firefox 157.0 | creation | 2000 | 15 | 23.00 | 25.00 | 0.92 |
|
|
16
|
+
| firefox 157.0 | creation | 8000 | 15 | 93.00 | 85.00 | 1.09 |
|
|
17
|
+
| firefox 157.0 | fill | 1000 | 100 | 1.20 | 1.60 | 0.75 |
|
|
18
|
+
| firefox 157.0 | repeated-fill | 1000 | 100 | 1.70 | 5.00 | 0.34 |
|
|
19
|
+
| firefox 157.0 | pointer-one | 8000 | 40 | 4.40 | 3.80 | 1.16 |
|
|
20
|
+
| firefox 157.0 | pointer-all | 8000 | 40 | 4.60 | 3.80 | 1.21 |
|
|
21
|
+
| webkit 27.2 | creation | 2000 | 15 | 15.00 | 20.00 | 0.75 |
|
|
22
|
+
| webkit 27.2 | creation | 8000 | 15 | 56.00 | 73.00 | 0.77 |
|
|
23
|
+
| webkit 27.2 | fill | 1000 | 100 | 0.70 | 1.80 | 0.39 |
|
|
24
|
+
| webkit 27.2 | repeated-fill | 1000 | 100 | 1.35 | 6.85 | 0.20 |
|
|
25
|
+
| webkit 27.2 | pointer-one | 8000 | 40 | 4.40 | 3.60 | 1.22 |
|
|
26
|
+
| webkit 27.2 | pointer-all | 8000 | 40 | 4.20 | 3.60 | 1.17 |
|
|
27
27
|
|
|
28
28
|
## Methodology
|
|
29
29
|
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
"generatedAt": "2026-
|
|
3
|
-
"revision": "
|
|
2
|
+
"generatedAt": "2026-11-02T00:13:40.368Z",
|
|
3
|
+
"revision": "cf520e325957ab98952540b7234db122a672d9ed",
|
|
4
4
|
"dirtyTree": [
|
|
5
5
|
"M packages/rasam/reports/adoption.json",
|
|
6
6
|
" M packages/rasam/reports/creation.json",
|
|
7
|
-
" M packages/rasam/reports/interchange-benchmark.json"
|
|
8
|
-
" M packages/rasam/reports/size-parity.json",
|
|
9
|
-
" M packages/rasam/reports/size.json",
|
|
10
|
-
"?? SELECTION_PLAN.md"
|
|
7
|
+
" M packages/rasam/reports/interchange-benchmark.json"
|
|
11
8
|
],
|
|
12
9
|
"sourceFiles": [
|
|
13
10
|
{
|
|
@@ -88,7 +85,7 @@
|
|
|
88
85
|
},
|
|
89
86
|
{
|
|
90
87
|
"path": "src/changes/restore.ts",
|
|
91
|
-
"sha256": "
|
|
88
|
+
"sha256": "a8ab84b53c4b11771af26f64e17c341862c6582756a3158796137c9c3f4ce47f"
|
|
92
89
|
},
|
|
93
90
|
{
|
|
94
91
|
"path": "src/changes/service.ts",
|
|
@@ -292,7 +289,7 @@
|
|
|
292
289
|
},
|
|
293
290
|
{
|
|
294
291
|
"path": "src/elements/text.ts",
|
|
295
|
-
"sha256": "
|
|
292
|
+
"sha256": "0d42353408aed12961785ac6dfff511b62ec76df77d075768cfbd138abc6e820"
|
|
296
293
|
},
|
|
297
294
|
{
|
|
298
295
|
"path": "src/elements/tspan.ts",
|
|
@@ -468,7 +465,7 @@
|
|
|
468
465
|
},
|
|
469
466
|
{
|
|
470
467
|
"path": "src/mixins/sizable.ts",
|
|
471
|
-
"sha256": "
|
|
468
|
+
"sha256": "82c6a26c4a52bb5f225a38151e0ba3ab059b1dab58918d23fa63338aec2f1f1c"
|
|
472
469
|
},
|
|
473
470
|
{
|
|
474
471
|
"path": "src/mixins/sizing-internals.ts",
|
|
@@ -604,7 +601,7 @@
|
|
|
604
601
|
},
|
|
605
602
|
{
|
|
606
603
|
"path": "src/text/rich-textual.ts",
|
|
607
|
-
"sha256": "
|
|
604
|
+
"sha256": "52dce3a3bb91da57261dec67b8682c020bbe1ea0f22eea7aa1c02e386eb610d2"
|
|
608
605
|
},
|
|
609
606
|
{
|
|
610
607
|
"path": "src/text/types.ts",
|
|
@@ -656,7 +653,7 @@
|
|
|
656
653
|
},
|
|
657
654
|
{
|
|
658
655
|
"path": "../../package-lock.json",
|
|
659
|
-
"sha256": "
|
|
656
|
+
"sha256": "a9244a1f25a62dc4fd328605dbb09b0639edaaa42939757fdfbccc7cdea963f6"
|
|
660
657
|
}
|
|
661
658
|
],
|
|
662
659
|
"svgjs": "3.2.8",
|
|
@@ -9613,7 +9610,7 @@
|
|
|
9613
9610
|
"size": {
|
|
9614
9611
|
"fixture": "fixtures/size.ts",
|
|
9615
9612
|
"rawBytes": 65967,
|
|
9616
|
-
"gzipBytes":
|
|
9613
|
+
"gzipBytes": 19758,
|
|
9617
9614
|
"budgetBytes": 20480,
|
|
9618
9615
|
"included": [
|
|
9619
9616
|
"src/changes/mutation.ts",
|
|
@@ -9663,7 +9660,7 @@
|
|
|
9663
9660
|
},
|
|
9664
9661
|
"performance": {
|
|
9665
9662
|
"fixture": "scripts/benchmark.mjs",
|
|
9666
|
-
"date": "2026-
|
|
9663
|
+
"date": "2026-11-02T00:13:34.754Z",
|
|
9667
9664
|
"browser": "Chromium 156.0.8078.4",
|
|
9668
9665
|
"node": "v24.21.0",
|
|
9669
9666
|
"os": "win32 10.0.26200",
|
|
@@ -9672,29 +9669,28 @@
|
|
|
9672
9669
|
"count": 1000,
|
|
9673
9670
|
"warmup": 20,
|
|
9674
9671
|
"iterations": 100,
|
|
9675
|
-
"medianMs": 0.
|
|
9676
|
-
"p95Ms":
|
|
9672
|
+
"medianMs": 0.5,
|
|
9673
|
+
"p95Ms": 0.699999988079071,
|
|
9677
9674
|
"targetMedianMs": 16,
|
|
9678
9675
|
"includes": "logical mutations and synchronous DOM commit; excludes paint",
|
|
9679
9676
|
"timings": [
|
|
9677
|
+
0.3999999761581421, 0.3999999761581421, 0.3999999761581421, 0.3999999761581421,
|
|
9678
|
+
0.3999999761581421, 0.3999999761581421, 0.3999999761581421, 0.3999999761581421,
|
|
9679
|
+
0.3999999761581421, 0.3999999761581421, 0.40000003576278687, 0.40000003576278687,
|
|
9680
|
+
0.40000003576278687, 0.40000003576278687, 0.40000003576278687, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
|
|
9680
9681
|
0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
|
|
9681
9682
|
0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
|
|
9682
|
-
0.
|
|
9683
|
-
0.
|
|
9684
|
-
0.
|
|
9685
|
-
0.5999999940395355, 0.5999999940395355, 0.5999999940395355, 0.5999999940395355,
|
|
9686
|
-
0.5999999940395355, 0.5999999940395355, 0.5999999940395355, 0.5999999940395355,
|
|
9687
|
-
0.5999999940395355, 0.5999999940395355, 0.5999999940395355, 0.5999999940395355,
|
|
9688
|
-
0.5999999940395355, 0.5999999940395355, 0.5999999940395355, 0.5999999940395355,
|
|
9689
|
-
0.5999999940395355, 0.5999999940395355, 0.5999999940395355, 0.5999999940395355,
|
|
9690
|
-
0.5999999940395355, 0.5999999940395355, 0.6000000238418579, 0.6000000238418579,
|
|
9683
|
+
0.5999999642372131, 0.5999999642372131, 0.5999999642372131, 0.5999999642372131,
|
|
9684
|
+
0.5999999642372131, 0.5999999642372131, 0.5999999642372131, 0.5999999642372131,
|
|
9685
|
+
0.5999999642372131, 0.5999999642372131, 0.5999999642372131, 0.5999999642372131,
|
|
9691
9686
|
0.6000000238418579, 0.6000000238418579, 0.6000000238418579, 0.6000000238418579,
|
|
9692
|
-
0.6000000238418579, 0.
|
|
9693
|
-
0.
|
|
9694
|
-
0.
|
|
9695
|
-
0.
|
|
9696
|
-
0.
|
|
9697
|
-
|
|
9687
|
+
0.6000000238418579, 0.6000000238418579, 0.6000000238418579, 0.6000000238418579,
|
|
9688
|
+
0.6000000238418579, 0.6000000238418579, 0.6000000238418579, 0.6000000238418579,
|
|
9689
|
+
0.6000000238418579, 0.6000000238418579, 0.6000000238418579, 0.6000000238418579,
|
|
9690
|
+
0.6000000238418579, 0.6000000238418579, 0.6000000238418579, 0.6000000238418579,
|
|
9691
|
+
0.699999988079071, 0.699999988079071, 0.699999988079071, 0.699999988079071, 0.699999988079071,
|
|
9692
|
+
0.7000000476837158, 0.7000000476837158, 0.800000011920929, 1.0999999642372131,
|
|
9693
|
+
1.399999976158142
|
|
9698
9694
|
]
|
|
9699
9695
|
}
|
|
9700
9696
|
}
|
package/src/changes/restore.ts
CHANGED
package/src/elements/text.ts
CHANGED
|
@@ -63,10 +63,10 @@ export class Text extends TextBase<SVGTextElement, TextAttributes> {
|
|
|
63
63
|
leading(): number;
|
|
64
64
|
leading(value: number): this;
|
|
65
65
|
leading(value?: number): number | this {
|
|
66
|
+
this.assertLive();
|
|
67
|
+
const content = contentFor(this);
|
|
68
|
+
if (value === undefined) return content.leading;
|
|
66
69
|
return mutation(this, () => {
|
|
67
|
-
this.assertLive();
|
|
68
|
-
const content = contentFor(this);
|
|
69
|
-
if (value === undefined) return content.leading;
|
|
70
70
|
if (!Number.isFinite(value) || value < 0)
|
|
71
71
|
throw new RangeError('Leading must be finite and nonnegative');
|
|
72
72
|
content.leading = value;
|
package/src/mixins/sizable.ts
CHANGED
|
@@ -27,18 +27,18 @@ export const Sizable: MixinSizable = (BaseClass) => {
|
|
|
27
27
|
|
|
28
28
|
width(): Length | null;
|
|
29
29
|
width(value: Length): this;
|
|
30
|
+
// Reads skip change tracking: a tracked read captures sibling order, which made
|
|
31
|
+
// measuring n fresh siblings O(n²) while change listeners were attached.
|
|
30
32
|
width(value?: Length): Length | null | this {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
});
|
|
33
|
+
if (value === undefined) return this.dimension('width');
|
|
34
|
+
return mutation(this, () => this.resize('width', value));
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
height(): Length | null;
|
|
37
38
|
height(value: Length): this;
|
|
38
39
|
height(value?: Length): Length | null | this {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
});
|
|
40
|
+
if (value === undefined) return this.dimension('height');
|
|
41
|
+
return mutation(this, () => this.resize('height', value));
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
size(width: Length, height?: Length): this {
|
package/src/text/rich-textual.ts
CHANGED
|
@@ -65,9 +65,9 @@ export const RichTextual: MixinFactory<RichTextFeature, ParentNode> = (BaseClass
|
|
|
65
65
|
text(): string;
|
|
66
66
|
text(value: string): this;
|
|
67
67
|
text(value?: string): string | this {
|
|
68
|
+
this.assertLive();
|
|
69
|
+
if (value === undefined) return this.#content.text();
|
|
68
70
|
return mutation(this, () => {
|
|
69
|
-
this.assertLive();
|
|
70
|
-
if (value === undefined) return this.#content.text();
|
|
71
71
|
this.#content.plain(value);
|
|
72
72
|
return this;
|
|
73
73
|
});
|