4 ms·
Yes I agree it's better to have one library with 20 helper functions than 20 libraries with 1 function each. Think Lodash. Although some people will then compl
by ggregoire 6y ago
Yes I agree it's better to have one library with 20 helper functions than 20 libraries with 1 function each. Think Lodash.
Although some people will then complain about the size of the library...
- speedgoose 6y agoYes. Every Lodash function is available in its own npm package too. I use it like this, I rather have 4 lodash packages than the big whole lodash library in one package with almost everything left unused.
- runawaybottle 6y agoJS libraries only did that to reduce bundle size being sent to the browser. It’s done out of necessity, not because it makes any sense. Exporting out one method at a time is pretty absurd.
- speedgoose 6y agoLodash has a lot of features that are not needed anymore or even dangerous sometimes. If you don't need them, why would you install them?
- runawaybottle 6y agoBecause it’s simply not a big deal on the server.
- Master_Odin 6y agoThese will go away in v5 (if a v5 is ever released) and is not recommended if using a bundler as it'll end up wasting space rather than saving as it'll include duplicate code that each individual function could share. https://lodash.com/per-method-packages https://lodash.com/per-method-packages
- speedgoose 6y agoThanks for the information. I think it will be about time to completely remove lodash from my code bases.