Re:I've Just Liberated My Modules
by larkinrichards on Wednesday March 23, 2016 @01:49AM
(#11342394)
Underscore/lodash is a great bundle of functions that do simple things well. And it's a tiny enough library that there is really no need to split it into 270 modules.
I support packages of utility functions. Distributing them individually is a waste of resources when you have tree shaking.
I trust a dependency on lodash. I don't trust a dependency on a single 17 line function.
Re:I've Just Liberated My Modules
by joshmanders on Wednesday March 23, 2016 @08:54AM
(#11343945)
While I agree with you, tree shaking is relatively new in the JavaScript world thanks to Webpack 2 and Rollup.js before that, if you had a dependency you brought it's whole lib into your project whether you used one method or all of them. So just including Lodash wasn't an option for people who cared about loading times for their users. A 17 line module was.
Re:I've Just Liberated My Modules
by larkinrichards on Wednesday March 23, 2016 @06:33PM
(#11348807)
Closure Compiler's advanced mode (tree shaking) has been around since 2010.
I thought how commands are bundled into packages was the entirety of what we were discussing. That was my interpretation of larkinrichards's comment (way) up above. Packages are the unit of installation, not use. Packages are all we're arguing about.
My position: don't put words in God's mouth :) The unix way is commands that do one thing and do it well. But the unix way is silent on the right way to disseminate said commands. There you're on your own.