-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(v8/serverless): Remove deprecated exports #10540
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
8ac0c47
to
86f1812
Compare
packages/serverless/src/index.ts
Outdated
const AWSLambda = { | ||
init: awsLambdaInit, | ||
wrapHandler, | ||
tryPatchHandler, | ||
}; | ||
|
||
const GCPFunction = { | ||
init: gcpFunctionInit, | ||
}; |
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.
This may inhibit tree shaking.
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.
Yeah this is fine, I'm trying to map to old behaviour as much as possible.
|
||
// eslint-disable-next-line deprecation/deprecation | ||
export type GoogleCloudHttp = typeof GoogleCloudHttp; | ||
export const googleCloudHttpIntegration = defineIntegration(_googleCloudHttpIntegration); |
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.
l: I guess we could inline the integration here now? Same for the others.
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.
The main reason to keep this separated (initially) is that I though we may want to export the "unwrapped" version for tests, where we could then use the type safe form - but this is a nice to have, no strong feelings on this!
@@ -27,8 +26,6 @@ import { awsServicesIntegration } from './awsservices'; | |||
import { DEBUG_BUILD } from './debug-build'; | |||
import { markEventUnhandled } from './utils'; | |||
|
|||
export * from '@sentry/node'; |
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.
Should we include this in the migration docs somehow? 🤔
packages/serverless/src/index.ts
Outdated
const GCPFunction = { | ||
init: gcpFunctionInit, | ||
}; | ||
|
||
export { AWSLambda, GCPFunction }; |
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.
Can we just remove this and do export const GCPFunction = ...
etc instead?
86f1812
to
546691e
Compare
Drafting this for now. I opened up #10561 as a PR built on top of this one, that shows the idealized state I was going for. Any comments on that greatly appreciated. |
ref #10100
This removes all deprecated exports from the serverless package.
it also removes the namespace exports used (for ex.
import * as AWSLambda from './awslambda';
) because that causes esm issues. These are replaced with plain object exports.Once we start looking more actively at the new esm structure, we could use subpath exports for these (
export { init } from "@sentry/serverless/awslambda"
)