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

feat/types/remove-aws-xray-sdk-deps #749

Merged
merged 1 commit into from
Dec 20, 2021
Merged

feat/types/remove-aws-xray-sdk-deps #749

merged 1 commit into from
Dec 20, 2021

Conversation

J4YF7O
Copy link

@J4YF7O J4YF7O commented Nov 15, 2021

What does this implement/fix? Explain your changes.

In several plugin definitions aws-xray-sdk was used. The problem is that we need to be able to continue using those plugins without being dependent on aws-xray-sdk.

In this PR I propose to remove this dependency, and to use the Options interface defined in utils to define the interfaces of each dependent plugins.
This allows a simpler management of types, in case of update of aws-xray-sdk (or other changes), we will have only one element to modify. The type of awsClientCapture in utils.Options (or other attribute types...)

There are some plugins that use only some attributes of the "Options" interface, for this case I use the typescript utility type : Pick

Does this close any currently open issues?

Typescript comment related

Where has this been tested?

  • npm run test ✔️

In several plugin definitions `aws-xray-sdk` was used. The problem is that we need to be able to continue using those plugins without being dependent on `aws-xray-sdk`.

In this PR I propose to remove this dependency, and to use the `Options` interface defined in `utils` to define the interfaces of each dependent plugins.
This allows a simpler management of types, in case of update of `aws-xray-sdk`, we will have only one element to modify. The type of `awsClientCapture` in `utils.Options`.

There are some plugins that use only one part of the attributes of the "Option" interface, for this case I use the typescript utility type : [`Pick`](https://www.typescriptlang.org/docs/handbook/utility-types.html#picktype-keys)
@willfarrell
Copy link
Member

Can someone else that uses TypeScript give this a review before I merge?

@J4YF7O
Copy link
Author

J4YF7O commented Dec 7, 2021

May I raise?

@willfarrell willfarrell merged commit 3151886 into middyjs:main Dec 20, 2021
@J4YF7O J4YF7O deleted the feat/types/remove-aws-xray-sdk-deps branch March 6, 2022 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants