pmndrs / drei-vanilla

🍦 drei-inspired helpers for threejs

Home Page:https://pmndrs.github.io/drei-vanilla/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HMR

abernier opened this issue · comments

Describe the feature you'd like:

Currently, with sb6 (with webpack5 builder), as @vis-prime has reported each time a Storybook control is changed, the whole scene is re-rendered, without HRM:

WARNING: Too many active WebGL contexts. Oldest context will be lost. THREE.WebGLRenderer: Context Lost.

@CodyJasonBennett suggested 2 options:

  1. implementing https://vitejs.dev/guide/api-hmr.html#hmr-api
  2. creating a custom canvas and using that globally so it never unmounts/disposes of the actual canvas/context

Suggested implementation:

Regarding those 2 options:

  1. requires Storybook vite builder which is available in v6, but since sb7 will be vite-based by default, we should rather wait for v7
  2. is still an option