Skip to content

Commit 546691e

Browse files
committed
add migration note
1 parent 911b147 commit 546691e

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

MIGRATION.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,22 @@ enum. If you were using the `Severity` enum, you should replace it with the `Sev
1111
The `Offline` integration has been removed in favor of the offline transport wrapper:
1212
http://docs.sentry.io/platforms/javascript/configuration/transports/#offline-caching
1313

14+
## Updating `@sentry/serverless` exports
15+
16+
The `AWSServices`, `GoogleCloudGrpc`, and `GoogleCloudHttp`. integrations have been removed from `@sentry/serverless` package. See the [table below](#deprecate-class-based-integrations) to find what to upgrade to.
17+
18+
Using the `Sentry.AWSLambda` export has also changed. It no longer re-exports all of methods of the Node SDK, you'll have to import them directly from `@sentry/serverless`, instead it only exports `init`, `wrapHandler` and `tryPatchHandler`.
19+
20+
```js
21+
import * as Sentry from '@sentry/serverless';
22+
23+
// before
24+
Sentry.AWSLambda.captureException(...);
25+
26+
// after
27+
Sentry.captureException(...);
28+
```
29+
1430
# Deprecations in 7.x
1531

1632
You can use the **Experimental** [@sentry/migr8](https://www.npmjs.com/package/@sentry/migr8) to automatically update
@@ -210,6 +226,9 @@ The following list shows how integrations should be migrated:
210226
| `new Hapi()` | `hapiIntegration()` | `@sentry/node` |
211227
| `new Undici()` | `nativeNodeFetchIntegration()` | `@sentry/node` |
212228
| `new Http()` | `httpIntegration()` | `@sentry/node` |
229+
| `new AWSServices()` | `awsServicesIntegration()` | `@sentry/serverless` |
230+
| `new GoogleCloudGrpc()` | `googleCloudGrpcIntegration()` | `@sentry/serverless` |
231+
| `new GoogleCloudHttp()` | `googleCloudHttpIntegration()` | `@sentry/serverless` |
213232

214233
## Deprecate `hub.bindClient()` and `makeMain()`
215234

packages/serverless/src/index.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,16 @@ export { awsServicesIntegration } from './awsservices';
22
import { init as awsLambdaInit, tryPatchHandler, wrapHandler } from './awslambda';
33
import { init as gcpFunctionInit } from './gcpfunction';
44

5-
const AWSLambda = {
5+
export const AWSLambda = {
66
init: awsLambdaInit,
77
wrapHandler,
88
tryPatchHandler,
99
};
1010

11-
const GCPFunction = {
11+
export const GCPFunction = {
1212
init: gcpFunctionInit,
1313
};
1414

15-
export { AWSLambda, GCPFunction };
16-
1715
import type { WrapperOptions as AWSWrapperOptions } from './awslambda';
1816
export type { AWSWrapperOptions };
1917

0 commit comments

Comments
 (0)