-
Notifications
You must be signed in to change notification settings - Fork 158
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
Library Size #144
Comments
Never mind, looks like it's because of moment-timezone |
Yea its massive. Surely there is a way to make it smaller? Do we need all the locales that come with This is a bit ridiculous: Like what the heck is that Never mind: moment/moment-timezone#697 I see it is all the timezone data for the past however many years. Damn timezones... we should just get rid of them altogether (on this planet, I mean - not the library). |
Good news for anyone using webpack and not using the timezone aspect of this library. I put this in my webpack plugins (basically replaces plugins: [
new webpack.NormalModuleReplacementPlugin(
/moment-timezone/,
'moment'
),
new webpack.IgnorePlugin({
contextRegExp: /moment/,
resourceRegExp: /^\.\/locale$/,
}),
], Much nicer: |
@lostpebble thanks for bringing this up! We could possibly remove |
Day.Js is a nice alternative to me with etc support ⏰ Day.js 2KB immutable date library alternative to Moment.js with the same modern API |
@xxyuk the biggest issue is timezone support, which Day.Js doesn't seem to have: iamkun/dayjs#46 Supporting timezone is always going to be a massive amount of data because of the fact that every nation in the world has pulled a random number out of their ass to define an irrelevant time that they think the clock should display when the sun rises and sets (sometimes multiple numbers and the can be different at multiple times during the year too...). Day.Js seems to have a better way of dealing with locales though, and the rest of the library is smaller as well I think. So its a good choice if there wasn't any need for timezone support. |
I think using something like https://github.com/yurikuzn/moment-timezone-data-build with wrt |
maybe just let the user supply instances for moment himself? |
I have a port to luxon here: https://github.com/tjk/cron-parser/tree/luxon Can it help this library at all? |
@tjk looks nice... but isn't ´luxon´ even heavier (judging this based on the package size) than ´moment-timezone´? |
|
With new |
First of all, really nice job! Exactly what I was looking for.
I just have a little concern with the size of the library, do you know why it's over 100KB when compressed? Are you utilizing another(larger) library?
Thanks!
The text was updated successfully, but these errors were encountered: