From e34d64f005218df713ee669318f5d624fe133e43 Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Date: Mon, 16 Jan 2023 14:27:59 +0100 Subject: [PATCH 1/6] meta: CHANGELOG for 7.31.0 --- CHANGELOG.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c1cda541031..d7068ed8a24a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,29 @@ - "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott +## 7.31.0 + +- feat(nextjs): Add Edge Runtime SDK (#6752) +- feat(nextjs): Add optional options argument to `withSentryConfig` as an alternative to the `sentry` property (#6721) +- feat(nextjs): Add edge route and middleware wrappers (#6771) +- feat(nextjs): Auto-wrap edge-routes and middleware (#6746) +- feat(replay): Change `addEvent` to be async (#6695) +- feat(replay): Update rrweb & rrweb-snapshot (#6749) +- feat(replay): Stop recording when retry fails (#6765) +- feat(replay): Stop without retry when receiving bad API response (#6773) +- feat(types): Add Trace Context type (#6714) +- fix(nextjs): Make Next.js types isomorphic (#6707) +- fix(node): Handle node build without inspector in LocalVariables integration (#6780) +- fix(otel): Set trace context via Otel Span instead of Sentry span (#6724) +- fix(otel): Prevent baggage from being overwritten (#6709) +- fix(otel): Make sure we handle when sentry-trace is an empty array (#6781) +- fix(remix): Make remix SDK type exports isomorphic (#6715) +- fix(replay): Fix `checkoutEveryNms` (#6722) +- fix(replay): Fix incorrect uncompressed recording size due to encoding (#6740) +- fix(tracing): Attach request instrumentation span to active span instead of current transaction (#6778) +- ref: Replace string.substr with string.slice (#6760) +- ref(nextjs): Deprecate `isBuild()` and `IS_BUILD` (#6727) + ## 7.30.0 - feat(core): Add `addIntegration` method to client (#6651) From 901165b02d54662c913851ec0ef62ddc297700c9 Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Date: Mon, 16 Jan 2023 14:47:09 +0100 Subject: [PATCH 2/6] Apply suggestions from code review Co-authored-by: Francesco Novy --- CHANGELOG.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d7068ed8a24a..a0f71d6b6fec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,6 @@ - feat(nextjs): Add optional options argument to `withSentryConfig` as an alternative to the `sentry` property (#6721) - feat(nextjs): Add edge route and middleware wrappers (#6771) - feat(nextjs): Auto-wrap edge-routes and middleware (#6746) -- feat(replay): Change `addEvent` to be async (#6695) - feat(replay): Update rrweb & rrweb-snapshot (#6749) - feat(replay): Stop recording when retry fails (#6765) - feat(replay): Stop without retry when receiving bad API response (#6773) @@ -24,7 +23,6 @@ - fix(replay): Fix `checkoutEveryNms` (#6722) - fix(replay): Fix incorrect uncompressed recording size due to encoding (#6740) - fix(tracing): Attach request instrumentation span to active span instead of current transaction (#6778) -- ref: Replace string.substr with string.slice (#6760) - ref(nextjs): Deprecate `isBuild()` and `IS_BUILD` (#6727) ## 7.30.0 From 42236c7c5dea74582b665c0667e589d005b9e142 Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Date: Mon, 16 Jan 2023 14:48:04 +0100 Subject: [PATCH 3/6] Add reference to #6790 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a0f71d6b6fec..402f61fb8fba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - feat(nextjs): Add optional options argument to `withSentryConfig` as an alternative to the `sentry` property (#6721) - feat(nextjs): Add edge route and middleware wrappers (#6771) - feat(nextjs): Auto-wrap edge-routes and middleware (#6746) +- fix(nextjs): Export isomorphic data fetching wrappers from client SDK (#6790) - feat(replay): Update rrweb & rrweb-snapshot (#6749) - feat(replay): Stop recording when retry fails (#6765) - feat(replay): Stop without retry when receiving bad API response (#6773) From a5140628a586cb0a6f8ff0a5d23a4a5dc5852f85 Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Date: Mon, 16 Jan 2023 14:56:20 +0100 Subject: [PATCH 4/6] alpha it --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 402f61fb8fba..0d81e3e47708 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,11 +10,11 @@ - feat(nextjs): Add optional options argument to `withSentryConfig` as an alternative to the `sentry` property (#6721) - feat(nextjs): Add edge route and middleware wrappers (#6771) - feat(nextjs): Auto-wrap edge-routes and middleware (#6746) -- fix(nextjs): Export isomorphic data fetching wrappers from client SDK (#6790) - feat(replay): Update rrweb & rrweb-snapshot (#6749) - feat(replay): Stop recording when retry fails (#6765) - feat(replay): Stop without retry when receiving bad API response (#6773) - feat(types): Add Trace Context type (#6714) +- fix(nextjs): Export isomorphic data fetching wrappers from client SDK (#6790) - fix(nextjs): Make Next.js types isomorphic (#6707) - fix(node): Handle node build without inspector in LocalVariables integration (#6780) - fix(otel): Set trace context via Otel Span instead of Sentry span (#6724) From 9ec1acdcedd79bb290663d8ad096e8ff0e146592 Mon Sep 17 00:00:00 2001 From: Luca Forstner Date: Mon, 16 Jan 2023 14:06:34 +0000 Subject: [PATCH 5/6] Add sections about Next.js SDK --- CHANGELOG.md | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d81e3e47708..6dbb536ae159 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,58 @@ ## 7.31.0 +### Next.js SDK Updates + +This update introduces changes in the Next.js SDK that are worth mentioning. + +#### Next.js middleware and Edge API route support + +The Next.js SDK now supports error and performance monitoring for Next.js [middleware](https://nextjs.org/docs/advanced-features/middleware) and [Edge API routes](https://nextjs.org/docs/api-routes/edge-api-routes). +To set it up, add a `sentry.edge.config.js` or `sentry.edge.config.ts` file to the root of your project and initialize the SDK: + +```js +// sentry.edge.config.js or sentry.edge.config.ts + +import * as Sentry from "@sentry/nextjs"; + +const SENTRY_DSN = process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN; + +Sentry.init({ + dsn: SENTRY_DSN || "YOUR DSN HERE", + tracesSampleRate: 1.0, +}); +``` + +The Next.js will automatically instrument Edge API routes and middleware. +If you want to opt out of automatic instrumentation of middleware can use the `autoInstrumentMiddleware` option in the `sentry` object of your Next.js configuration: + +```javascript +const moduleExports = { + sentry: { + autoInstrumentMiddleware: false, + }, +}; +``` + +Middleware can be manually instrumented by using the `wrapMiddlewareWithSentry` function. + +#### Renaming of Next.js wrapper methods + +We updated the names of the functions to wrap data fetchers and API routes to better reflect what they are doing. +The old methods can still be used but are deprecated and will be removed in the next major update of the SDK. + +Following function names were updated: + +- `withSentryAPI` was renamed to `wrapApiHandlerWithSentry` +- `withSentryGetServerSideProps` was renamed to `wrapGetServerSidePropsWithSentry` +- `withSentryGetStaticProps` was renamed to `wrapGetStaticPropsWithSentry` +- `withSentryServerSideGetInitialProps` was renamed to `wrapGetInitialPropsWithSentry` +- `withSentryServerSideAppGetInitialProps` was renamed to `wrapAppGetInitialPropsWithSentry` +- `withSentryServerSideDocumentGetInitialProps` was renamed to `wrapDocumentGetInitialPropsWithSentry` +- `withSentryServerSideErrorGetInitialProps` was renamed to `wrapErrorGetInitialPropsWithSentry` + +### Complete list of changes: + - feat(nextjs): Add Edge Runtime SDK (#6752) - feat(nextjs): Add optional options argument to `withSentryConfig` as an alternative to the `sentry` property (#6721) - feat(nextjs): Add edge route and middleware wrappers (#6771) From 28c098279d372b43f7a2351d9fd16c71b9f00545 Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Date: Mon, 16 Jan 2023 15:10:56 +0100 Subject: [PATCH 6/6] add nextjs renaming to migration docs --- CHANGELOG.md | 23 ----------------------- MIGRATION.md | 27 +++++++++++++++++++++------ 2 files changed, 21 insertions(+), 29 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6dbb536ae159..8eeb13ff75dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,12 +6,6 @@ ## 7.31.0 -### Next.js SDK Updates - -This update introduces changes in the Next.js SDK that are worth mentioning. - -#### Next.js middleware and Edge API route support - The Next.js SDK now supports error and performance monitoring for Next.js [middleware](https://nextjs.org/docs/advanced-features/middleware) and [Edge API routes](https://nextjs.org/docs/api-routes/edge-api-routes). To set it up, add a `sentry.edge.config.js` or `sentry.edge.config.ts` file to the root of your project and initialize the SDK: @@ -41,23 +35,6 @@ const moduleExports = { Middleware can be manually instrumented by using the `wrapMiddlewareWithSentry` function. -#### Renaming of Next.js wrapper methods - -We updated the names of the functions to wrap data fetchers and API routes to better reflect what they are doing. -The old methods can still be used but are deprecated and will be removed in the next major update of the SDK. - -Following function names were updated: - -- `withSentryAPI` was renamed to `wrapApiHandlerWithSentry` -- `withSentryGetServerSideProps` was renamed to `wrapGetServerSidePropsWithSentry` -- `withSentryGetStaticProps` was renamed to `wrapGetStaticPropsWithSentry` -- `withSentryServerSideGetInitialProps` was renamed to `wrapGetInitialPropsWithSentry` -- `withSentryServerSideAppGetInitialProps` was renamed to `wrapAppGetInitialPropsWithSentry` -- `withSentryServerSideDocumentGetInitialProps` was renamed to `wrapDocumentGetInitialPropsWithSentry` -- `withSentryServerSideErrorGetInitialProps` was renamed to `wrapErrorGetInitialPropsWithSentry` - -### Complete list of changes: - - feat(nextjs): Add Edge Runtime SDK (#6752) - feat(nextjs): Add optional options argument to `withSentryConfig` as an alternative to the `sentry` property (#6721) - feat(nextjs): Add edge route and middleware wrappers (#6771) diff --git a/MIGRATION.md b/MIGRATION.md index a0409f465f24..9aeca9e1d3d8 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -1,18 +1,33 @@ - # Deprecations in 7.x +# Deprecations in 7.x - ## Deprecated `tracingOrigins` (since 7.19.0) - #6176 +## Renaming of Next.js wrapper methods (since 7.31.0) - #6790 - The `tracingOrigins` option is deprecated in favor of using `shouldCreateSpanForRequest` and `tracePropagationTargets`. +We updated the names of the functions to wrap data fetchers and API routes to better reflect what they are doing. +The old methods can still be used but are deprecated and will be removed in the next major update of the SDK. - ## Deprecate `componentTrackingPreprocessor` in Svelte SDK (since 7.16.0) - #5936 +Following function names were updated: - This release adds the `withSentryConfig` feature to the Svelte SDK. It replaces the now deprecated Svelte `componentTrackingPreprocessor` which will be removed in the next major release. +- `withSentryAPI` was renamed to `wrapApiHandlerWithSentry` +- `withSentryGetServerSideProps` was renamed to `wrapGetServerSidePropsWithSentry` +- `withSentryGetStaticProps` was renamed to `wrapGetStaticPropsWithSentry` +- `withSentryServerSideGetInitialProps` was renamed to `wrapGetInitialPropsWithSentry` +- `withSentryServerSideAppGetInitialProps` was renamed to `wrapAppGetInitialPropsWithSentry` +- `withSentryServerSideDocumentGetInitialProps` was renamed to `wrapDocumentGetInitialPropsWithSentry` +- `withSentryServerSideErrorGetInitialProps` was renamed to `wrapErrorGetInitialPropsWithSentry` + +## Deprecated `tracingOrigins` (since 7.19.0) - #6176 + +The `tracingOrigins` option is deprecated in favor of using `shouldCreateSpanForRequest` and `tracePropagationTargets`. + +## Deprecate `componentTrackingPreprocessor` in Svelte SDK (since 7.16.0) - #5936 + +This release adds the `withSentryConfig` feature to the Svelte SDK. It replaces the now deprecated Svelte `componentTrackingPreprocessor` which will be removed in the next major release. ## Deprecate `getGlobalObject` in `@sentry/utils` (since 7.16.0) - #5949 This is no longer used. - ## Deprecate @sentry/hub (since 7.15.0) - #5823 +## Deprecate @sentry/hub (since 7.15.0) - #5823 This release deprecates `@sentry/hub` and all of it's exports. All of the `@sentry/hub` exports have moved to `@sentry/core`. `@sentry/hub` will be removed in the next major release.