DEV Community

Discussion on: Moment.js Is Now Legacy Project | Alternatives?

Collapse
 
nikunjbhatt profile image
Nikunj Bhatt

This is what I don't like about software development. I am not talking about Moment.js. It's about the developers who think that a software is dead because no update is made. And since how much time? It depends on some random developers who think so!

There are objectives for developing a software. And when they are achieved, the software is declared dead!? There are many software which developers stop using for no logical reason, even when the developers haven't declared them dead, unmaintained, obsolete. But the wheel is reinvented, completely opposite of the reason behind making the software - that is, developers don't have to write the same code from scratch for every project they work on!

If a software has achieved its objectives then it is perfect for use. It is tried and tested. A lot of documentation, questions and answeres, solutions are available. Developers know its APIs. There are readymade code samples to copy-paste. Jumping to another software may require to create new code, new documentation, advertisement; and most importantly - a lot of time is wasted in developing, testing, debugging, learning, giving answers to questions.

I am seeing that new features are added in many software just because developers don't consider them dead. After a point, the newly added features are so odd that not even 0.00...001% developers use those features. Only their size increase. They become bloatware.

Many times it looks like the developers of the new software just want attention; it may be to be popular, add an achievement to their job profile, have money-making ideas, or any other reason.

Collapse
 
shinigami92 profile image
Shinigami

This is partially true, but not for moment.js
moment.js was developed into a wrong direction, like it has not immutability and also not good support for diverse calendar systems
It has also some other bugs

Luxon was a fresh start and addressed some of the design flaws that moment.js did

Also moment.js became to big and also stale in terms of modern js support
If you have a project that is meant to be only existing for the next 5 years and already runs since 2+ years, stay with moment.js
If you have a project that will be released in the next time, go with something else then moment.js

Collapse
 
frp profile image
frp

On one of the projects I touched recently, Moment.js was the single biggest contributor to the JS bundle bloat. That's because moment.js rolls its own localisation instead of using the Intl API. For this reason alone, it's not a good library to use on the frontend.

Collapse
 
anubarak profile image
Robin Schambach • Edited

I would suggest you to treeshake the languages you don't need.
After doing so it is much smaller

There is a Plugin

new MomentLocalesPlugin({
    localesToKeep: ['de-DE'],
}),
Enter fullscreen mode Exit fullscreen mode