Consider alternatives to moment.js
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Evergreen |
New
|
Undecided
|
Unassigned |
Bug Description
Moment.js has an informative page on their site about the project being in maintenance mode: https:/
Including moment and moment-tz in the Angular client adds a solid 870 KB to our bundle size, the majority of which is locale information for locales Evergreen doesn't support. This makes it slower for the staff client to load for users, and also likely slows down our build time.
Two of moment's suggested replacements -- date-fns and luxon -- seem worth investigating.
If we do decide to stay with moment.js, it would be worth doing something like this to only import the locales that Evergreen actually supports (which could be overriden by an installation that needs an unsupported locale, of course): https:/
You can check moment.js's contribution to our bundle size with:
- npm i webpack-
- ng build --stats-json
- npx webpack-
description: | updated |
A note that date-fns and luxon both use different date format tokens than Moment does. I wonder if we could somehow migrate the date format strings in the library settings?
* Luxon's tokens: https:/ /moment. github. io/luxon/ #/parsing? id=table- of-tokens /github. com/date- fns/date- fns/blob/ main/docs/ unicodeTokens. md /momentjs. com/docs/ #/parsing/ string- format/
* date-fns tokens (they use a specific unicode standard): https:/
* MomentJs tokens: https:/