Skip to content

Commit 141c67e

Browse files
authored
Merge branch 'getsentry:develop' into feat/graphqlClientIntegration
2 parents a0f7aeb + 480fa2a commit 141c67e

File tree

22 files changed

+270
-303
lines changed

22 files changed

+270
-303
lines changed

.craft.yml

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -129,20 +129,19 @@ targets:
129129
includeNames: /^sentry-internal-eslint-config-sdk-\d.*\.tgz$/
130130

131131
# AWS Lambda Layer target
132-
# TODO(v9): Once stable, re-add this target to publish the AWS Lambda layer
133-
# - name: aws-lambda-layer
134-
# includeNames: /^sentry-node-serverless-\d+.\d+.\d+(-(beta|alpha|rc)\.\d+)?\.zip$/
135-
# layerName: SentryNodeServerlessSDKv9
136-
# compatibleRuntimes:
137-
# - name: node
138-
# versions:
139-
# - nodejs10.x
140-
# - nodejs12.x
141-
# - nodejs14.x
142-
# - nodejs16.x
143-
# - nodejs18.x
144-
# - nodejs20.x
145-
# license: MIT
132+
- name: aws-lambda-layer
133+
includeNames: /^sentry-node-serverless-\d+.\d+.\d+(-(beta|alpha|rc)\.\d+)?\.zip$/
134+
layerName: SentryNodeServerlessSDKv9
135+
compatibleRuntimes:
136+
- name: node
137+
versions:
138+
- nodejs10.x
139+
- nodejs12.x
140+
- nodejs14.x
141+
- nodejs16.x
142+
- nodejs18.x
143+
- nodejs20.x
144+
license: MIT
146145

147146
# CDN Bundle Target
148147
- name: gcs

CHANGELOG.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@
1010

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

13-
### 9.0.0
13+
## 9.0.0
1414

1515
Version `9.0.0` marks a release of the Sentry JavaScript SDKs that contains breaking changes.
1616
The goal of this release is to trim down on unused and potentially confusing APIs, prepare the SDKs for future framework versions to build deeper instrumentation, and remove old polyfills to reduce the packages' size.
1717

18-
#### How To Upgrade
18+
### How To Upgrade
1919

2020
Please carefully read through the migration guide in the Sentry docs on how to upgrade from version 8 to version 9.
2121
Make sure to select your specific platform/framework in the top left corner: https://docs.sentry.io/platforms/javascript/migration/v8-to-v9/
2222

2323
A comprehensive migration guide outlining all changes for all the frameworks can be found within the Sentry JavaScript SDK Repository: https://github.com/getsentry/sentry-javascript/blob/develop/MIGRATION.md
2424

25-
#### Breaking Changes
25+
### Breaking Changes
2626

2727
- doc(deno)!: Make Deno v2 the minimum supported version (#15085)
2828
- feat!: Bump typescript to `~5.0.0` (#14758)
@@ -101,7 +101,7 @@ A comprehensive migration guide outlining all changes for all the frameworks can
101101
- ref(core)!: Remove `Scope` type interface in favor of using `Scope` class (#14721)
102102
- ref(core)!: Remove backwards compatible SentryCarrier type (#14697)
103103

104-
#### Other Changes
104+
### Other Changes
105105

106106
- chore(browser): Export ipAddress helpers for use in other SDKs (#15079)
107107
- deps(node): Bump `import-in-the-middle` to `1.12.0` (#14796)
@@ -126,12 +126,14 @@ A comprehensive migration guide outlining all changes for all the frameworks can
126126
- feat(deps): bump @opentelemetry/instrumentation-mongodb from 0.50.0 to 0.51.0 (#14871)
127127
- feat(deps): bump @opentelemetry/instrumentation-tedious from 0.17.0 to 0.18.0 (#14868)
128128
- feat(deps): bump @sentry/cli from 2.39.1 to 2.41.1 (#15173)
129+
- feat(flags): Add Statsig browser integration (#15319)
129130
- feat(gatsby): Preserve user-provided source map settings (#15006)
130131
- feat(nestjs): Remove `SentryTracingInterceptor`, `SentryGlobalGraphQLFilter`, `SentryGlobalGenericFilter` (#14761)
131132
- feat(nextjs): Directly forward `sourcemaps.disable` to webpack plugin (#15109)
132-
- feat(node): Add missing `vercelAIIntegration` export (#15318)
133133
- feat(node): Add `processSessionIntegration` (#15081)
134+
- feat(node): Add missing `vercelAIIntegration` export (#15318)
134135
- feat(node): Capture exceptions from `worker_threads` (#15105)
136+
- feat(nuxt): Add enabled to disable Sentry module (#15337)
135137
- feat(nuxt): add `silent`, `errorHandler`, `release` to `SourceMapsOptions` (#15246)
136138
- feat(profiling-node): Use `@sentry-internal/node-cpu-profiler` (#15208)
137139
- feat(replay): Update fflate to 0.8.2 (#14867)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const FLAG_BUFFER_SIZE = 100; // Corresponds to constant in featureFlags.ts, in browser utils.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { sentryTest } from '../../../../../utils/fixtures';
44

55
import { envelopeRequestParser, shouldSkipFeatureFlagsTest, waitForErrorRequest } from '../../../../../utils/helpers';
66

7-
const FLAG_BUFFER_SIZE = 100; // Corresponds to constant in featureFlags.ts, in browser utils.
7+
import { FLAG_BUFFER_SIZE } from '../../constants';
88

99
sentryTest('Basic test with eviction, update, and no async tasks', async ({ getLocalTestUrl, page }) => {
1010
if (shouldSkipFeatureFlagsTest()) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { sentryTest } from '../../../../../utils/fixtures';
44

55
import { envelopeRequestParser, shouldSkipFeatureFlagsTest, waitForErrorRequest } from '../../../../../utils/helpers';
66

7-
const FLAG_BUFFER_SIZE = 100; // Corresponds to constant in featureFlags.ts, in browser utils.
7+
import { FLAG_BUFFER_SIZE } from '../../constants';
88

99
sentryTest('Basic test with eviction, update, and no async tasks', async ({ getLocalTestUrl, page }) => {
1010
if (shouldSkipFeatureFlagsTest()) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { sentryTest } from '../../../../../utils/fixtures';
44

55
import { envelopeRequestParser, shouldSkipFeatureFlagsTest, waitForErrorRequest } from '../../../../../utils/helpers';
66

7-
const FLAG_BUFFER_SIZE = 100; // Corresponds to constant in featureFlags.ts, in browser utils.
7+
import { FLAG_BUFFER_SIZE } from '../../constants';
88

99
sentryTest('Basic test with eviction, update, and no async tasks', async ({ getLocalTestUrl, page }) => {
1010
if (shouldSkipFeatureFlagsTest()) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { sentryTest } from '../../../../../utils/fixtures';
44

55
import { envelopeRequestParser, shouldSkipFeatureFlagsTest, waitForErrorRequest } from '../../../../../utils/helpers';
66

7-
const FLAG_BUFFER_SIZE = 100; // Corresponds to constant in featureFlags.ts, in browser utils.
7+
import { FLAG_BUFFER_SIZE } from '../../constants';
88

99
sentryTest('Flag evaluation error hook', async ({ getLocalTestUrl, page }) => {
1010
if (shouldSkipFeatureFlagsTest()) {
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import { expect } from '@playwright/test';
2+
3+
import { sentryTest } from '../../../../../utils/fixtures';
4+
5+
import { envelopeRequestParser, shouldSkipFeatureFlagsTest, waitForErrorRequest } from '../../../../../utils/helpers';
6+
7+
import { FLAG_BUFFER_SIZE } from '../../constants';
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 client = (window as any).statsigClient;
27+
for (let i = 1; i <= bufferSize; i++) {
28+
client.checkGate(`feat${i}`); // values default to false
29+
}
30+
31+
client.setMockGateValue(`feat${bufferSize + 1}`, true);
32+
client.checkGate(`feat${bufferSize + 1}`); // eviction
33+
34+
client.setMockGateValue('feat3', true);
35+
client.checkGate('feat3'); // update
36+
}, FLAG_BUFFER_SIZE);
37+
38+
const reqPromise = waitForErrorRequest(page);
39+
await page.locator('#error').click();
40+
const req = await reqPromise;
41+
const event = envelopeRequestParser(req);
42+
43+
const expectedFlags = [{ flag: 'feat2', result: false }];
44+
for (let i = 4; i <= FLAG_BUFFER_SIZE; i++) {
45+
expectedFlags.push({ flag: `feat${i}`, result: false });
46+
}
47+
expectedFlags.push({ flag: `feat${FLAG_BUFFER_SIZE + 1}`, result: true });
48+
expectedFlags.push({ flag: 'feat3', result: true });
49+
50+
expect(event.contexts?.flags?.values).toEqual(expectedFlags);
51+
});
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import * as Sentry from '@sentry/browser';
2+
3+
class MockStatsigClient {
4+
constructor() {
5+
this._gateEvaluationListeners = [];
6+
this._mockGateValues = {};
7+
}
8+
9+
on(event, listener) {
10+
this._gateEvaluationListeners.push(listener);
11+
}
12+
13+
checkGate(name) {
14+
const value = this._mockGateValues[name] || false; // unknown features default to false.
15+
this._gateEvaluationListeners.forEach(listener => {
16+
listener({ gate: { name, value } });
17+
});
18+
return value;
19+
}
20+
21+
setMockGateValue(name, value) {
22+
this._mockGateValues[name] = value;
23+
}
24+
}
25+
26+
window.statsigClient = new MockStatsigClient();
27+
28+
window.Sentry = Sentry;
29+
window.sentryStatsigIntegration = Sentry.statsigIntegration({ featureFlagClient: window.statsigClient });
30+
31+
Sentry.init({
32+
dsn: 'https://[email protected]/1337',
33+
sampleRate: 1.0,
34+
integrations: [window.sentryStatsigIntegration],
35+
});
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
document.getElementById('error').addEventListener('click', () => {
2+
throw new Error('Button triggered error');
3+
});

0 commit comments

Comments
 (0)