route-graphics 1.47.0 → 1.48.0

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/README.md CHANGED
@@ -80,6 +80,27 @@ other backend. The selected value is available as `app.rendererType`. Inline
80
80
  shader effects always provide both GLSL and WGSL so the same state works on
81
81
  either backend.
82
82
 
83
+ For scene/editor/preview handoffs, use `await app.reset({ eventHandler })`
84
+ instead of destroying and recreating the renderer. Reset clears the display tree,
85
+ animations, audio playback, keyboard bindings, DOM input controls, cursor state,
86
+ snapshot audio-effect requests, and pending render callbacks while preserving the
87
+ same canvas and GPU context. A render that reset interrupts is reported to the
88
+ previous `eventHandler` as `renderComplete` with `aborted: true`, and the first
89
+ render after a reset calls `onFirstRender` again.
90
+ It accepts runtime initialization overrides, including width/height and plugins;
91
+ renderer backend, fallback policy, and debug mode must remain unchanged.
92
+ Loaded assets stay owned by the instance: use `unloadAssets()` for media no longer
93
+ needed, and `destroy()` when the rendering surface is permanently discarded.
94
+ Serialize reset with asset loading and unloading. This avoids repeated WebGL
95
+ context creation during rapid view changes, which can exhaust WebKit's context
96
+ accounting even after explicit context loss ([WebKit bug 218305](https://bugs.webkit.org/show_bug.cgi?id=218305)).
97
+
98
+ Run `bun run build && node scripts/testRendererReset.mjs` to verify 40 resets in
99
+ Chromium and WebKit reuse one context, clear runtime state, and release the context
100
+ on final destruction, and that reset removes input controls and keyboard
101
+ bindings, stops animations, and keeps pointer events working. CI runs it in the
102
+ browser suite; the `reset-stops-audio` AVT spec covers audio.
103
+
83
104
  `createAssetBufferManager()` may keep image and video assets as direct source
84
105
  URLs when possible, while audio and font assets remain buffer-backed.
85
106