4 ms·
Does this mean we can finally stop downloading and running a third of a MB of js on every website? moment.js, luxon, date-fns, are all obsolete? https://bundlep
by infogulch 2y ago
Does this mean we can finally stop downloading and running a third of a MB of js on every website? moment.js, luxon, date-fns, are all obsolete? https://bundlephobia.com/package/moment@2.30.1 https://bundlephobia.com/package/moment@2.30.1
- jb1991 2y agoThe implications of Temporal are absolutely huge. This is a game-changer and I can't wait to see how everyone benefits, developers and users alike.
- swyx 2y agohow are they huge?
- WorldMaker 2y agoAs mentioned a couple posts up, it would certainly help finally stop a lot of web applications (generally accidentally) bundling a bonus copy of the entire IANA TZ DB via Moment.js including it all by default "just in case". Cutting a lot of poor tree shaking out of the web by truly and finally "killing" Moment.js will be huge in download sizes if nothing else.
- kccqzy 2y agoI would start by arguing that not every website needs to deal with dates and times on the client side. And furthermore, if a website only needs to deal with dates but not times (surprisingly common) it can be done in a few KB of JavaScript—the Gregorian calendar is easy compared to the mess of ever-changing time zones and leap seconds.
- syncsynchalt 2y agoI'd argue the opposite: APIs should publish all datetimes as UTC timestamps and only the client should be involved in presenting datetimes in the way best suited to the user experience. I'd also argue that presenting dates in ~0KB of javascript is better and less error-prone than several KB of javascript - it also allows users to see dates in non-Gregorian calendars when they prefer.
- kccqzy 2y agoI'm afraid you have missed the point. My point is that most of the time you don't need datetimes. You only need dates. Think about sites like blogs. The user only needs to know on what date a blogpost is published. Likewise for newspapers: we have hundreds of years of paper newspapers where people know on what date an article is published but not at what time. Think about banks. My bank tells me the date of a transaction, not its time. Likewise for brokerages.
- burntsushi 2y agoMy brokerage gives me the date, time and time zone! From my most recent transation: 01/31/2025 11:35:11 AM.,EST
- Uninen 2y agomoment.js has been obsolete for years. I've considered it as a sign of an unmaintained code for at least ~5 years by now. There has been so many better and lightweight alternatives for years that if you haven't already refactored it away, you just don't care about your users or the bundle size. (And I have personally done that exercise a handful of times myself, I know it can be painful, but it's just one relatively small PR!)
- jwr 2y ago> moment.js has been obsolete for years. I've considered it as a sign of an unmaintained code for at least ~5 years by now. What's wrong with continuing to use moment.js in an application where it works well?
- 8n4vidtmkvmk 2y agoHey now, I'm offended. I maintain my app. I just have better things to do than constantly upgrade and strip away old libs because the JS kids have moved onto the next hottest thing.
- collinmanderson 2y ago> Does this mean we can finally stop downloading and running a third of a MB of js on every website? moment.js, luxon, date-fns, are all obsolete? https://bundlephobia.com/package/moment@2.30.1 https://bundlephobia.com/package/moment@2.30.1 In reality, it probably means adding yet another polyfill to the list.
- infogulch 2y agoI agree it probably means another polyfill. Tangentially... Why did you quote the entire parent post? Quoting a small subset of a large post to respond is one thing, but copying the entire post into a reply adds unnecessary repetition and visual noise to the thread for no benefit. (Is it just me or is this becoming more common?)