New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggestion: Use some other time library? #78
Comments
Hi. I've been thinking about working with locales and I guess Moment is good with that |
From my understanding, date-fns is the closest time library to Moment. |
@jvanallen93 Actually Luxon is closer. Its been developed by one of Moment maintainers and it eventually came under Moment umbrella. Its really, really good. Especially the way it handles locales, its immutability and the fact that its so much smaller than moment itself. API itself is also quite close to moment. @Agranom The problem with moment (and its locales) is that its huge and it easily adds > 1MB to the angular's bundle size. This is the reason we are avoiding using Moment in Angular completely. Sure the size gets Gzipped a bit, but its still pretty heavy compared to say Luxon or date-fns. Would be really happy to see this library switch to something else so that we could include it in our project. If I look at our app report, I find that moment + moment locales take up about 1.4 MB in parsed (minified) size: Luxon on the other hand is 63 Kb. |
@Enngage this is awesome to see and thanks for another date package to investigate! |
I'm also interested in avoiding moment. We are already using As a guess, how difficult would it be to swap out moment? Is it something I could PR? |
I'm totally agree with you guys. And I'll change the library once I have time. I hope it will be soon |
That would be really awesome, thanks! Maybe you could leverage material's |
Any news about this? Would like to switch to this lib when possible :-) |
Didn't have time for that. Going to start today. |
Can't personally vouch for it but have read about Day.Js as an alternative ⏰ Day.js 2KB immutable date library alternative to Moment.js with the same modern API https://github.com/iamkun/dayjs reference: moment/moment#2373 (comment) |
Nice overview of these libraries can be found here -> https://github.com/you-dont-need/You-Dont-Need-Momentjs I'm using Luxon as (in my opinion) its the most modern and already quite mature library + I needed timezone support. |
Here another one interested to avoid Moment.js |
I've already started with luxon library |
Done. Changed momentJs to luxon. But I'm not sure that size of the timepicker package's got smaller. |
@Agranom Awesome. I don't think the size of your library matters much - it's still very small. It's the moment dependencies that cause apps to bloat. I'll switch to this library soon :-) |
Great work! Thanks a lot! |
Great. Hope those changes will not affect on functionality |
Just as a suggestion, Moment is a fairly large library and there has been recent development in the time library area that can do 75-80% of what Moment can do. Might be worth looking into! If I can help in any way, please let me know!
The text was updated successfully, but these errors were encountered: