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

fix: correct aws request/response wrapper types #37

Merged
merged 1 commit into from
Jul 14, 2024

Conversation

simonmcallister0210
Copy link
Owner

Context

Noticed the AWS request and response types were coming through as unknown on the latest version of the package. This is down to us not including the AWS SDK in our dependencies, they're only in devDependencies. The type we define doesn't have access to it's dependent types in prod

A solution would be to include the AWS SDK libs in dependencies, but then consumers would have to download these monster dependencies. @aws-sdk/client-cognito-identity-provider isn't too bad at 2.38 MB, but aws-sdk is 97.2MB ! Users would also have to see the annoying v2 SDK deprecation warning every time they use this library

Another solution is to only include @aws-sdk/client-cognito-identity-provider in dependencies. After investigating the differences between the request and response types in SDK v2 and v3 I found that they're 99% the same. There's only a couple of small difference which I've documented in the code. This way we can move @aws-sdk/client-cognito-identity-provider into dependencies and give consumers proper access to our "wrapper" types

Changes

  • Remove unnecessary AWS SDK v2 type imports in src/types.ts
  • Streamline the custom request and response types
  • Move @aws-sdk/client-cognito-identity-provider from devDependencies to dependencies

Testing

Before
Screenshot 2024-07-14 at 02 56 25

After
Screenshot 2024-07-14 at 02 57 24

@simonmcallister0210 simonmcallister0210 merged commit 1cd208e into main Jul 14, 2024
2 checks passed
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

Successfully merging this pull request may close these issues.

1 participant