The bundle size has grown significantly with the 2.0.0 release. Currently weighing in at about 5MiB, compared to 578.6kB for 0.1.10. It's now also 7x the size of Three.js itself, and gzipped even 11x. While most apps using Spark will end up loading a large amount of splat data, making the bundle size less relevant, there are still benefits to reducing the bundle size. For Spark to load any splat data, it has to be downloaded, parsed and initialized, making it part of the critical request chain. In other words, savings translate to app load time as well.
Bundlephobia: Three | Spark
The goal of this issue is to discuss and collect various ways to bring the bundle size down. Supporting tree-shaking would also help for users that use a bundler. If needed, it's even possible to look into multiple entry-points for the package (e.g. all-in-one bundle and a minimal one + sub-paths for optional features).
Some possible improvements:
The bundle size has grown significantly with the 2.0.0 release. Currently weighing in at about 5MiB, compared to 578.6kB for 0.1.10. It's now also 7x the size of Three.js itself, and gzipped even 11x. While most apps using Spark will end up loading a large amount of splat data, making the bundle size less relevant, there are still benefits to reducing the bundle size. For Spark to load any splat data, it has to be downloaded, parsed and initialized, making it part of the critical request chain. In other words, savings translate to app load time as well.
Bundlephobia: Three | Spark
The goal of this issue is to discuss and collect various ways to bring the bundle size down. Supporting tree-shaking would also help for users that use a bundler. If needed, it's even possible to look into multiple entry-points for the package (e.g. all-in-one bundle and a minimal one + sub-paths for optional features).
Some possible improvements:
OldSparkRendererand related classes #322. User can always stay on 2.0.0 or revert to 0.1.10 if needed.compress-to-spz.jsto use worker based loaders or deprecate the utilitySplatSkinning,SplatEdits,SparkXr, etc... tree-shakablepostMessageto pass theModuleto the worker)