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 with dayjs #7025

Merged
merged 3 commits into from Nov 30, 2019
Merged

Replace moment with dayjs #7025

merged 3 commits into from Nov 30, 2019

Conversation

cktang88
Copy link
Contributor

@cktang88 cktang88 commented Nov 28, 2019

What did you implement

Closes #7022

Build size should be much smaller now, since dayjs is around 60kb less than moment gzipped.

dayjs: https://bundlephobia.com/result?p=dayjs@1.8.17
moment: https://bundlephobia.com/result?p=moment@2.24.0

How can we verify it

Run the tests.

Todos

Useful Scripts
  • npm run test-ci --> Run all validation checks on proposed changes
  • npm run lint-updated --> Lint all the updated files
  • npm run lint:fix --> Automatically fix lint problems (if possible)
  • npm run prettier-check-updated --> Check if updated files adhere to Prettier config
  • npm run prettify-updated --> Prettify all the updated files
  • Write and run all tests
  • Write documentation
  • Enable "Allow edits from maintainers" for this PR
  • Update the messages below

Is this ready for review?: YES
Is it a breaking change?: NO

@codecov-io
Copy link

codecov-io commented Nov 28, 2019

Codecov Report

Merging #7025 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7025      +/-   ##
==========================================
+ Coverage   88.48%   88.49%   +<.01%     
==========================================
  Files         229      229              
  Lines        8418     8422       +4     
==========================================
+ Hits         7449     7453       +4     
  Misses        969      969
Impacted Files Coverage Δ
lib/plugins/aws/utils/formatLambdaLogEvent.js 100% <100%> (ø) ⬆️
lib/plugins/aws/logs/index.js 94.11% <100%> (+0.24%) ⬆️
lib/plugins/aws/metrics/awsMetrics.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f1d2d00...6e37635. Read the comment docs.

@cktang88
Copy link
Contributor Author

@medikoo can you take a look at this?

@medikoo medikoo added this to the 1.59.0 milestone Nov 29, 2019
Copy link
Contributor

@medikoo medikoo left a comment

Choose a reason for hiding this comment

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

@cktang88 Thank you! Looks good, still I'd rename vars to dayjs, as otherwise it may confuse devs they rely on moment specifically when reading the code (and require is on top of the file it can be missed).

Copy link
Contributor

@medikoo medikoo left a comment

Choose a reason for hiding this comment

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

Thank you @cktang88 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace momentjs with dayjs or luxon to drastically reduce bundle size
4 participants