@glissade/backend-dom 0.21.0-pre.1 → 0.21.0-pre.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.
Files changed (2) hide show
  1. package/README.md +30 -0
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -56,6 +56,36 @@ stage.addEventListener('click', (e) => {
56
56
  });
57
57
  ```
58
58
 
59
+ > **One `emitWithIds()` feeds BOTH `setIds` and `render`.** The id stream is
60
+ > positional by command index, so `setIds(...)` and `render(...)` must come from
61
+ > the *same* emit — `setIds(emitWithIds(sceneA, …).ids)` then
62
+ > `render(evaluate(sceneB, …))` silently mis-maps `data-node-id`. Always destructure
63
+ > one call: `const { displayList, ids } = emitWithIds(scene, tl, t)`.
64
+
65
+ ## No-build (`<script src>`)
66
+
67
+ The DOM tier ships as a separate **optional** IIFE, `glissade-dom.browser.js`, a
68
+ second `<script>` loaded *after* the base bundle — it augments `window.glissade`
69
+ with `DomBackend` + `emitWithIds` (the base playback bundle stays lean and
70
+ `DomBackend`-free):
71
+
72
+ ```html
73
+ <script src="https://unpkg.com/@glissade/browser/dist/glissade.browser.js"></script>
74
+ <script src="https://unpkg.com/@glissade/browser/dist/glissade-dom.browser.js"></script>
75
+ <script type="module">
76
+ const backend = new glissade.DomBackend(document.getElementById('stage'));
77
+ function frame(t) {
78
+ for (const m of movements) m.run(t);
79
+ const { displayList, ids } = glissade.emitWithIds(scene, EMPTY, t); // ONE emit
80
+ backend.setIds(ids);
81
+ backend.render(displayList);
82
+ }
83
+ </script>
84
+ ```
85
+
86
+ Load order is fail-loud: `glissade-dom.browser.js` throws a clear error if the
87
+ base bundle is absent or a different version (never a cryptic `undefined`).
88
+
59
89
  ## What it maps
60
90
 
61
91
  | IR op | DOM/SVG |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glissade/backend-dom",
3
- "version": "0.21.0-pre.1",
3
+ "version": "0.21.0-pre.2",
4
4
  "description": "glissade DOM render backend: DisplayList -> HTML/SVG elements. A preview / non-parity realtime tier (accessibility, selectable text, CSS-native embedding) — NOT a Skia-export twin.",
5
5
  "license": "Apache-2.0",
6
6
  "engines": {
@@ -18,8 +18,8 @@
18
18
  "dist"
19
19
  ],
20
20
  "dependencies": {
21
- "@glissade/core": "0.21.0-pre.1",
22
- "@glissade/scene": "0.21.0-pre.1"
21
+ "@glissade/core": "0.21.0-pre.2",
22
+ "@glissade/scene": "0.21.0-pre.2"
23
23
  },
24
24
  "repository": {
25
25
  "type": "git",