Skip to content

Commit a566681

Browse files
authored
Merge pull request #14136 from getsentry/prepare-release/8.36.0
meta(changelog): Update changelog for 8.36.0
2 parents a9cedf9 + 09c8577 commit a566681

File tree

13 files changed

+119
-211
lines changed

13 files changed

+119
-211
lines changed

CHANGELOG.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,6 @@
1414

1515
### Important Changes
1616

17-
- **feat(nuxt): Add Sentry Pinia plugin ([#14047](https://github.com/getsentry/sentry-javascript/pull/14047))**
18-
19-
The Nuxt SDK now allows you to track Pinia state for captured errors. To enable the Pinia plugin, set the `trackPinia` option to `true` in your client config:
20-
21-
```ts
22-
// sentry.client.config.ts
23-
24-
Sentry.init({
25-
trackPinia: true,
26-
});
27-
```
28-
29-
Read more about the Pinia plugin in the [Sentry Pinia Documentation](https://docs.sentry.io/platforms/javascript/guides/nuxt/features/pinia/).
30-
3117
- **feat(nextjs/vercel-edge/cloudflare): Switch to OTEL for performance monitoring ([#13889](https://github.com/getsentry/sentry-javascript/pull/13889))**
3218

3319
With this release, the Sentry Next.js, and Cloudflare SDKs will now capture performance data based on OpenTelemetry.

dev-packages/e2e-tests/test-applications/nuxt-4/app/pages/pinia-cart.vue

Lines changed: 0 additions & 73 deletions
This file was deleted.

dev-packages/e2e-tests/test-applications/nuxt-4/nuxt.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default defineNuxtConfig({
44
compatibilityDate: '2024-04-03',
55
imports: { autoImport: false },
66

7-
modules: ['@pinia/nuxt', '@sentry/nuxt/module'],
7+
modules: ['@sentry/nuxt/module'],
88

99
runtimeConfig: {
1010
public: {

dev-packages/e2e-tests/test-applications/nuxt-4/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
"test:assert": "pnpm test"
1515
},
1616
"dependencies": {
17-
"@pinia/nuxt": "^0.5.5",
1817
"@sentry/nuxt": "latest || *",
1918
"nuxt": "^3.13.2"
2019
},

dev-packages/e2e-tests/test-applications/nuxt-4/sentry.client.config.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,4 @@ Sentry.init({
77
tunnel: `http://localhost:3031/`, // proxy server
88
tracesSampleRate: 1.0,
99
trackComponents: true,
10-
trackPinia: {
11-
actionTransformer: action => `Transformed: ${action}`,
12-
stateTransformer: state => ({
13-
transformed: true,
14-
...state,
15-
}),
16-
},
1710
});

dev-packages/e2e-tests/test-applications/nuxt-4/stores/cart.ts

Lines changed: 0 additions & 43 deletions
This file was deleted.

dev-packages/e2e-tests/test-applications/nuxt-4/tests/pinia.test.ts

Lines changed: 0 additions & 35 deletions
This file was deleted.

packages/aws-serverless/src/sdk.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,12 @@ export function tryPatchHandler(taskRoot: string, handlerPath: string): void {
168168
return;
169169
}
170170

171+
// Check for prototype pollution
172+
if (functionName === '__proto__' || functionName === 'constructor' || functionName === 'prototype') {
173+
DEBUG_BUILD && logger.error(`Invalid handler name: ${functionName}`);
174+
return;
175+
}
176+
171177
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
172178
(mod as HandlerModule)[functionName!] = wrapHandler(obj);
173179
}

packages/nuxt/src/common/types.ts

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,10 @@
11
import type { init as initNode } from '@sentry/node';
22
import type { SentryRollupPluginOptions } from '@sentry/rollup-plugin';
33
import type { SentryVitePluginOptions } from '@sentry/vite-plugin';
4-
import type { createSentryPiniaPlugin, init as initVue } from '@sentry/vue';
4+
import type { init as initVue } from '@sentry/vue';
55

66
// Omitting 'app' as the Nuxt SDK will add the app instance in the client plugin (users do not have to provide this)
7-
export type SentryNuxtClientOptions = Omit<Parameters<typeof initVue>[0] & object, 'app'> & {
8-
/**
9-
* Control if an existing Pinia store should be monitored.
10-
* Set this to `true` to track with default options or provide your custom Pinia plugin options.
11-
*
12-
* This only works if "@pinia/nuxt" is added to the `modules` array.
13-
*
14-
* @default false
15-
*/
16-
trackPinia?: true | Parameters<typeof createSentryPiniaPlugin>[0];
17-
};
18-
7+
export type SentryNuxtClientOptions = Omit<Parameters<typeof initVue>[0] & object, 'app'>;
198
export type SentryNuxtServerOptions = Omit<Parameters<typeof initNode>[0] & object, 'app'>;
209

2110
type SourceMapsOptions = {

packages/nuxt/src/runtime/plugins/sentry.client.ts

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { getClient } from '@sentry/core';
2-
import { consoleSandbox } from '@sentry/utils';
3-
import { browserTracingIntegration, createSentryPiniaPlugin, vueIntegration } from '@sentry/vue';
2+
import { browserTracingIntegration, vueIntegration } from '@sentry/vue';
43
import { defineNuxtPlugin } from 'nuxt/app';
54
import { reportNuxtError } from '../utils';
65

@@ -35,36 +34,18 @@ export default defineNuxtPlugin({
3534
name: 'sentry-client-integrations',
3635
dependsOn: ['sentry-client-config'],
3736
async setup(nuxtApp) {
38-
const sentryClient = getClient();
39-
const clientOptions = sentryClient && sentryClient.getOptions();
40-
4137
// This evaluates to true unless __SENTRY_TRACING__ is text-replaced with "false", in which case everything inside
4238
// will get tree-shaken away
4339
if (typeof __SENTRY_TRACING__ === 'undefined' || __SENTRY_TRACING__) {
40+
const sentryClient = getClient();
41+
4442
if (sentryClient && '$router' in nuxtApp) {
4543
sentryClient.addIntegration(
4644
browserTracingIntegration({ router: nuxtApp.$router as VueRouter, routeLabel: 'path' }),
4745
);
4846
}
4947
}
5048

51-
if (clientOptions && 'trackPinia' in clientOptions && clientOptions.trackPinia) {
52-
if ('$pinia' in nuxtApp) {
53-
(nuxtApp.$pinia as { use: (plugin: unknown) => void }).use(
54-
// `trackPinia` is an object with custom options or `true` (pass `undefined` to use default options)
55-
createSentryPiniaPlugin(clientOptions.trackPinia === true ? undefined : clientOptions.trackPinia),
56-
);
57-
} else {
58-
clientOptions.debug &&
59-
consoleSandbox(() => {
60-
// eslint-disable-next-line no-console
61-
console.warn(
62-
'[Sentry] You set `trackPinia`, but the Pinia module was not found. Make sure to add `"@pinia/nuxt"` to your modules array.',
63-
);
64-
});
65-
}
66-
}
67-
6849
nuxtApp.hook('app:created', vueApp => {
6950
const sentryClient = getClient();
7051

packages/replay-internal/src/integration.ts

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
import { parseSampleRate } from '@sentry/core';
2-
import type { BrowserClientReplayOptions, Client, Integration, IntegrationFn } from '@sentry/types';
2+
import type {
3+
BrowserClientReplayOptions,
4+
Client,
5+
Integration,
6+
IntegrationFn,
7+
ReplayRecordingMode,
8+
} from '@sentry/types';
39
import { consoleSandbox, dropUndefinedKeys, isBrowser } from '@sentry/utils';
410

511
import {
@@ -297,6 +303,22 @@ export class Replay implements Integration {
297303
return this._replay.getSessionId();
298304
}
299305

306+
/**
307+
* Get the current recording mode. This can be either `session` or `buffer`.
308+
*
309+
* `session`: Recording the whole session, sending it continuously
310+
* `buffer`: Always keeping the last 60s of recording, requires:
311+
* - having replaysOnErrorSampleRate > 0 to capture replay when an error occurs
312+
* - or calling `flush()` to send the replay
313+
*/
314+
public getRecordingMode(): ReplayRecordingMode | undefined {
315+
if (!this._replay || !this._replay.isEnabled()) {
316+
return;
317+
}
318+
319+
return this._replay.recordingMode;
320+
}
321+
300322
/**
301323
* Initializes replay.
302324
*/

packages/replay-internal/src/replay.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export class ReplayContainer implements ReplayContainerInterface {
7474
public clickDetector: ClickDetector | undefined;
7575

7676
/**
77-
* Recording can happen in one of three modes:
77+
* Recording can happen in one of two modes:
7878
* - session: Record the whole session, sending it continuously
7979
* - buffer: Always keep the last 60s of recording, requires:
8080
* - having replaysOnErrorSampleRate > 0 to capture replay when an error occurs

0 commit comments

Comments
 (0)