Skip to content

Commit 61d18a9

Browse files
committed
Merge branch 'develop' into patch-1
2 parents 609a75e + a017048 commit 61d18a9

File tree

875 files changed

+20342
-19896
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

875 files changed

+20342
-19896
lines changed

.craft.yml

+1-10
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ targets:
55
# NPM Targets
66
## 1. Base Packages, node or browser SDKs depend on
77
## 1.1 Types
8-
# TODO(v9): Remove
98
- name: npm
109
id: '@sentry/types'
1110
includeNames: /^sentry-types-\d.*\.tgz$/
@@ -78,14 +77,6 @@ targets:
7877
- name: npm
7978
id: '@sentry/deno'
8079
includeNames: /^sentry-deno-\d.*\.tgz$/
81-
- name: commit-on-git-repository
82-
# This will publish on the Deno registry
83-
id: getsentry/deno
84-
archive: /^sentry-deno-\d.*\.tgz$/
85-
repositoryUrl: https://github.com/getsentry/sentry-deno.git
86-
stripComponents: 1
87-
branch: main
88-
createTag: true
8980

9081
## 5. Node-based Packages
9182
- name: npm
@@ -141,7 +132,7 @@ targets:
141132
# TODO(v9): Once stable, re-add this target to publish the AWS Lambda layer
142133
# - name: aws-lambda-layer
143134
# includeNames: /^sentry-node-serverless-\d+.\d+.\d+(-(beta|alpha|rc)\.\d+)?\.zip$/
144-
# layerName: SentryNodeServerlessSDK
135+
# layerName: SentryNodeServerlessSDKv9
145136
# compatibleRuntimes:
146137
# - name: node
147138
# versions:

.github/workflows/build.yml

+6-5
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,8 @@ jobs:
267267
run: yarn lint:lerna
268268
- name: Lint C++ files
269269
run: yarn lint:clang
270+
- name: Lint for ES compatibility
271+
run: yarn lint:es-compatibility
270272

271273
job_check_format:
272274
name: Check file formatting
@@ -440,7 +442,7 @@ jobs:
440442
- name: Set up Deno
441443
uses: denoland/[email protected]
442444
with:
443-
deno-version: v1.38.5
445+
deno-version: v2.1.5
444446
- name: Restore caches
445447
uses: ./.github/actions/restore-cache
446448
with:
@@ -745,7 +747,7 @@ jobs:
745747
run: yarn test
746748

747749
job_remix_integration_tests:
748-
name: Remix v${{ matrix.remix }} (Node ${{ matrix.node }}) Tests
750+
name: Remix (Node ${{ matrix.node }}) Tests
749751
needs: [job_get_metadata, job_build]
750752
if: needs.job_build.outputs.changed_remix == 'true' || github.event_name != 'pull_request'
751753
runs-on: ubuntu-20.04
@@ -754,7 +756,6 @@ jobs:
754756
fail-fast: false
755757
matrix:
756758
node: [18, 20, 22]
757-
remix: [1, 2]
758759
steps:
759760
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
760761
uses: actions/checkout@v4
@@ -777,7 +778,6 @@ jobs:
777778
- name: Run integration tests
778779
env:
779780
NODE_VERSION: ${{ matrix.node }}
780-
REMIX_VERSION: ${{ matrix.remix }}
781781
run: |
782782
cd packages/remix
783783
yarn test:integration:ci
@@ -1200,7 +1200,8 @@ jobs:
12001200
- name: Run E2E test
12011201
working-directory: dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}
12021202
timeout-minutes: 10
1203-
run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- yarn test:assert
1203+
run: |
1204+
xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- yarn test:assert
12041205
12051206
job_required_jobs_passed:
12061207
name: All required jobs passed or were skipped

CHANGELOG.md

+45-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,51 @@
1010

1111
- "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott
1212

13-
Work in this release was contributed by @aloisklink, @arturovt, @benjick and @maximepvrt. Thank you for your contributions!
13+
Work in this release was contributed by @tjhiggins, @GrizliK1988, @davidturissini, @nwalters512, @aloisklink, @arturovt, @benjick, @maximepvrt, @mstrokin, and @kunal-511. Thank you for your contributions!
14+
15+
- **feat(solidstart)!: Default to `--import` setup and add `autoInjectServerSentry` ([#14862](https://github.com/getsentry/sentry-javascript/pull/14862))**
16+
17+
To enable the SolidStart SDK, wrap your SolidStart Config with `withSentry`. The `sentrySolidStartVite` plugin is now automatically
18+
added by `withSentry` and you can pass the Sentry build-time options like this:
19+
20+
```js
21+
import { defineConfig } from '@solidjs/start/config';
22+
import { withSentry } from '@sentry/solidstart';
23+
24+
export default defineConfig(
25+
withSentry(
26+
{
27+
/* Your SolidStart config options... */
28+
},
29+
{
30+
// Options for setting up source maps
31+
org: process.env.SENTRY_ORG,
32+
project: process.env.SENTRY_PROJECT,
33+
authToken: process.env.SENTRY_AUTH_TOKEN,
34+
},
35+
),
36+
);
37+
```
38+
39+
With the `withSentry` wrapper, the Sentry server config should not be added to the `public` directory anymore.
40+
Add the Sentry server config in `src/instrument.server.ts`. Then, the server config will be placed inside the server build output as `instrument.server.mjs`.
41+
42+
Now, there are two options to set up the SDK:
43+
44+
1. **(recommended)** Provide an `--import` CLI flag to the start command like this (path depends on your server setup):
45+
`node --import ./.output/server/instrument.server.mjs .output/server/index.mjs`
46+
2. Add `autoInjectServerSentry: 'top-level-import'` and the Sentry config will be imported at the top of the server entry (comes with tracing limitations)
47+
```js
48+
withSentry(
49+
{
50+
/* Your SolidStart config options... */
51+
},
52+
{
53+
// Optional: Install Sentry with a top-level import
54+
autoInjectServerSentry: 'top-level-import',
55+
},
56+
);
57+
```
1458

1559
## 8.45.0
1660

MIGRATION.md

+18-36
Original file line numberDiff line numberDiff line change
@@ -870,53 +870,35 @@ or look at the TypeScript type definitions of `withSentryConfig`.
870870
871871
#### Updated the recommended way of calling `Sentry.init()`
872872
873-
With version 8 of the SDK we will no longer support the use of `sentry.server.config.ts` and `sentry.edge.config.ts`
874-
files. Instead, please initialize the Sentry Next.js SDK for the serverside in a
875-
[Next.js instrumentation hook](https://nextjs.org/docs/app/building-your-application/optimizing/instrumentation).
876-
**`sentry.client.config.ts|js` is still supported and encouraged for initializing the clientside SDK.**
873+
Version 8 of the Next.js SDK will require an additional `instrumentation.ts` file to execute the `sentry.server.config.js|ts` and `sentry.edge.config.js|ts` modules to initialize the SDK for the server-side.
874+
The `instrumentation.ts` file is a Next.js native API called [instrumentation hook](https://nextjs.org/docs/app/api-reference/file-conventions/instrumentation).
877875
878-
The following is an example of how to initialize the serverside SDK in a Next.js instrumentation hook:
876+
To start using the Next.js instrumentation hook, follow these steps:
879877
880-
1. First, enable the Next.js instrumentation hook by setting the `experimental.instrumentationHook` to `true` in your
881-
`next.config.js`.
882-
2. Next, create a `instrumentation.ts|js` file in the root directory of your project (or in the `src` folder if you have
883-
have one).
884-
3. Now, export a `register` function from the `instrumentation.ts|js` file and call `Sentry.init()` inside of it:
878+
1. First, enable the Next.js instrumentation hook by setting the [`experimental.instrumentationHook`](https://nextjs.org/docs/app/api-reference/next-config-js/instrumentationHook) to true in your `next.config.js`. (This step is no longer required with Next.js 15)
885879
886-
```ts
887-
import * as Sentry from '@sentry/nextjs';
888-
889-
export function register() {
890-
if (process.env.NEXT_RUNTIME === 'nodejs') {
891-
Sentry.init({
892-
dsn: 'YOUR_DSN',
893-
// Your Node.js Sentry configuration...
894-
});
895-
}
896-
897-
if (process.env.NEXT_RUNTIME === 'edge') {
898-
Sentry.init({
899-
dsn: 'YOUR_DSN',
900-
// Your Edge Runtime Sentry configuration...
901-
});
902-
}
880+
```JavaScript {filename:next.config.js} {2-4}
881+
module.exports = {
882+
experimental: {
883+
instrumentationHook: true, // Not required on Next.js 15+
884+
},
903885
}
904886
```
905887
906-
If you need to import a Node.js specific integration (like for example `@sentry/profiling-node`), you will have to
907-
import the package using a dynamic import to prevent Next.js from bundling Node.js APIs into bundles for other
908-
runtime environments (like the Browser or the Edge runtime). You can do so as follows:
888+
2. Next, create a `instrumentation.ts|js` file in the root directory of your project (or in the src folder if you have have one).
889+
890+
3. Now, export a register function from the `instrumentation.ts|js` file and import your `sentry.server.config.js|ts` and `sentry.edge.config.js|ts` modules:
909891
910-
```ts
892+
```JavaScript {filename:instrumentation.js}
911893
import * as Sentry from '@sentry/nextjs';
912894

913895
export async function register() {
914896
if (process.env.NEXT_RUNTIME === 'nodejs') {
915-
const { nodeProfilingIntegration } = await import('@sentry/profiling-node');
916-
Sentry.init({
917-
dsn: 'YOUR_DSN',
918-
integrations: [nodeProfilingIntegration()],
919-
});
897+
await import('./sentry.server.config');
898+
}
899+
900+
if (process.env.NEXT_RUNTIME === 'edge') {
901+
await import('./sentry.edge.config');
920902
}
921903
}
922904
```

dev-packages/browser-integration-tests/loader-suites/loader/noOnLoad/customOnErrorHandler/subject.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const oldOnError = window.onerror;
22

33
window.onerror = function () {
44
console.log('custom error');
5-
oldOnError && oldOnError.apply(this, arguments);
5+
oldOnError?.apply(this, arguments);
66
};
77

88
window.doSomethingWrong();

dev-packages/browser-integration-tests/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,13 @@
4646
"@sentry/browser": "8.45.0",
4747
"axios": "1.7.7",
4848
"babel-loader": "^8.2.2",
49+
"fflate": "0.8.2",
4950
"html-webpack-plugin": "^5.5.0",
50-
"pako": "^2.1.0",
5151
"webpack": "^5.95.0"
5252
},
5353
"devDependencies": {
5454
"@types/glob": "8.0.0",
5555
"@types/node": "^18.19.1",
56-
"@types/pako": "^2.0.0",
5756
"glob": "8.0.3"
5857
},
5958
"volta": {

dev-packages/browser-integration-tests/suites/feedback/attachTo/test.ts

+3
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ sentryTest('should capture feedback with custom button', async ({ getLocalTestUr
5757
event_id: expect.stringMatching(/\w{32}/),
5858
environment: 'production',
5959
tags: {},
60+
user: {
61+
ip_address: '{{auto}}',
62+
},
6063
sdk: {
6164
integrations: expect.arrayContaining(['Feedback']),
6265
version: expect.any(String),

dev-packages/browser-integration-tests/suites/feedback/captureFeedback/test.ts

+3
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ sentryTest('should capture feedback', async ({ getLocalTestUrl, page }) => {
6969
'User-Agent': expect.stringContaining(''),
7070
},
7171
},
72+
user: {
73+
ip_address: '{{auto}}',
74+
},
7275
platform: 'javascript',
7376
});
7477
});

dev-packages/browser-integration-tests/suites/feedback/captureFeedbackAndReplay/hasSampling/test.ts

+3
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ sentryTest('should capture feedback', async ({ forceFlushReplay, getLocalTestUrl
103103
'User-Agent': expect.stringContaining(''),
104104
},
105105
},
106+
user: {
107+
ip_address: '{{auto}}',
108+
},
106109
platform: 'javascript',
107110
});
108111
});

dev-packages/browser-integration-tests/suites/feedback/captureFeedbackCsp/test.ts

+3
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ sentryTest('should capture feedback', async ({ getLocalTestUrl, page }) => {
6969
'User-Agent': expect.stringContaining(''),
7070
},
7171
},
72+
user: {
73+
ip_address: '{{auto}}',
74+
},
7275
platform: 'javascript',
7376
});
7477
const cspViolation = await page.evaluate<boolean>('window.__CSPVIOLATION__');

dev-packages/browser-integration-tests/suites/integrations/captureConsole-attachStackTrace/init.js

-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,5 @@ window.Sentry = Sentry;
66
Sentry.init({
77
dsn: 'https://[email protected]/1337',
88
integrations: [captureConsoleIntegration()],
9-
autoSessionTracking: false,
109
attachStacktrace: true,
1110
});

dev-packages/browser-integration-tests/suites/integrations/captureConsole-attachStackTrace/test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ sentryTest(
1919
const errorEvent = events.find(event => event.message === 'console error');
2020
const traceEvent = events.find(event => event.message === 'console trace');
2121
const errorWithErrorEvent = events.find(
22-
event => event.exception && event.exception.values?.[0].value === 'console error with error object',
22+
event => event.exception?.values?.[0].value === 'console error with error object',
2323
);
2424
const traceWithErrorEvent = events.find(
25-
event => event.exception && event.exception.values?.[0].value === 'console trace with error object',
25+
event => event.exception?.values?.[0].value === 'console trace with error object',
2626
);
2727

2828
expect(logEvent).toEqual(

dev-packages/browser-integration-tests/suites/integrations/captureConsole/init.js

-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,4 @@ window.Sentry = Sentry;
66
Sentry.init({
77
dsn: 'https://[email protected]/1337',
88
integrations: [captureConsoleIntegration()],
9-
autoSessionTracking: false,
109
});

dev-packages/browser-integration-tests/suites/integrations/captureConsole/test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ sentryTest('it captures console messages correctly', async ({ getLocalTestUrl, p
1717
const errorEvent = events.find(event => event.message === 'console error');
1818
const traceEvent = events.find(event => event.message === 'console trace');
1919
const errorWithErrorEvent = events.find(
20-
event => event.exception && event.exception.values?.[0].value === 'console error with error object',
20+
event => event.exception?.values?.[0].value === 'console error with error object',
2121
);
2222
const traceWithErrorEvent = events.find(
23-
event => event.exception && event.exception.values?.[0].value === 'console trace with error object',
23+
event => event.exception?.values?.[0].value === 'console trace with error object',
2424
);
2525

2626
expect(logEvent).toEqual(

dev-packages/browser-integration-tests/suites/integrations/featureFlags/featureFlags/withScope/test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ sentryTest('Flag evaluations in forked scopes are stored separately.', async ({
2222
const url = await getLocalTestUrl({ testDir: __dirname, skipDsnRouteHandler: true });
2323
await page.goto(url);
2424

25-
const forkedReqPromise = waitForErrorRequest(page, event => !!event.tags && event.tags.isForked === true);
26-
const mainReqPromise = waitForErrorRequest(page, event => !!event.tags && event.tags.isForked === false);
25+
const forkedReqPromise = waitForErrorRequest(page, event => !!event.tags?.isForked === true);
26+
const mainReqPromise = waitForErrorRequest(page, event => !!event.tags?.isForked === false);
2727

2828
await page.evaluate(() => {
2929
const Sentry = (window as any).Sentry;

dev-packages/browser-integration-tests/suites/integrations/featureFlags/launchdarkly/init.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Sentry.init({
1313
// Also, no SDK has mock utils for FlagUsedHandler's.
1414
const MockLaunchDarkly = {
1515
initialize(_clientId, context, options) {
16-
const flagUsedHandler = options && options.inspectors ? options.inspectors[0].method : undefined;
16+
const flagUsedHandler = options.inspectors ? options.inspectors[0].method : undefined;
1717

1818
return {
1919
variation(key, defaultValue) {

dev-packages/browser-integration-tests/suites/integrations/featureFlags/launchdarkly/withScope/test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ sentryTest('Flag evaluations in forked scopes are stored separately.', async ({
2222
const url = await getLocalTestUrl({ testDir: __dirname, skipDsnRouteHandler: true });
2323
await page.goto(url);
2424

25-
const forkedReqPromise = waitForErrorRequest(page, event => !!event.tags && event.tags.isForked === true);
26-
const mainReqPromise = waitForErrorRequest(page, event => !!event.tags && event.tags.isForked === false);
25+
const forkedReqPromise = waitForErrorRequest(page, event => !!event.tags?.isForked === true);
26+
const mainReqPromise = waitForErrorRequest(page, event => !!event.tags?.isForked === false);
2727

2828
await page.evaluate(() => {
2929
const Sentry = (window as any).Sentry;

dev-packages/browser-integration-tests/suites/integrations/featureFlags/openfeature/withScope/test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ sentryTest('Flag evaluations in forked scopes are stored separately.', async ({
2222
const url = await getLocalTestUrl({ testDir: __dirname, skipDsnRouteHandler: true });
2323
await page.goto(url);
2424

25-
const forkedReqPromise = waitForErrorRequest(page, event => !!event.tags && event.tags.isForked === true);
26-
const mainReqPromise = waitForErrorRequest(page, event => !!event.tags && event.tags.isForked === false);
25+
const forkedReqPromise = waitForErrorRequest(page, event => !!event.tags?.isForked === true);
26+
const mainReqPromise = waitForErrorRequest(page, event => !!event.tags?.isForked === false);
2727

2828
await page.evaluate(() => {
2929
const Sentry = (window as any).Sentry;

dev-packages/browser-integration-tests/suites/integrations/moduleMetadata/appliesMetadata/init.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import * as Sentry from '@sentry/browser';
22

3+
import { moduleMetadataIntegration } from '@sentry/browser';
4+
35
Sentry.init({
46
dsn: 'https://[email protected]/1337',
5-
integrations: [Sentry.moduleMetadataIntegration()],
7+
integrations: [moduleMetadataIntegration()],
68
beforeSend(event) {
79
const moduleMetadataEntries = [];
810

dev-packages/browser-integration-tests/suites/integrations/moduleMetadata/appliesMetadata/test.ts

-5
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ import { sentryTest } from '../../../../utils/fixtures';
55
import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers';
66

77
sentryTest('should provide module_metadata on stack frames in beforeSend', async ({ getLocalTestUrl, page }) => {
8-
// moduleMetadataIntegration is not included in any CDN bundles
9-
if (process.env.PW_BUNDLE?.startsWith('bundle')) {
10-
sentryTest.skip();
11-
}
12-
138
const url = await getLocalTestUrl({ testDir: __dirname });
149

1510
const errorEvent = await getFirstSentryEnvelopeRequest<Event>(page, url);

dev-packages/browser-integration-tests/suites/integrations/moduleMetadata/appliesMetadataWithRewriteFrames/init.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
import * as Sentry from '@sentry/browser';
22

3+
import { moduleMetadataIntegration } from '@sentry/browser';
4+
import { rewriteFramesIntegration } from '@sentry/browser';
5+
36
Sentry.init({
47
dsn: 'https://[email protected]/1337',
58
integrations: [
6-
Sentry.moduleMetadataIntegration(),
7-
Sentry.rewriteFramesIntegration({
9+
moduleMetadataIntegration(),
10+
rewriteFramesIntegration({
811
iteratee: frame => {
912
return {
1013
...frame,

0 commit comments

Comments
 (0)