Reduced dependencies and copied signer from aws-amplify #35
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue #, if available:
Fixes #29
Description of changes:
The purpose of this change was to reduce the size of our dependencies. In #29 it was uncovered that our total dependency size was ~280MB. A lot of this came from
@aws-amplify/core
, which we were using for our sigv4 signing.Prior to this change, our dependencies were:
I updated these to the latest versions, and there had been a lot of dependency trimming, but there was a major API breakage in
@aws-amplify/core
. They no longer export theSigner
, and are intending to deprecate it in favor of another internal signing library (that theSigner
currently calls internally), which is also not exported:https://github.com/aws-amplify/amplify-js/blob/main/packages/core/src/clients/middleware/signing/signer/signatureV4
So, I have copied over the
Signer
class and left a long comment detailing this move.This changes our dependencies to:
Installing these dependencies in an empty repo results in only 19MB!
Testing:
Updated the unit tests to test the output of the signer. Ran unit tests and all pass.
Also ran
npm run build
and used the output in a simple local test app with both API key and cognito and verified a map is loaded properly.