-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Adds lodash as an explicit dependency. #6131
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
Conversation
Using Yarn2, I get the following (valid) error: ``` Module not found: @aws-amplify/analytics tried to access lodash, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound. ``` You can see imports from `lodash` in both of these files: * https://github.com/aws-amplify/amplify-js/blob/e85640a4e18fa1d55411038fee58919ad73121fa/packages/analytics/src/Providers/AmazonPersonalizeHelper/SessionInfoManager.ts * https://github.com/aws-amplify/amplify-js/blob/e85640a4e18fa1d55411038fee58919ad73121fa/packages/analytics/src/Providers/AmazonPersonalizeProvider.ts
Codecov Report
@@ Coverage Diff @@
## main #6131 +/- ##
=======================================
Coverage 73.29% 73.30%
=======================================
Files 208 208
Lines 12925 12928 +3
Branches 2433 2526 +93
=======================================
+ Hits 9474 9477 +3
+ Misses 3288 3260 -28
- Partials 163 191 +28
Continue to review full report at Codecov.
|
|
@CharlesStover thanks for the PR! After talking with @iartemiev offline, what do you think about adding these 3 functions that are being used directly as dependencies instead of the entire library? For example:
|
|
I think minimal implementations of |
| import isEmpty from 'lodash/isEmpty'; | ||
| import isEqual from 'lodash/isEqual'; | ||
| import { v1 as uuid } from 'uuid'; | ||
| import { StorageHelper, ConsoleLogger as Logger, JS } from '@aws-amplify/core'; |
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.
Do we want to remove the StorageHelper here?
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.
It wasn't being used (along with RequestParams) so I just removed them.
sammartinez
left a comment
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 🌮
|
This pull request fixes 2 alerts when merging 55a382a into 9056785 - view on LGTM.com fixed alerts:
|
amhinson
left a comment
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.
Thanks again @CharlesStover! 👍
* Adds lodash as an explicit dependency. * update lodash imports Co-authored-by: Alex Hinson <[email protected]>
* Adds lodash as an explicit dependency. * update lodash imports Co-authored-by: Alex Hinson <[email protected]>
|
This pull request has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs. Looking for a help forum? We recommend joining the Amplify Community Discord server |
Using Yarn2, I get the following (valid) error:
You can see imports from
lodashin both of these files:By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.