-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
ref(serverless): Convert integrations to functional approach #10329
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
Conversation
size-limit report 📦
|
export const AWSServices = convertIntegrationFnToClass( | ||
INTEGRATION_NAME, | ||
awsServicesIntegration, | ||
) as IntegrationClass<Integration>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's also add:
export type AWSServices = typeof AWSServices;
right away here (same for the gcp stuff)!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we have to also export the type from the index?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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...)
6f3cde4
to
6b2a174
Compare
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.