moira-alert / moira

Realtime Alerting for Graphite and Prometheus
MIT License
296 stars 68 forks source link

Enhancement :- Move from momentjs to date-fns to improve performance #276

Open siddhant1 opened 5 years ago

siddhant1 commented 5 years ago

This is a very small enhancement in the editor but I we should use date-fns over momentjs because it is super small and imporves performance.

Links :- https://twitter.com/addyosmani/status/1037587112730611714?lang=en

sashasushko commented 5 years ago

We have moment-locales-webpack-plugin, which remove all locales except en.

We also have webpack-bundle-analyzer.

So, what I want...

siddhant1 commented 5 years ago

Cool , I will have a look

sashasushko commented 5 years ago

@siddhant1 how are you going? Need help?

ghost commented 5 years ago

Day.Js is a nice alternative to me

⏰ Day.js 2KB immutable date library alternative to Moment.js with the same modern API

https://github.com/iamkun/dayjs

sashasushko commented 5 years ago

@xxyuk if you will send PR, I review it asap

hv7214 commented 4 years ago

@sashasushko i would prefer date-fns due to following reasons:

  1. date-fns is immutable. That is it returns new Date instance from function which was run rather changing its own state.
  2. date-fns is divided by function level. So only those things will be imported which are needed.
sashasushko commented 4 years ago

@hv7214 it's argument :-)

So, you can send pull request. I'll review it. And, if need, we'll discuss date-fns at pull request

hv7214 commented 4 years ago

@sashasushko yeah sure : )