ref(serverless): Convert integrations to functional approach#10329
Merged
AbhiPrasad merged 7 commits intodevelopfrom Jan 29, 2024
Merged
ref(serverless): Convert integrations to functional approach#10329AbhiPrasad merged 7 commits intodevelopfrom
AbhiPrasad merged 7 commits intodevelopfrom
Conversation
Contributor
size-limit report 📦
|
mydea
reviewed
Jan 25, 2024
| export const AWSServices = convertIntegrationFnToClass( | ||
| INTEGRATION_NAME, | ||
| awsServicesIntegration, | ||
| ) as IntegrationClass<Integration>; |
Member
There was a problem hiding this comment.
let's also add:
export type AWSServices = typeof AWSServices;right away here (same for the gcp stuff)!
Contributor
Author
There was a problem hiding this comment.
do we have to also export the type from the index?
Member
There was a problem hiding this comment.
otherwise this does not work anymore (it does not work with the stuff I migrated):
import {AWSServices} from '@sentry/serverless';
let a: AWSServices | undefined;
// instead you need to do this:
let b: typeof AWSServices | undefined;This is very unlikely to affect somebody, but for consistency we should do that (and also for all other integrations, just didn't get to it yet...)
mydea
approved these changes
Jan 25, 2024
6f3cde4 to
6b2a174
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR updates the serverless integrations to use the functional approach, and rewrites all of the serverless unit tests.
In the unit test rewrite we remove the usage of global mocks and instead do per file mocks. I dislike the amount of mocks that still exist, but to prevent any regressions I only tried to translate the test code.