4 ms·
why does the polyfill have dependencies? And it's 200KB alone compared to 60KB of moment.
by yread 2y ago
why does the polyfill have dependencies? And it's 200KB alone compared to 60KB of moment.
- numbsafari 2y agoDid you bother to look at it? It has a single dependency, and that single dependency has no dependencies of its own. So what is that dependency? "temporal-spec" And it looks like it comes from the same github repo. It basically looks like they broke out the API definitions so that they could be depended on by other potential implementations. This isn't atypical.
- yread 2y agoOh sorry I was looking at https://www.npmjs.com/package/@js-temporal/polyfill https://www.npmjs.com/package/@js-temporal/polyfill this one looks much better indeed
- evilduck 2y agoIf payload size is the top concern you shouldn't be using Moment either though. Luxon and DayJS are both considerably smaller (their uncompressed size is about what Moment's compressed size is) and the date-fns library is much, much smaller and also tree-shakeable. Moment also performs at or near the bottom of all available options if speed is a concern. Other than reflexive popularity or the cost already being paid there's not really a good reason to use it anymore.
- yread 2y agoExactly. I should've written even compared to moment