Community collection of Components
# package-development
w
Thought/ideas: Do we have a community package of components/elements ?
Why? Well I know a few packages use charts or similar in their packages. So it would be good to have a generic one we can use that wraps ChartJS. Rather than each seperate package pulling in their own copy of the library and thus making the backoffice bigeger and bigger with more bytes being sent over the wire that could be unecessary
I know we are all more conscious with being greener and saving bytes etc...
j
I don't think this is practical, or even necessarily more efficient. Versioning will be a pain, what if packages need conflicting versions/features? There's no nice way for Vite and/or NPM to handle the dependency, so you'd have to rely on nuget to actually ship the component library dependency to the backoffice - which feels kind of wrong. Modern JS libs like ChartJS are supposed to be used with an "import only what you need" approach. If you want to provide a single shared version you have to import everything people might need. If multiple packages use only a subset you may find that importing the same small thing multiple times is better than importing the whole kit and kaboodle once.
And said dependencies should be lazy loaded too.
w
Yeh fair point. I just have worries that we gonna have duplicated stuff in our installs
m
@Warren Buckley had the same idea as well, I will be using ChartJS for at least one package, maybe more in the future - I know workflow is using it. Not an expert here but if @Jason says its better that everyone shipts the own then it make sense 😄 At the end of the day the addition to the bundle is like 150kb which is far less than any avarage image today
j
We will, but I think that's actually the least worse option.