Skip to content

Commit 9567fe4

Browse files
authored
Merge branch 'develop' into upgrade-vite-vitest
2 parents 1adae56 + a5de993 commit 9567fe4

File tree

35 files changed

+1144
-633
lines changed

35 files changed

+1144
-633
lines changed

.craft.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ targets:
141141
# TODO(v9): Once stable, re-add this target to publish the AWS Lambda layer
142142
# - name: aws-lambda-layer
143143
# includeNames: /^sentry-node-serverless-\d+.\d+.\d+(-(beta|alpha|rc)\.\d+)?\.zip$/
144-
# layerName: SentryNodeServerlessSDK
144+
# layerName: SentryNodeServerlessSDKv9
145145
# compatibleRuntimes:
146146
# - name: node
147147
# versions:

docs/migration/v8-to-v9.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,16 @@ In v9, an `undefined` value will be treated the same as if the value is not defi
8282

8383
- The `getCurrentHub().getIntegration(IntegrationClass)` method will always return `null` in v9. This has already stopped working mostly in v8, because we stopped exposing integration classes. In v9, the fallback behavior has been removed. Note that this does not change the type signature and is thus not technically breaking, but still worth pointing out.
8484

85+
- The `startSpan` behavior was slightly changed if you pass a custom `scope` to the span start options: While in v8, the passed scope was set active directly on the passed scope, in v9, the scope is cloned. This behavior change does not apply to `@sentry/node` where the scope was already cloned. This change was made to ensure that the span only remains active within the callback and to align behavior between `@sentry/node` and all other SDKs. As a result of the change, your span hierarchy should be more accurate. However, be aware that modifying the scope (e.g. set tags) within the `startSpan` callback behaves a bit differently now.
86+
87+
```js
88+
startSpan({ name: 'example', scope: customScope }, () => {
89+
getCurrentScope().setTag('tag-a', 'a'); // this tag will only remain within the callback
90+
// set the tag directly on customScope in addition, if you want to to persist the tag outside of the callback
91+
customScope.setTag('tag-a', 'a');
92+
});
93+
```
94+
8595
### `@sentry/node`
8696

8797
- When `skipOpenTelemetrySetup: true` is configured, `httpIntegration({ spans: false })` will be configured by default. This means that you no longer have to specify this yourself in this scenario. With this change, no spans are emitted once `skipOpenTelemetrySetup: true` is configured, without any further configuration being needed.
@@ -104,7 +114,7 @@ In v9, an `undefined` value will be treated the same as if the value is not defi
104114

105115
- By default, source maps will now be automatically deleted after being uploaded to Sentry for client-side builds. You can opt out of this behavior by explicitly setting `sourcemaps.deleteSourcemapsAfterUpload` to `false` in your Sentry config.
106116

107-
### All Meta-Framework SDKs (`@sentry/astro`, `@sentry/nuxt`)
117+
### All Meta-Framework SDKs (`@sentry/astro`, `@sentry/nuxt`, `@sentry/solidstart`)
108118

109119
- Updated source map generation to respect the user-provided value of your build config, such as `vite.build.sourcemap`:
110120

@@ -173,8 +183,9 @@ Sentry.init({
173183
- The `getDomElement` method has been removed. There is no replacement.
174184
- The `memoBuilder` method has been removed. There is no replacement.
175185
- The `extractRequestData` method has been removed. Manually extract relevant data off request instead.
176-
- The `addRequestDataToEvent` method has been removed. Use `addNormalizedRequestDataToEvent` instead.
186+
- The `addRequestDataToEvent` method has been removed. Use `httpRequestToRequestData` instead and put the resulting object directly on `event.request`.
177187
- The `extractPathForTransaction` method has been removed. There is no replacement.
188+
- The `addNormalizedRequestDataToEvent` method has been removed. Use `httpRequestToRequestData` instead and put the resulting object directly on `event.request`.
178189

179190
#### Other/Internal Changes
180191

@@ -252,8 +263,10 @@ Since v9, the types have been merged into `@sentry/core`, which removed some of
252263
- The `Request` type has been removed. Use `RequestEventData` type instead.
253264
- The `IntegrationClass` type is no longer exported - it was not used anymore. Instead, use `Integration` or `IntegrationFn`.
254265
- The `samplingContext.request` attribute in the `tracesSampler` has been removed. Use `samplingContext.normalizedRequest` instead. Note that the type of `normalizedRequest` differs from `request`.
266+
- The `samplingContext.transactionContext` object in the `tracesSampler` has been removed. All object attributes are available in the top-level of `samplingContext`.
255267
- `Client` now always expects the `BaseClient` class - there is no more abstract `Client` that can be implemented! Any `Client` class has to extend from `BaseClient`.
256268
- `ReportDialogOptions` now extends `Record<string, unknown>` instead of `Record<string, any>` - this should not affect most users.
269+
- The `RequestDataIntegrationOptions` type has been removed. There is no replacement.
257270

258271
# No Version Support Timeline
259272

@@ -307,7 +320,7 @@ The Sentry metrics beta has ended and the metrics API has been removed from the
307320
- Deprecated `TransactionNamingScheme` type.
308321
- Deprecated `validSeverityLevels`. Will not be replaced.
309322
- Deprecated `urlEncode`. No replacements.
310-
- Deprecated `addRequestDataToEvent`. Use `addNormalizedRequestDataToEvent` instead.
323+
- Deprecated `addRequestDataToEvent`. Use `httpRequestToRequestData` instead and put the resulting object directly on `event.request`.
311324
- Deprecated `extractRequestData`. Instead manually extract relevant data off request.
312325
- Deprecated `arrayify`. No replacements.
313326
- Deprecated `memoBuilder`. No replacements.

packages/astro/src/integration/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export const sentryAstro = (options: SentryOptions = {}): AstroIntegration => {
4949
consoleSandbox(() => {
5050
// eslint-disable-next-line no-console
5151
console.log(
52-
`[Sentry] Setting \`sourceMapsUploadOptions.filesToDeleteAfterUpload: ${JSON.stringify(
52+
`[Sentry] Automatically setting \`sourceMapsUploadOptions.filesToDeleteAfterUpload: ${JSON.stringify(
5353
updatedFilesToDeleteAfterUpload,
5454
)}\` to delete generated source maps after they were uploaded to Sentry.`,
5555
);
@@ -226,7 +226,7 @@ export function getUpdatedSourceMapSettings(
226226
consoleSandbox(() => {
227227
// eslint-disable-next-line no-console
228228
console.warn(
229-
`[Sentry] Source map generation are currently disabled in your Astro configuration (\`${settingKey}: false\`). This setting is either a default setting or was explicitly set in your configuration. Sentry won't override this setting. Without source maps, code snippets on the Sentry Issues page will remain minified. To show unminified code, enable source maps in \`${settingKey}\` (e.g. by setting them to \`hidden\`).`,
229+
`[Sentry] Source map generation is currently disabled in your Astro configuration (\`${settingKey}: false\`). This setting is either a default setting or was explicitly set in your configuration. Sentry won't override this setting. Without source maps, code snippets on the Sentry Issues page will remain minified. To show unminified code, enable source maps in \`${settingKey}\` (e.g. by setting them to \`hidden\`).`,
230230
);
231231
});
232232
} else if (viteSourceMap && ['hidden', 'inline', true].includes(viteSourceMap)) {

packages/astro/test/integration/index.test.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -456,9 +456,7 @@ describe('getUpdatedSourceMapSettings', () => {
456456

457457
astroConfig.vite.build.sourcemap = false;
458458
getUpdatedSourceMapSettings(astroConfig, sentryOptions);
459-
expect(consoleWarnSpy).toHaveBeenCalledWith(
460-
expect.stringContaining('Source map generation are currently disabled'),
461-
);
459+
expect(consoleWarnSpy).toHaveBeenCalledWith(expect.stringContaining('Source map generation is currently disabled'));
462460

463461
astroConfig.vite.build.sourcemap = 'hidden';
464462
getUpdatedSourceMapSettings(astroConfig, sentryOptions);

packages/bun/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ export type {
1616
Thread,
1717
User,
1818
} from '@sentry/core';
19-
export type { AddRequestDataToEventOptions } from '@sentry/core';
2019

2120
export {
2221
addEventProcessor,

packages/cloudflare/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ export type {
1616
Thread,
1717
User,
1818
} from '@sentry/core';
19-
export type { AddRequestDataToEventOptions } from '@sentry/core';
2019

2120
export type { CloudflareOptions } from './client';
2221

0 commit comments

Comments
 (0)