feat(v8/serverless): Remove deprecated exports#10540
feat(v8/serverless): Remove deprecated exports#10540AbhiPrasad wants to merge 3 commits intodevelopfrom
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.
This may inhibit tree shaking.
There was a problem hiding this comment.
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.
l: I guess we could inline the integration here now? Same for the others.
There was a problem hiding this comment.
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!
| import { DEBUG_BUILD } from './debug-build'; | ||
| import { markEventUnhandled } from './utils'; | ||
|
|
||
| export * from '@sentry/node'; |
There was a problem hiding this comment.
Should we include this in the migration docs somehow? 🤔
packages/serverless/src/index.ts
Outdated
| init: gcpFunctionInit, | ||
| }; | ||
|
|
||
| export { AWSLambda, GCPFunction }; |
There was a problem hiding this comment.
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")