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

[React] Remove dependency on moment from components #1140

Open
sawyerh opened this issue Jul 30, 2020 · 1 comment
Open

[React] Remove dependency on moment from components #1140

sawyerh opened this issue Jul 30, 2020 · 1 comment

Comments

@sawyerh
Copy link

sawyerh commented Jul 30, 2020

Mayflower version: 10.0.0-alpha.2

We recently added the FooterSlim component to our application and noticed the bundle size increased about 100kb. This seems to mostly be due to the inclusion of moment as a dependency in this component, which comes with a large set of locale files:

image

It looks like the footer component uses moment as a way to reference the current year in the copyright text, in which case something like the following should work without requiring an external dependency:

new Date().getFullYear()

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getFullYear

@clairesunstudio
Copy link
Contributor

ha, @smurrayatwork is on it already! thanks for flagging this and attaching the treemap!

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

No branches or pull requests

2 participants