-
Notifications
You must be signed in to change notification settings - Fork 5
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
[ADS-645] Remove extra chunk and make moment external #686
Conversation
Codecov Report
@@ Coverage Diff @@
## master #686 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 53 53
Lines 776 776
Branches 154 154
=====================================
Hits 776 776 Continue to review full report at Codecov.
|
The issue wasn't with |
Apart from the comment around localisation, LGTM. I just have a concern about externalising moment. It's a clear dependency of our code, unlike react which is the framework our code is built upon. I know it saves us some size but it's now required to be installed by a third-party application and not sure if it makes sense (unlike moment-tz) like my last comment mentions. I still feel it should be an installed dependency. |
@omgaz I don't see many problems because |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks fine, but I'm not familiar with the background here.
@sonhanguyen did you send this around for another review? |
@@ -1,4 +0,0 @@ | |||
import 'styles/_react-datepicker-custom.scss'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
by removing these extra entries, you can revert changes made in #672 (see its description)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reverted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@omgaz @xiaofan2406, should we make moment an optional dependency? |
It should be a peerDeps, like |
@xiaofan2406 yeah but peer means required. We happen to have |
@omgaz what do you think about react as a peerDep, seems like the way most projects do it. |
moment is a requirement so it does make sense for it to be a peer dependency like react, but we can deal with it in another PR. Also, we do use the react-datepicker in all projects. |
I remember peer deps will come off as warning not error. So if a project uses adslot-ui and dont use the date picker component, the project can choose to not to install moment, and other components should be working correctly |
266424c
to
2834b98
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, will merge in a bit. @sonhanguyen looks like we need a rebase; sorry.
Rebased for release. |
Description
moment
jsMotivation and Background Context
react-datepicker
) and "main" that has everything. The splitting was done mainly becausereact-datepicker
hasmoment
js bundled which we don't use but Symphony does, andmoment
's size is considerable.direct-web
however has not switched to only importcore
, somoment
code is duplicated anyway.Does this PR introduce a breaking change?
for SYMPHONY in case they don't already have
moment
as a dependency, If they do this saves them 240K as wellHow Has This Been Tested?
Screenshots (if appropriate):
Check-list: