Environment
- vim-web
1.0.0-alpha.0, IIFE build (dist/vim-web.iife.js) loaded via <script>
- API:
VIM.Core.Webgl.createViewer() (headless, custom UI)
- Chromium / desktop, devicePixelRatio 1.75
- Model: 2,547 elements (2,264 with geometry), 12 Revit categories, structural
Summary. Each createViewer() allocates a WebGL context. Re-creating viewers (hot reload,
route changes, repeated mounts) without disposing leaks contexts. Browsers cap WebGL contexts
(~16); past that the renderer degrades and the page freezes — symptom: JS still responds
but rendering/screenshots hang, no error thrown. We hit exactly this during development.
Fix that resolved it.
window.addEventListener('pagehide', () => viewer.dispose());
// or call viewer.dispose() on component unmount
Asks. Show viewer.dispose() in the quickstart (mount/unmount lifecycle), and consider
warning when the active context count gets high.
Environment
1.0.0-alpha.0, IIFE build (dist/vim-web.iife.js) loaded via<script>VIM.Core.Webgl.createViewer()(headless, custom UI)Summary. Each
createViewer()allocates a WebGL context. Re-creating viewers (hot reload,route changes, repeated mounts) without disposing leaks contexts. Browsers cap WebGL contexts
(~16); past that the renderer degrades and the page freezes — symptom: JS still responds
but rendering/screenshots hang, no error thrown. We hit exactly this during development.
Fix that resolved it.
Asks. Show
viewer.dispose()in the quickstart (mount/unmount lifecycle), and considerwarning when the active context count gets high.