r/ProgrammerAnimemes • u/bucket3432 • Jan 30 '20
OC Dependencies
Enable HLS to view with audio, or disable this notification
1.6k
Upvotes
r/ProgrammerAnimemes • u/bucket3432 • Jan 30 '20
Enable HLS to view with audio, or disable this notification
View all comments
Show parent comment
8
u/BakuhatsuK Jan 31 '20
I agree with both. If you are already using it in a bunch of places (you are already paying the bundle size price) it doesn't matter if you use it for a trivial task.
But if you are including it for a single use in your application, chances are using Date wouldn't be that painful.
Date in JS is actually really nice compared to, for example, C's datetimes in seconds from the epoch. JS Dates have millisecond resolution btw.
Furthermore, moment is really huge, even more if you need locales (I'm in Colombia so I have to include them to get months and stuff in spanish).
With webpack treeshaking might save you but only if you also have good chunk splitting.