4 ms·
The short answer is that you'd use Svelte Cubed for the same reason you'd use Svelte (or indeed any component framework) itself: declarative code tends to be m
by rich_harris 5y ago
The short answer is that you'd use Svelte Cubed for the same reason you'd use Svelte (or indeed any component framework) itself: declarative code tends to be more robust, readable and maintainable than imperative code.
There's absolutely nothing wrong with using Three directly, but it's equivalent to using the DOM directly. At some point it gets hard to keep track of hierarchical relationships that aren't expressed as hierarchies, and managing state across your app becomes a burden.
In addition, because components have a managed lifecycle, you get things like hot module reloading 'for free' if you're using a framework like Vite (or SvelteKit, which uses Vite). Once you've tried building scenes this way (e.g. maintaining your camera position while you tweak the properties of an object you've zoomed in on), Cmd-R driven development feels paleolithic.