Skip to content
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

Replace Moment.js with Day.js #3200

Merged
merged 11 commits into from
Jan 21, 2021
Merged

Replace Moment.js with Day.js #3200

merged 11 commits into from
Jan 21, 2021

Conversation

Danieladu
Copy link
Contributor

@Danieladu Danieladu commented Jan 19, 2021

Fixes #3133

Description

For Moment.js is now in legacy/maintenance mode. Consider replacing it with other libraries.
There are several other alternatives. Including luxon, Day.js and date-fns

Why we choose Day.js. There are several considerations:

  • Small. It only 2.9K in size (without extension).
  • API is highly compatible with Moment.js. So, it is easy for SDK to convert.
  • Great support for internationalization.
  • Rich and comprehensive functions and extensions.

Detailed introduction and comparison:https://github.com/you-dont-need/You-Dont-Need-Momentjs/blob/master/README.md

Affected projects

  • libraries/adaptive-expressions
  • libraries/botbuilder-repo-utils
  • libraries/botbuilder
  • tools

Change details

  • Drop moment and moment-timezone dependency, and use dayjs instead
  • Use native Date functions as much as possible to implement related functions
  • Make date related function purer
  • Remove some unnecessary intermediate functions

@coveralls
Copy link

coveralls commented Jan 19, 2021

@Danieladu Danieladu marked this pull request as ready for review January 19, 2021 08:59
@joshgummersall
Copy link
Contributor

This is awesome! What a huge bundle size saving 👍

Copy link
Contributor

@joshgummersall joshgummersall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple quick suggestions, otherwise looks good!

@Danieladu Danieladu requested a review from cosmicshuai January 21, 2021 03:11
@Danieladu Danieladu merged commit 7883d7b into main Jan 21, 2021
@Danieladu Danieladu deleted the hond/drop-moment branch January 21, 2021 05:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Moment.js is now in legacy/maintenance mode
3 participants