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

Get rid of private members from MiddlewareStack class #1377

Closed
AllanZhengYP opened this issue Jul 14, 2020 · 2 comments
Closed

Get rid of private members from MiddlewareStack class #1377

AllanZhengYP opened this issue Jul 14, 2020 · 2 comments
Labels
feature-request New feature or enhancement. May require GitHub community feedback. High Priority

Comments

@AllanZhengYP
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Because of the limitation of TS, 2 classes with the same signature but with private member variables are not assignable. In V3 SDK the situation happens a lot. For example, when users import client-s3@1.0.0 that depends on middleware-stack@1.0.0, and s3-request-presigner@1.0.0 that depends on middleware-stack@2.0.0, they import difference version of dependency middleware-stack. Then NPM will install to difference MiddlewareStack class. Because they both contain private members, middleware instantiated from each class are not assignable.

This will be a problem whenever 2 middleware stack need to interact, like merging. So user will see TS errors when presign an S3 request with incompatible S3 client and S3 presigner version. See #1365

Describe the solution you'd like
Get rid of private variables/methods by:

  1. make them public
  2. convert the class implementation of MiddlewareStack to be pure functional.
@AllanZhengYP AllanZhengYP added feature-request New feature or enhancement. May require GitHub community feedback. High Priority labels Jul 14, 2020
@trivikr
Copy link
Member

trivikr commented Aug 25, 2020

Fixed in #1398
Released in v1.0.0-gamma.6

@trivikr trivikr closed this as completed Aug 25, 2020
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request New feature or enhancement. May require GitHub community feedback. High Priority
Projects
None yet
Development

No branches or pull requests

2 participants