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 momentjs with dayjs or luxon to drastically reduce bundle size #4530

Closed
cktang88 opened this issue Nov 28, 2019 · 5 comments
Closed

Comments

@cktang88
Copy link

Replace to reduce bundle size. Moment.js is about 20x heavier than dayjs and does basically the same thing :(
Day.js https://github.com/iamkun/dayjs
Luxon https://moment.github.io/luxon/

@Unitech
Copy link
Owner

Unitech commented Nov 29, 2019

Yes true that moment is bloated: https://bundlephobia.com/result?p=moment@2.24.0
I already started to migrate from moment with date-fns: https://bundlephobia.com/result?p=date-fns@2.8.1

I wonder if I Luxon is a drop in replacement of moment

@Unitech
Copy link
Owner

Unitech commented Nov 29, 2019

moment().format('LTS') moment().diff(parseInt(t1))

This are the only momentjs calls ^^' so yes I will drop moment

@cktang88
Copy link
Author

dayjs is a drop in replacement of moment, and is even lighter than date-fns... https://bundlephobia.com/result?p=dayjs@1.8.17

@Unitech Unitech reopened this Apr 13, 2020
@Unitech
Copy link
Owner

Unitech commented Apr 13, 2020

date-fns + moment have been replaced by dayjs

@Unitech
Copy link
Owner

Unitech commented Apr 18, 2020

PM2 4.3.0 published:

npm install pm2@latest -g
pm2 update

@Unitech Unitech closed this as completed Apr 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants