Re:JavaScript Growing Pains: From 0 to 13,000 Dependencies
by rozab on Sunday June 14, 2020 @11:37AM
(#23518453)
But why should isOdd, isEven and isNumber reside in seperate packages? Surely a single math tools package should cover all of this?
[ Parent
| on HN ]
Re:JavaScript Growing Pains: From 0 to 13,000 Dependencies
by onion2k on Sunday June 14, 2020 @04:00PM
(#23520828)
Surely a single math tools package should cover all of this?
They shouldn't. It's silly. You're right that there should be "math"[1], but while those things aren't part of the main JS ecosystem people write utility libraries and publish them.
[1] There is, it's https://mathjs.org/. More people should use it.
Re:JavaScript Growing Pains: From 0 to 13,000 Dependencies
by wongarsu on Sunday June 14, 2020 @12:07PM
(#23518777)
It's an overreaction to the critizism of bloated libraries like JQuery. Dead code removal with tree shaking is a relatively recent feature in JS toolchains, so instead you have single-function libraries. For example there are also npm packages with each lodash function as its own package [1]
1: https://www.npmjs.com/search?q=keywords:lodash-modularized