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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove momentjs #4070

Merged
merged 5 commits into from
May 8, 2022
Merged

Conversation

VIKTORVAV99
Copy link
Member

@VIKTORVAV99 VIKTORVAV99 commented May 2, 2022

This PR removes momentjs and replaces it with date-fns helper functions and native code.
This alone shaves almost 250kb of the vendor bundle (before gzip).

Most of the changes are pretty simple but I decided to use Intl.DateTimeFormat and Intl.RelativeTimeFormat to localize string, this is somewhat a breaking change as it no longer automatically pick a unit (hour, days, months, etc) and only use the specified unit (hour in this case). It should not be a problem but might look a bit weird to see 2000+ hours when doing local development. 馃槄

### NO IE 11 SUPPORT!
As Intl.RelativeTimeFormat is not supported by IE 11 this means we would no longer support IE 11, I personally think this is the right way forward as Microsoft themselves will stop supporting it next month as mentioned in #4034. With the merger of #4082 this is no longer relevant. 馃檪

@github-actions github-actions bot added dependencies Pull requests that update a dependency file frontend 馃帹 labels May 2, 2022
@VIKTORVAV99
Copy link
Member Author

VIKTORVAV99 commented May 2, 2022

In local development I got build failure due to babel being outdated and I think this is the same error so this should be fixed after #4078 is merged.

Fixed by #4078 as suspected.

Copy link
Member

@madsnedergaard madsnedergaard left a comment

Choose a reason for hiding this comment

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

This is awesome! It's really nice to actually get localised date formats at last 馃槏
Screenshot 2022-05-08 at 20 05 42
Screenshot 2022-05-08 at 20 05 35
Screenshot 2022-05-08 at 20 05 26

@madsnedergaard madsnedergaard enabled auto-merge (squash) May 8, 2022 18:16
@VIKTORVAV99
Copy link
Member Author

This is awesome! It's really nice to actually get localised date formats at last 馃槏
Screenshot 2022-05-08 at 20 05 42
Screenshot 2022-05-08 at 20 05 35
Screenshot 2022-05-08 at 20 05 26

Yeah I saw someone mentioning it in a old issue (can't find it now) and figured it would be a really nice benefit!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file frontend 馃帹
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants