Skip to content

Commit 79bb6b4

Browse files
authored
Merge branch 'develop' into cursor/update-express-integration-with-new-options-8195
2 parents 52b9dc5 + 65d6bd4 commit 79bb6b4

File tree

37 files changed

+607
-210
lines changed

37 files changed

+607
-210
lines changed

.size-limit.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ module.exports = [
120120
import: createImport('init', 'ErrorBoundary', 'reactRouterV6BrowserTracingIntegration'),
121121
ignore: ['react/jsx-runtime'],
122122
gzip: true,
123-
limit: '40.5 KB',
123+
limit: '41 KB',
124124
},
125125
// Vue SDK (ESM)
126126
{
@@ -215,7 +215,7 @@ module.exports = [
215215
import: createImport('init'),
216216
ignore: ['$app/stores'],
217217
gzip: true,
218-
limit: '39 KB',
218+
limit: '40 KB',
219219
},
220220
// Node SDK (ESM)
221221
{

dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-inp-late/test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { sentryTest } from '../../../../utils/fixtures';
44
import {
55
getFirstSentryEnvelopeRequest,
66
getMultipleSentryEnvelopeRequests,
7+
hidePage,
78
properFullEnvelopeRequestParser,
89
shouldSkipTracingTest,
910
} from '../../../../utils/helpers';
@@ -33,9 +34,7 @@ sentryTest('should capture an INP click event span after pageload', async ({ bro
3334
await page.waitForTimeout(500);
3435

3536
// Page hide to trigger INP
36-
await page.evaluate(() => {
37-
window.dispatchEvent(new Event('pagehide'));
38-
});
37+
await hidePage(page);
3938

4039
// Get the INP span envelope
4140
const spanEnvelope = (await spanEnvelopePromise)[0];

dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-inp-parametrized-late/test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { sentryTest } from '../../../../utils/fixtures';
44
import {
55
getFirstSentryEnvelopeRequest,
66
getMultipleSentryEnvelopeRequests,
7+
hidePage,
78
properFullEnvelopeRequestParser,
89
shouldSkipTracingTest,
910
} from '../../../../utils/helpers';
@@ -35,9 +36,7 @@ sentryTest(
3536
await page.waitForTimeout(500);
3637

3738
// Page hide to trigger INP
38-
await page.evaluate(() => {
39-
window.dispatchEvent(new Event('pagehide'));
40-
});
39+
await hidePage(page);
4140

4241
// Get the INP span envelope
4342
const spanEnvelope = (await spanEnvelopePromise)[0];

dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-inp-parametrized/test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type { SpanEnvelope } from '@sentry/core';
33
import { sentryTest } from '../../../../utils/fixtures';
44
import {
55
getMultipleSentryEnvelopeRequests,
6+
hidePage,
67
properFullEnvelopeRequestParser,
78
shouldSkipTracingTest,
89
} from '../../../../utils/helpers';
@@ -33,9 +34,7 @@ sentryTest(
3334
await page.waitForTimeout(500);
3435

3536
// Page hide to trigger INP
36-
await page.evaluate(() => {
37-
window.dispatchEvent(new Event('pagehide'));
38-
});
37+
await hidePage(page);
3938

4039
// Get the INP span envelope
4140
const spanEnvelope = (await spanEnvelopePromise)[0];

dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-inp/init.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Sentry.init({
1414
}),
1515
],
1616
tracesSampleRate: 1,
17+
debug: true,
1718
});
1819

1920
const client = Sentry.getClient();

dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-inp/test.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { sentryTest } from '../../../../utils/fixtures';
44
import {
55
getFirstSentryEnvelopeRequest,
66
getMultipleSentryEnvelopeRequests,
7+
hidePage,
78
properFullEnvelopeRequestParser,
89
shouldSkipTracingTest,
910
} from '../../../../utils/helpers';
@@ -32,9 +33,7 @@ sentryTest('should capture an INP click event span during pageload', async ({ br
3233
await page.waitForTimeout(500);
3334

3435
// Page hide to trigger INP
35-
await page.evaluate(() => {
36-
window.dispatchEvent(new Event('pagehide'));
37-
});
36+
await hidePage(page);
3837

3938
// Get the INP span envelope
4039
const spanEnvelope = (await spanEnvelopePromise)[0];
@@ -118,6 +117,14 @@ sentryTest(
118117
});
119118

120119
// Page hide to trigger INP
120+
121+
// Important: Purposefully not using hidePage() here to test the hidden state
122+
// via the `pagehide` event. This is necessary because iOS Safari 14.4
123+
// still doesn't fully emit the `visibilitychange` events but it's the lower
124+
// bound for Safari on iOS that we support.
125+
// If this test times out or fails, it's likely because we tried updating
126+
// the web-vitals library which officially already dropped support for
127+
// this iOS version
121128
await page.evaluate(() => {
122129
window.dispatchEvent(new Event('pagehide'));
123130
});

dev-packages/e2e-tests/test-applications/nestjs-11/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,10 @@
4444
"ts-loader": "^9.4.3",
4545
"tsconfig-paths": "^4.2.0",
4646
"typescript": "~5.0.0"
47+
},
48+
"pnpm": {
49+
"overrides": {
50+
"minimatch": "10.0.1"
51+
}
4752
}
4853
}

dev-packages/e2e-tests/test-applications/nextjs-t3/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
"@sentry/nextjs": "latest || *",
1818
"@t3-oss/env-nextjs": "^0.10.1",
1919
"@tanstack/react-query": "^5.50.0",
20-
"@trpc/client": "^11.0.0-rc.446",
21-
"@trpc/react-query": "^11.0.0-rc.446",
22-
"@trpc/server": "^11.0.0-rc.446",
20+
"@trpc/client": "~11.3.0",
21+
"@trpc/react-query": "~11.3.0",
22+
"@trpc/server": "~11.3.0",
2323
"geist": "^1.3.0",
2424
"next": "14.2.29",
2525
"react": "18.3.1",

packages/browser-utils/src/metrics/cls.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ export function trackClsAsStandaloneSpan(): void {
5858
standaloneClsEntry = entry;
5959
}, true);
6060

61+
// TODO: Figure out if we can switch to using whenIdleOrHidden instead of onHidden
6162
// use pagehide event from web-vitals
6263
onHidden(() => {
6364
_collectClsOnce();

packages/browser-utils/src/metrics/web-vitals/README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
> A modular library for measuring the [Web Vitals](https://web.dev/vitals/) metrics on real users.
44
5-
This was vendored from: https://github.com/GoogleChrome/web-vitals: v3.5.2
5+
This was vendored from: https://github.com/GoogleChrome/web-vitals: v5.0.2
66

77
The commit SHA used is:
8-
[3d2b3dc8576cc003618952fa39902fab764a53e2](https://github.com/GoogleChrome/web-vitals/tree/3d2b3dc8576cc003618952fa39902fab764a53e2)
8+
[463abbd425cda01ed65e0b5d18be9f559fe446cb](https://github.com/GoogleChrome/web-vitals/tree/463abbd425cda01ed65e0b5d18be9f559fe446cb)
99

1010
Current vendored web vitals are:
1111

@@ -27,6 +27,12 @@ web-vitals only report once per pageload.
2727

2828
## CHANGELOG
2929

30+
https://github.com/getsentry/sentry-javascript/pull/16492
31+
32+
- Bumped from Web Vitals 4.2.5 to 5.0.2
33+
- Mainly fixes some INP, LCP and FCP edge cases
34+
- Original library removed FID; we still keep it around for now
35+
3036
https://github.com/getsentry/sentry-javascript/pull/14439
3137

3238
- Bumped from Web Vitals v3.5.2 to v4.2.4

0 commit comments

Comments
 (0)