Skip to content

Commit c0f9aaa

Browse files
author
Luca Forstner
committed
Merge remote-tracking branch 'origin/v9' into lforst-server-sessions
2 parents 5430723 + 8b81476 commit c0f9aaa

File tree

243 files changed

+4735
-829
lines changed

Some content is hidden

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

243 files changed

+4735
-829
lines changed

.github/actions/install-playwright/action.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ inputs:
44
browsers:
55
description: 'What browsers to install.'
66
default: 'chromium webkit firefox'
7+
cwd:
8+
description: 'The working directory to run Playwright in.'
9+
default: '.'
710

811
runs:
912
using: "composite"
@@ -12,6 +15,8 @@ runs:
1215
id: playwright-version
1316
run: echo "version=$(node -p "require('@playwright/test/package.json').version")" >> $GITHUB_OUTPUT
1417
shell: bash
18+
working-directory: ${{ inputs.cwd }}
19+
1520

1621
- name: Restore cached playwright binaries
1722
uses: actions/cache/restore@v4
@@ -26,11 +31,13 @@ runs:
2631
run: npx playwright install chromium webkit firefox --with-deps
2732
if: steps.playwright-cache.outputs.cache-hit != 'true'
2833
shell: bash
34+
working-directory: ${{ inputs.cwd }}
2935

3036
- name: Install Playwright system dependencies only (cached)
3137
run: npx playwright install-deps ${{ inputs.browsers || 'chromium webkit firefox' }}
3238
if: steps.playwright-cache.outputs.cache-hit == 'true'
3339
shell: bash
40+
working-directory: ${{ inputs.cwd }}
3441

3542
# Only store cache on develop branch
3643
- name: Store cached playwright binaries

.github/workflows/auto-release.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,16 @@ jobs:
1313
name: 'Prepare a new version'
1414

1515
steps:
16+
- name: Get auth token
17+
id: token
18+
uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1.11.0
19+
with:
20+
app-id: ${{ vars.SENTRY_RELEASE_BOT_CLIENT_ID }}
21+
private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }}
22+
1623
- uses: actions/checkout@v4
1724
with:
18-
token: ${{ secrets.GH_RELEASE_PAT }}
25+
token: ${{ steps.token.outputs.token }}
1926
fetch-depth: 0
2027

2128
# https://github.com/actions-ecosystem/action-regex-match
@@ -38,7 +45,7 @@ jobs:
3845
uses: getsentry/action-prepare-release@v1
3946
if: github.event.pull_request.merged == true && steps.version-regex.outputs.match != '' && steps.get_version.outputs.version != ''
4047
env:
41-
GITHUB_TOKEN: ${{ secrets.GH_RELEASE_PAT }}
48+
GITHUB_TOKEN: ${{ steps.token.outputs.token }}
4249
with:
4350
version: ${{ steps.get_version.outputs.version }}
4451
force: false

.github/workflows/build.yml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -922,11 +922,6 @@ jobs:
922922
if: steps.restore-tarball-cache.outputs.cache-hit != 'true'
923923
run: yarn build:tarball
924924

925-
- name: Install Playwright
926-
uses: ./.github/actions/install-playwright
927-
with:
928-
browsers: chromium
929-
930925
- name: Get node version
931926
id: versions
932927
run: |
@@ -947,6 +942,12 @@ jobs:
947942
timeout-minutes: 7
948943
run: pnpm ${{ matrix.build-command || 'test:build' }}
949944

945+
- name: Install Playwright
946+
uses: ./.github/actions/install-playwright
947+
with:
948+
browsers: chromium
949+
cwd: dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}
950+
950951
- name: Run E2E test
951952
working-directory: dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}
952953
timeout-minutes: 10
@@ -986,7 +987,7 @@ jobs:
986987

987988
# - We skip optional tests on release branches
988989
job_optional_e2e_tests:
989-
name: E2E ${{ matrix.label || matrix.test-application }} Test
990+
name: E2E ${{ matrix.label || matrix.test-application }} Test (optional)
990991
# We only run E2E tests for non-fork PRs because the E2E tests require secrets to work and they can't be accessed from forks
991992
# We need to add the `always()` check here because the previous step has this as well :(
992993
# See: https://github.com/actions/runner/issues/2205
@@ -1041,11 +1042,6 @@ jobs:
10411042
if: steps.restore-tarball-cache.outputs.cache-hit != 'true'
10421043
run: yarn build:tarball
10431044

1044-
- name: Install Playwright
1045-
uses: ./.github/actions/install-playwright
1046-
with:
1047-
browsers: chromium
1048-
10491045
- name: Get node version
10501046
id: versions
10511047
run: |
@@ -1066,6 +1062,12 @@ jobs:
10661062
timeout-minutes: 7
10671063
run: pnpm ${{ matrix.build-command || 'test:build' }}
10681064

1065+
- name: Install Playwright
1066+
uses: ./.github/actions/install-playwright
1067+
with:
1068+
browsers: chromium
1069+
cwd: dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}
1070+
10691071
- name: Run E2E test
10701072
working-directory: dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}
10711073
timeout-minutes: 10

.github/workflows/canary.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,12 @@ jobs:
149149
timeout-minutes: 7
150150
run: yarn ${{ matrix.build-command }}
151151

152+
- name: Install Playwright
153+
uses: ./.github/actions/install-playwright
154+
with:
155+
browsers: chromium
156+
cwd: dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}
157+
152158
- name: Run E2E test
153159
working-directory: dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}
154160
timeout-minutes: 15

.github/workflows/release.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,20 @@ jobs:
1717
runs-on: ubuntu-20.04
1818
name: 'Release a new version'
1919
steps:
20+
- name: Get auth token
21+
id: token
22+
uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1.11.0
23+
with:
24+
app-id: ${{ vars.SENTRY_RELEASE_BOT_CLIENT_ID }}
25+
private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }}
2026
- uses: actions/checkout@v4
2127
with:
22-
token: ${{ secrets.GH_RELEASE_PAT }}
28+
token: ${{ steps.token.outputs.token }}
2329
fetch-depth: 0
2430
- name: Prepare release
2531
uses: getsentry/action-prepare-release@v1
2632
env:
27-
GITHUB_TOKEN: ${{ secrets.GH_RELEASE_PAT }}
33+
GITHUB_TOKEN: ${{ steps.token.outputs.token }}
2834
with:
2935
version: ${{ github.event.inputs.version }}
3036
force: ${{ github.event.inputs.force }}

.size-limit.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ module.exports = [
7979
path: 'packages/browser/build/npm/esm/index.js',
8080
import: createImport('init', 'browserTracingIntegration', 'replayIntegration', 'replayCanvasIntegration'),
8181
gzip: true,
82-
limit: '79 KB',
82+
limit: '80 KB',
8383
},
8484
{
8585
name: '@sentry/browser (incl. Tracing, Replay, Feedback)',
@@ -166,7 +166,7 @@ module.exports = [
166166
name: 'CDN Bundle (incl. Tracing, Replay)',
167167
path: createCDNPath('bundle.tracing.replay.min.js'),
168168
gzip: true,
169-
limit: '74 KB',
169+
limit: '80 KB',
170170
},
171171
{
172172
name: 'CDN Bundle (incl. Tracing, Replay, Feedback)',
@@ -194,7 +194,7 @@ module.exports = [
194194
path: createCDNPath('bundle.tracing.replay.min.js'),
195195
gzip: false,
196196
brotli: false,
197-
limit: '230 KB',
197+
limit: '240 KB',
198198
},
199199
{
200200
name: 'CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed',

CHANGELOG.md

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,115 @@
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 @robinvw1. Thank you for your contribution!
14+
15+
## 8.43.0
16+
17+
### Important Changes
18+
19+
- **feat(nuxt): Add option autoInjectServerSentry (no default import()) ([#14553](https://github.com/getsentry/sentry-javascript/pull/14553))**
20+
21+
Using the dynamic `import()` as the default behavior for initializing the SDK on the server-side did not work for every project.
22+
The default behavior of the SDK has been changed, and you now need to **use the `--import` flag to initialize Sentry on the server-side** to leverage full functionality.
23+
24+
Example with `--import`:
25+
26+
```bash
27+
node --import ./.output/server/sentry.server.config.mjs .output/server/index.mjs
28+
```
29+
30+
In case you are not able to use the `--import` flag, you can enable auto-injecting Sentry in the `nuxt.config.ts` (comes with limitations):
31+
32+
```ts
33+
sentry: {
34+
autoInjectServerSentry: 'top-level-import', // or 'experimental_dynamic-import'
35+
},
36+
```
37+
38+
- **feat(browser): Adds LaunchDarkly and OpenFeature integrations ([#14207](https://github.com/getsentry/sentry-javascript/pull/14207))**
39+
40+
Adds browser SDK integrations for tracking feature flag evaluations through the LaunchDarkly JS SDK and OpenFeature Web SDK:
41+
42+
```ts
43+
import * as Sentry from '@sentry/browser';
44+
45+
Sentry.init({
46+
integrations: [
47+
// Track LaunchDarkly feature flags
48+
Sentry.launchDarklyIntegration(),
49+
// Track OpenFeature feature flags
50+
Sentry.openFeatureIntegration(),
51+
],
52+
});
53+
```
54+
55+
- Read more about the [Feature Flags](https://develop.sentry.dev/sdk/expected-features/#feature-flags) feature in Sentry.
56+
- Read more about the [LaunchDarkly SDK Integration](https://docs.sentry.io/platforms/javascript/configuration/integrations/launchdarkly/).
57+
- Read more about the [OpenFeature SDK Integration](https://docs.sentry.io/platforms/javascript/configuration/integrations/openfeature/).
58+
59+
- **feat(browser): Add `featureFlagsIntegration` for custom tracking of flag evaluations ([#14582](https://github.com/getsentry/sentry-javascript/pull/14582))**
60+
61+
Adds a browser integration to manually track feature flags with an API. Feature flags are attached to subsequent error events:
62+
63+
```ts
64+
import * as Sentry from '@sentry/browser';
65+
66+
const featureFlagsIntegrationInstance = Sentry.featureFlagsIntegration();
67+
68+
Sentry.init({
69+
// Initialize the SDK with the feature flag integration
70+
integrations: [featureFlagsIntegrationInstance],
71+
});
72+
73+
// Manually track a feature flag
74+
featureFlagsIntegrationInstance.addFeatureFlag('my-feature', true);
75+
```
76+
77+
- **feat(astro): Add Astro 5 support ([#14613](https://github.com/getsentry/sentry-javascript/pull/14613))**
78+
79+
With this release, the Sentry Astro SDK officially supports Astro 5.
80+
81+
### Deprecations
82+
83+
- feat(nextjs): Deprecate typedef for `hideSourceMaps` ([#14594](https://github.com/getsentry/sentry-javascript/pull/14594))
84+
85+
The functionality of `hideSourceMaps` was removed in version 8 but was forgotten to be deprecated and removed.
86+
It will be completely removed in the next major version.
87+
88+
- feat(core): Deprecate APIs around `RequestSession`s ([#14566](https://github.com/getsentry/sentry-javascript/pull/14566))
89+
90+
The APIs around `RequestSession`s are mostly used internally.
91+
Going forward the SDK will not expose concepts around `RequestSession`s.
92+
Instead, functionality around server-side [Release Health](https://docs.sentry.io/product/releases/health/) will be managed in integrations.
93+
94+
### Other Changes
95+
96+
- feat(browser): Add `browserSessionIntegration` ([#14551](https://github.com/getsentry/sentry-javascript/pull/14551))
97+
- feat(core): Add `raw_security` envelope types ([#14562](https://github.com/getsentry/sentry-javascript/pull/14562))
98+
- feat(deps): Bump @opentelemetry/instrumentation from 0.55.0 to 0.56.0 ([#14625](https://github.com/getsentry/sentry-javascript/pull/14625))
99+
- feat(deps): Bump @sentry/cli from 2.38.2 to 2.39.1 ([#14626](https://github.com/getsentry/sentry-javascript/pull/14626))
100+
- feat(deps): Bump @sentry/rollup-plugin from 2.22.6 to 2.22.7 ([#14622](https://github.com/getsentry/sentry-javascript/pull/14622))
101+
- feat(deps): Bump @sentry/webpack-plugin from 2.22.6 to 2.22.7 ([#14623](https://github.com/getsentry/sentry-javascript/pull/14623))
102+
- feat(nestjs): Add fastify support ([#14549](https://github.com/getsentry/sentry-javascript/pull/14549))
103+
- feat(node): Add @vercel/ai instrumentation ([#13892](https://github.com/getsentry/sentry-javascript/pull/13892))
104+
- feat(node): Add `disableAnrDetectionForCallback` function ([#14359](https://github.com/getsentry/sentry-javascript/pull/14359))
105+
- feat(node): Add `trackIncomingRequestsAsSessions` option to http integration ([#14567](https://github.com/getsentry/sentry-javascript/pull/14567))
106+
- feat(nuxt): Add option `autoInjectServerSentry` (no default `import()`) ([#14553](https://github.com/getsentry/sentry-javascript/pull/14553))
107+
- feat(nuxt): Add warning when Netlify or Vercel build is discovered ([#13868](https://github.com/getsentry/sentry-javascript/pull/13868))
108+
- feat(nuxt): Improve serverless event flushing and scope isolation ([#14605](https://github.com/getsentry/sentry-javascript/pull/14605))
109+
- feat(opentelemetry): Stop looking at propagation context for span creation ([#14481](https://github.com/getsentry/sentry-javascript/pull/14481))
110+
- feat(opentelemetry): Update OpenTelemetry dependencies to `^1.29.0` ([#14590](https://github.com/getsentry/sentry-javascript/pull/14590))
111+
- feat(opentelemetry): Update OpenTelemetry dependencies to `1.28.0` ([#14547](https://github.com/getsentry/sentry-javascript/pull/14547))
112+
- feat(replay): Upgrade rrweb packages to 2.30.0 ([#14597](https://github.com/getsentry/sentry-javascript/pull/14597))
113+
- fix(core): Decode `filename` and `module` stack frame properties in Node stack parser ([#14544](https://github.com/getsentry/sentry-javascript/pull/14544))
114+
- fix(core): Filter out unactionable CEFSharp promise rejection error by default ([#14595](https://github.com/getsentry/sentry-javascript/pull/14595))
115+
- fix(nextjs): Don't show warning about devtool option ([#14552](https://github.com/getsentry/sentry-javascript/pull/14552))
116+
- fix(nextjs): Only apply tracing metadata to data fetcher data when data is an object ([#14575](https://github.com/getsentry/sentry-javascript/pull/14575))
117+
- fix(node): Guard against invalid `maxSpanWaitDuration` values ([#14632](https://github.com/getsentry/sentry-javascript/pull/14632))
118+
- fix(react): Match routes with `parseSearch` option in TanStack Router instrumentation ([#14328](https://github.com/getsentry/sentry-javascript/pull/14328))
119+
- fix(sveltekit): Fix git SHA not being picked up for release ([#14540](https://github.com/getsentry/sentry-javascript/pull/14540))
120+
- fix(types): Fix generic exports with default ([#14576](https://github.com/getsentry/sentry-javascript/pull/14576))
121+
13122
Work in this release was contributed by @lsmurray. Thank you for your contribution!
14123

15124
## 8.42.0

MIGRATION.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ These docs walk through how to migrate our JavaScript SDKs through different maj
55
- Upgrading from [SDK 4.x to 5.x/6.x](./docs/migration/v4-to-v5_v6.md)
66
- Upgrading from [SDK 6.x to 7.x](./docs/migration/v6-to-v7.md)
77
- Upgrading from [SDK 7.x to 8.x](./MIGRATION.md#upgrading-from-7x-to-8x)
8+
- Upgrading from [SDK 8.x to 9.x](./docs/migration/v8-to-v9.md) (Work in Progress - v9 is not released yet)
89

910
# Upgrading from 7.x to 8.x
1011

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry-internal/browser-integration-tests",
3-
"version": "8.42.0",
3+
"version": "8.43.0",
44
"main": "index.js",
55
"license": "MIT",
66
"engines": {
@@ -42,8 +42,8 @@
4242
"dependencies": {
4343
"@babel/preset-typescript": "^7.16.7",
4444
"@playwright/test": "^1.44.1",
45-
"@sentry-internal/rrweb": "2.29.0",
46-
"@sentry/browser": "8.42.0",
45+
"@sentry-internal/rrweb": "2.30.0",
46+
"@sentry/browser": "8.43.0",
4747
"axios": "1.7.7",
4848
"babel-loader": "^8.2.2",
4949
"html-webpack-plugin": "^5.5.0",
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import { expect } from '@playwright/test';
2+
3+
import { sentryTest } from '../../../../../utils/fixtures';
4+
5+
import { envelopeRequestParser, shouldSkipFeatureFlagsTest, waitForErrorRequest } from '../../../../../utils/helpers';
6+
7+
const FLAG_BUFFER_SIZE = 100; // Corresponds to constant in featureFlags.ts, in browser utils.
8+
9+
sentryTest('Basic test with eviction, update, and no async tasks', async ({ getLocalTestUrl, page }) => {
10+
if (shouldSkipFeatureFlagsTest()) {
11+
sentryTest.skip();
12+
}
13+
14+
await page.route('https://dsn.ingest.sentry.io/**/*', route => {
15+
return route.fulfill({
16+
status: 200,
17+
contentType: 'application/json',
18+
body: JSON.stringify({ id: 'test-id' }),
19+
});
20+
});
21+
22+
const url = await getLocalTestUrl({ testDir: __dirname, skipDsnRouteHandler: true });
23+
await page.goto(url);
24+
25+
await page.evaluate(bufferSize => {
26+
const flagsIntegration = (window as any).Sentry.getClient().getIntegrationByName('FeatureFlags');
27+
for (let i = 1; i <= bufferSize; i++) {
28+
flagsIntegration.addFeatureFlag(`feat${i}`, false);
29+
}
30+
flagsIntegration.addFeatureFlag(`feat${bufferSize + 1}`, true); // eviction
31+
flagsIntegration.addFeatureFlag('feat3', true); // update
32+
return true;
33+
}, FLAG_BUFFER_SIZE);
34+
35+
const reqPromise = waitForErrorRequest(page);
36+
await page.locator('#error').click(); // trigger error
37+
const req = await reqPromise;
38+
const event = envelopeRequestParser(req);
39+
40+
const expectedFlags = [{ flag: 'feat2', result: false }];
41+
for (let i = 4; i <= FLAG_BUFFER_SIZE; i++) {
42+
expectedFlags.push({ flag: `feat${i}`, result: false });
43+
}
44+
expectedFlags.push({ flag: `feat${FLAG_BUFFER_SIZE + 1}`, result: true });
45+
expectedFlags.push({ flag: 'feat3', result: true });
46+
47+
expect(event.contexts?.flags?.values).toEqual(expectedFlags);
48+
});

0 commit comments

Comments
 (0)