Replies: 1 comment 4 replies
-
Good question - I'm constantly trying to understand the various ways users consume this library and which sizes they care about. In general, I tend to assume most folks are using our npm bundle (or doing a similar bundling / tree-shaking process themselves). Which download size of model-viewer-effects are you referring to when you say you saved hundreds of kb? So, to answer your questions, I'll need to know a bit more about how you use and consume these libraries and where the binary size bottlenecks are. Are you interested in contributing your custom effect as an example here, or would you prefer it in your own repo? |
Beta Was this translation helpful? Give feedback.
-
Hi folks!
I'm working on a custom effect. I've got it working hacked together (https://www.atomwolf.org/posts/rendering-outlines-with-a-post-processing-shader/) but I'd like to package it up nicely.
It depends on model-viewer, of course, but also model-viewer-effects for the effects composer and such. However, much of the download size of model-viewer-effects is example effects. For giggles, I commented out most of
src/model-viewer-effects.ts
, threw it into vite, and saved hundreds of kilobytes, IIRC. (Enough for me to care, I guess, but of course everyone has their own thresholds.)I'm not really "in the JavaScript scene" so I don't know how this typically goes, and I'd really appreciate any thoughts.
Does it make sense to have a trimmed model-viewer-effects that doesn't include examples? Is that silly?
Is it something I should do alongside my custom effect, rather than here? (My first gut feeling is no, as it'd be just another way to be out of date, but that's just a thought.)
Beside a module with just the custom effect, does it make sense for me to include an all-in-one bundle with model-viewer, model-viewer-effects (trimmed up, maybe), and the custom effect? Is that something that anyone who cares about would just make on their own? (I guess I'd have to look at licensing but I'm not too picky about which open source license I put the custom effect code under, if it makes things easier.) I don't really have a grasp on the different types of users of model-viewer and what they're comfortable with.
Thanks, folks!
Beta Was this translation helpful? Give feedback.
All reactions