-
Notifications
You must be signed in to change notification settings - Fork 488
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: introduce ClassToInterface, infer interfaces from impl #1842
SDK client interfaces were 1:1 with implementation, so let's just create interfaces from the implementation rather than keep track of two separate files. - Does not affect anything outside the shared/clients/ directory: the interfaces still exist, we just don't need to change them separately anymore. Bonus: now you can go straight to the implementation via "Go to definition". - Introduced the `tsUtils:ClassToInterface` type. Because the result now exactly matches the class, this discovered minor differences in the tests, such as marking types unioned with undefined which is not the same as an optional type. Potential followup work: The opaque client wrappers still exist of course, but now making changes should now be slightly less obnoxious. It may be worth just setting the base prototypes of the default clients to pass-through to the wrapped SDK client. Interfaces can just be created from types to mix-in the wrapped functions. So the wrapped clients can still live separately, but callers can access the underlying client in an intuitive way. In other words, the caller would not know that the client is wrapped. Also, we have no tests for our client wrappers other than S3 and ECS. We should look towards creating those before further changes. At least for the functions that aren't just transforming the calls to promises (this could just be made default by the prototype until we move to v3)
- Loading branch information
1 parent
461c3bd
commit 9dbb898
Showing
47 changed files
with
1,506 additions
and
1,870 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,5 @@ CHANGELOG.md | |
src/shared/telemetry/service-2.json | ||
.changes | ||
media/libs/vue.min.js | ||
docs/** | ||
src/testFixtures/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.