-
Notifications
You must be signed in to change notification settings - Fork 70
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
Remove redundant dependencies #1830
Conversation
defaultsDeep includes the lodash.defaultsdeep file what weight 51kb we can use just Object.assign here
- remove loadah.defaultsdeep library - remove object.assign and use spread instread
🦋 Changeset detectedLatest commit: ac0ac58 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codecov Report
@@ Coverage Diff @@
## master #1830 +/- ##
==========================================
- Coverage 94.66% 94.64% -0.02%
==========================================
Files 145 145
Lines 4908 4912 +4
Branches 1334 1338 +4
==========================================
+ Hits 4646 4649 +3
- Misses 259 260 +1
Partials 3 3
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
packages/sdk-auth/src/auth.js
Outdated
// _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } }) // { a: { b: 2, c: 3 } } | ||
// Object.assign({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } }) // { a: { b: 1, c: 3 } } | ||
|
||
// handle scopes array - Object.assign would merge arrays together |
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.
I think this is actually not really good if a missing dependency would change the behavior here. I would take a look what's the size of the config and do the merge straightforward in a function without the need of any dependency. Or directly use Object.assign
packages/sdk-auth/package.json
Outdated
@@ -36,7 +36,7 @@ | |||
}, | |||
"dependencies": { | |||
"@commercetools/sdk-middleware-http": "^7.0.0", | |||
"lodash.defaultsdeep": "^4.6.0", | |||
"lodash.defaultsdeep": "^4.6.1", |
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.
is this dependency still needed after the change to Object.assign?
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.
Just removed it 🙂
Add changeset
Summary
Remove redundant dependencies
Description
Remove
lodash.defaultsdeep
from dependency treeTodo
Type
label for the PRThanks to @studentIvan for the suggestions and recommended performance optimization here