Skip to content

Commit 489af9f

Browse files
authored
Merge branch 'develop' into jb/profiling/requrie
2 parents 2a49051 + 05a368f commit 489af9f

26 files changed

+100
-128
lines changed

.github/workflows/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ jobs:
152152
id: install_dependencies
153153

154154
- name: Check for Affected Nx Projects
155-
uses: dkhunt27/action-nx-affected-list@v5.3
155+
uses: dkhunt27/action-nx-affected-list@v6.1
156156
id: checkForAffected
157157
if: github.event_name == 'pull_request'
158158
with:

.github/workflows/external-contributors.yml

+3
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ jobs:
3838
- name: Create PR with changes
3939
uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c
4040
with:
41+
# This token is scoped to Daniel Griesser
42+
# If we used the default GITHUB_TOKEN, the resulting PR would not trigger CI :(
43+
token: ${{ secrets.REPO_SCOPED_TOKEN }}
4144
commit-message: "ref: Add external contributor to CHANGELOG.md"
4245
title: "ref: Add external contributor to CHANGELOG.md"
4346
branch: 'external-contributor/patch-${{ github.event.pull_request.user.login }}'

CHANGELOG.md

+7-5
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
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 @trzeciak and @lizhiyao. Thank you for your contributions!
14+
1315
## 8.33.1
1416

1517
- fix(core): Update trpc middleware types ([#13859](https://github.com/getsentry/sentry-javascript/pull/13859))
@@ -1158,12 +1160,12 @@ with full support for ESM-based node apps using **Node.js 18.19.0 or higher**.
11581160
[**ES2018+**](https://caniuse.com/?feats=mdn-javascript_builtins_regexp_dotall,js-regexp-lookbehind,mdn-javascript_builtins_regexp_named_capture_groups,mdn-javascript_builtins_regexp_property_escapes,mdn-javascript_builtins_symbol_asynciterator,mdn-javascript_functions_method_definitions_async_generator_methods,mdn-javascript_grammar_template_literals_template_literal_revision,mdn-javascript_operators_destructuring_rest_in_objects,mdn-javascript_operators_destructuring_rest_in_arrays,promise-finally)
11591161
compatible browsers. New minimum browser versions:
11601162

1161-
- Chrome 63
1163+
- Chrome 71
11621164
- Edge 79
1163-
- Safari/iOS Safari 12
1164-
- Firefox 58
1165-
- Opera 50
1166-
- Samsung Internet 8.2
1165+
- Safari 12.1, iOS Safari 12.2
1166+
- Firefox 65
1167+
- Opera 58
1168+
- Samsung Internet 10
11671169

11681170
For more details, please see the
11691171
[version support section in our migration guide](./MIGRATION.md#1-version-support-changes).

MIGRATION.md

+10-8
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,20 @@ higher. Lower versions may continue to work, but may not support all features (e
2424
applies to `@sentry/node` and all of our node-based server-side sdks (`@sentry/nextjs`, `@sentry/serverless`, etc.). We
2525
no longer test against Node 8, 10, or 12 and cannot guarantee that the SDK will work as expected on these versions.
2626

27-
**Browser**: Our browser SDKs (`@sentry/browser`, `@sentry/react`, `@sentry/vue`, etc.) now require ES2018+ compatible
28-
browsers. This means that we no longer support IE11 (end of an era). This also means that the Browser SDK requires the
29-
fetch API to be available in the environment.
27+
**Browser**: Our browser SDKs (`@sentry/browser`, `@sentry/react`, `@sentry/vue`, etc.) now require ES2018+
28+
compatibility plus support for
29+
[`globalThis`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis). This means
30+
that we no longer support IE11 (end of an era). This also means that the Browser SDK requires the fetch API to be
31+
available in the environment.
3032

3133
New minimum supported browsers:
3234

33-
- Chrome 63
35+
- Chrome 71
3436
- Edge 79
35-
- Safari/iOS Safari 12
36-
- Firefox 58
37-
- Opera 50
38-
- Samsung Internet 8.2
37+
- Safari 12.1, iOS Safari 12.2
38+
- Firefox 65
39+
- Opera 58
40+
- Samsung Internet 10
3941

4042
For IE11 support please transpile your code to ES5 using babel or similar and add required polyfills.
4143

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ package. Please refer to the README and instructions of those SDKs for more deta
6262
- [`@sentry/remix`](https://github.com/getsentry/sentry-javascript/tree/master/packages/remix): SDK for Remix
6363
- [`@sentry/aws-serverless`](https://github.com/getsentry/sentry-javascript/tree/master/packages/aws-serverless): SDK
6464
for AWS Lambda Functions
65-
- [`@sentry/google-cloud-serverless`](https://github.com/getsentry/sentry-javascript/tree/master/packages/google-cloud):
65+
- [`@sentry/google-cloud-serverless`](https://github.com/getsentry/sentry-javascript/tree/master/packages/google-cloud-serverless):
6666
SDK for Google Cloud Functions
6767
- [`@sentry/electron`](https://github.com/getsentry/sentry-electron): SDK for Electron with support for native crashes
6868
- [`@sentry/react-native`](https://github.com/getsentry/sentry-react-native): SDK for React Native with support for

dev-packages/node-integration-tests/suites/public-api/LocalVariables/local-variables-memory-test.js

-48
This file was deleted.

dev-packages/node-integration-tests/suites/public-api/LocalVariables/test.ts

-26
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import * as childProcess from 'child_process';
21
import * as path from 'path';
32
import { conditionalTest } from '../../../utils';
43
import { cleanupChildProcesses, createRunner } from '../../../utils/runner';
@@ -89,29 +88,4 @@ conditionalTest({ min: 18 })('LocalVariables integration', () => {
8988
test('Includes local variables for caught exceptions when enabled', done => {
9089
createRunner(__dirname, 'local-variables-caught.js').expect({ event: EXPECTED_LOCAL_VARIABLES_EVENT }).start(done);
9190
});
92-
93-
test('Should not leak memory', done => {
94-
const testScriptPath = path.resolve(__dirname, 'local-variables-memory-test.js');
95-
96-
const child = childProcess.spawn('node', [testScriptPath], {
97-
stdio: ['inherit', 'inherit', 'inherit', 'ipc'],
98-
});
99-
100-
let reportedCount = 0;
101-
102-
child.on('message', msg => {
103-
reportedCount++;
104-
const rssMb = (msg as { memUsage: { rss: number } }).memUsage.rss / 1024 / 1024;
105-
// We shouldn't use more than 135MB of memory
106-
expect(rssMb).toBeLessThan(135);
107-
});
108-
109-
// Wait for 20 seconds
110-
setTimeout(() => {
111-
// Ensure we've had memory usage reported at least 15 times
112-
expect(reportedCount).toBeGreaterThan(15);
113-
child.kill();
114-
done();
115-
}, 20000);
116-
});
11791
});

dev-packages/node-integration-tests/suites/tracing/dataloader/scenario.js

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Sentry.init({
66
release: '1.0',
77
tracesSampleRate: 1.0,
88
transport: loggingTransport,
9+
integrations: [Sentry.dataloaderIntegration()],
910
});
1011

1112
const PORT = 8008;

packages/browser/src/index.bundle.replay.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66

77
export * from './index.bundle.base';
88

9-
export { replayIntegration } from '@sentry-internal/replay';
9+
export { replayIntegration, getReplay } from '@sentry-internal/replay';
1010

1111
export {
1212
browserTracingIntegrationShim as browserTracingIntegration,

packages/browser/src/index.bundle.tracing.replay.feedback.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ import { feedbackAsyncIntegration } from './feedbackAsync';
2929
export { getFeedback } from '@sentry-internal/feedback';
3030
export { feedbackAsyncIntegration as feedbackAsyncIntegration, feedbackAsyncIntegration as feedbackIntegration };
3131

32-
export { replayIntegration } from '@sentry-internal/replay';
32+
export { replayIntegration, getReplay } from '@sentry-internal/replay';

packages/browser/src/index.bundle.tracing.replay.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ export {
2727
import { feedbackIntegrationShim } from '@sentry-internal/integration-shims';
2828
export { feedbackIntegrationShim as feedbackAsyncIntegration, feedbackIntegrationShim as feedbackIntegration };
2929

30-
export { replayIntegration } from '@sentry-internal/replay';
30+
export { replayIntegration, getReplay } from '@sentry-internal/replay';

packages/nextjs/src/common/_error.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { captureException, withScope } from '@sentry/core';
2+
import { vercelWaitUntil } from '@sentry/utils';
23
import type { NextPageContext } from 'next';
34
import { flushSafelyWithTimeout } from './utils/responseEnd';
4-
import { vercelWaitUntil } from './utils/vercelWaitUntil';
55

66
type ContextOrProps = {
77
req?: NextPageContext['req'];

packages/nextjs/src/common/utils/edgeWrapperUtils.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,11 @@ import {
99
startSpan,
1010
withIsolationScope,
1111
} from '@sentry/core';
12-
import { winterCGRequestToRequestData } from '@sentry/utils';
12+
import { vercelWaitUntil, winterCGRequestToRequestData } from '@sentry/utils';
1313

1414
import type { EdgeRouteHandler } from '../../edge/types';
1515
import { flushSafelyWithTimeout } from './responseEnd';
1616
import { commonObjectToIsolationScope, escapeNextjsTracing } from './tracingUtils';
17-
import { vercelWaitUntil } from './vercelWaitUntil';
1817

1918
/**
2019
* Wraps a function on the edge runtime with error and performance monitoring.

packages/nextjs/src/common/utils/wrapperUtils.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@ import {
1414
withIsolationScope,
1515
} from '@sentry/core';
1616
import type { Span } from '@sentry/types';
17-
import { isString } from '@sentry/utils';
17+
import { isString, vercelWaitUntil } from '@sentry/utils';
1818

1919
import { autoEndSpanOnResponseEnd, flushSafelyWithTimeout } from './responseEnd';
2020
import { commonObjectToIsolationScope, escapeNextjsTracing } from './tracingUtils';
21-
import { vercelWaitUntil } from './vercelWaitUntil';
2221

2322
declare module 'http' {
2423
interface IncomingMessage {

packages/nextjs/src/common/withServerActionInstrumentation.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@ import {
55
withIsolationScope,
66
} from '@sentry/core';
77
import { captureException, continueTrace, getClient, handleCallbackErrors, startSpan } from '@sentry/core';
8-
import { logger } from '@sentry/utils';
8+
import { logger, vercelWaitUntil } from '@sentry/utils';
99

1010
import { DEBUG_BUILD } from './debug-build';
1111
import { isNotFoundNavigationError, isRedirectNavigationError } from './nextNavigationErrorUtils';
1212
import { flushSafelyWithTimeout } from './utils/responseEnd';
1313
import { escapeNextjsTracing } from './utils/tracingUtils';
14-
import { vercelWaitUntil } from './utils/vercelWaitUntil';
1514

1615
interface Options {
1716
formData?: FormData;

packages/nextjs/src/common/wrapApiHandlerWithSentry.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@ import {
66
startSpanManual,
77
withIsolationScope,
88
} from '@sentry/core';
9-
import { consoleSandbox, isString, logger, objectify } from '@sentry/utils';
9+
import { consoleSandbox, isString, logger, objectify, vercelWaitUntil } from '@sentry/utils';
1010

1111
import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/core';
1212
import type { AugmentedNextApiRequest, AugmentedNextApiResponse, NextApiHandler } from './types';
1313
import { flushSafelyWithTimeout } from './utils/responseEnd';
1414
import { escapeNextjsTracing } from './utils/tracingUtils';
15-
import { vercelWaitUntil } from './utils/vercelWaitUntil';
1615

1716
/**
1817
* Wrap the given API route handler for tracing and error capturing. Thin wrapper around `withSentry`, which only

packages/nextjs/src/common/wrapRouteHandlerWithSentry.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
withIsolationScope,
1111
withScope,
1212
} from '@sentry/core';
13-
import { propagationContextFromHeaders, winterCGHeadersToDict } from '@sentry/utils';
13+
import { propagationContextFromHeaders, vercelWaitUntil, winterCGHeadersToDict } from '@sentry/utils';
1414
import { isNotFoundNavigationError, isRedirectNavigationError } from './nextNavigationErrorUtils';
1515
import type { RouteHandlerContext } from './types';
1616
import { flushSafelyWithTimeout } from './utils/responseEnd';
@@ -19,7 +19,6 @@ import {
1919
commonObjectToPropagationContext,
2020
escapeNextjsTracing,
2121
} from './utils/tracingUtils';
22-
import { vercelWaitUntil } from './utils/vercelWaitUntil';
2322

2423
/**
2524
* Wraps a Next.js App Router Route handler with Sentry error and performance instrumentation.

packages/nextjs/src/common/wrapServerComponentWithSentry.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,13 @@ import {
1313
withIsolationScope,
1414
withScope,
1515
} from '@sentry/core';
16-
import { propagationContextFromHeaders, uuid4, winterCGHeadersToDict } from '@sentry/utils';
16+
import { propagationContextFromHeaders, uuid4, vercelWaitUntil, winterCGHeadersToDict } from '@sentry/utils';
1717

1818
import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/core';
1919
import { isNotFoundNavigationError, isRedirectNavigationError } from '../common/nextNavigationErrorUtils';
2020
import type { ServerComponentContext } from '../common/types';
2121
import { flushSafelyWithTimeout } from './utils/responseEnd';
2222
import { commonObjectToIsolationScope, commonObjectToPropagationContext } from './utils/tracingUtils';
23-
import { vercelWaitUntil } from './utils/vercelWaitUntil';
2423

2524
/**
2625
* Wraps an `app` directory server component with Sentry error instrumentation.

packages/node/src/integrations/local-variables/worker.ts

+3-11
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ let rateLimiter: RateLimitIncrement | undefined;
8686
async function handlePaused(
8787
session: Session,
8888
{ reason, data: { objectId }, callFrames }: PausedExceptionEvent,
89-
): Promise<string | undefined> {
89+
): Promise<void> {
9090
if (reason !== 'exception' && reason !== 'promiseRejection') {
9191
return;
9292
}
@@ -126,7 +126,7 @@ async function handlePaused(
126126
objectId,
127127
});
128128

129-
return objectId;
129+
await session.post('Runtime.releaseObject', { objectId });
130130
}
131131

132132
async function startDebugger(): Promise<void> {
@@ -145,19 +145,11 @@ async function startDebugger(): Promise<void> {
145145
isPaused = true;
146146

147147
handlePaused(session, event.params as PausedExceptionEvent).then(
148-
async objectId => {
148+
async () => {
149149
// After the pause work is complete, resume execution!
150150
if (isPaused) {
151151
await session.post('Debugger.resume');
152152
}
153-
154-
if (objectId) {
155-
// The object must be released after the debugger has resumed or we get a memory leak.
156-
// For node v20, setImmediate is enough here but for v22 a longer delay is required
157-
setTimeout(async () => {
158-
await session.post('Runtime.releaseObject', { objectId });
159-
}, 1_000);
160-
}
161153
},
162154
async _ => {
163155
if (isPaused) {

packages/node/src/integrations/tracing/index.ts

-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { instrumentHttp } from '../http';
33

44
import { amqplibIntegration, instrumentAmqplib } from './amqplib';
55
import { connectIntegration, instrumentConnect } from './connect';
6-
import { dataloaderIntegration, instrumentDataloader } from './dataloader';
76
import { expressIntegration, instrumentExpress } from './express';
87
import { fastifyIntegration, instrumentFastify } from './fastify';
98
import { genericPoolIntegration, instrumentGenericPool } from './genericPool';
@@ -44,7 +43,6 @@ export function getAutoPerformanceIntegrations(): Integration[] {
4443
connectIntegration(),
4544
genericPoolIntegration(),
4645
kafkaIntegration(),
47-
dataloaderIntegration(),
4846
amqplibIntegration(),
4947
lruMemoizerIntegration(),
5048
];
@@ -74,7 +72,6 @@ export function getOpenTelemetryInstrumentationToPreload(): (((options?: any) =>
7472
instrumentGraphql,
7573
instrumentRedis,
7674
instrumentGenericPool,
77-
instrumentDataloader,
7875
instrumentAmqplib,
7976
];
8077
}

packages/replay-worker/examples/worker.js

+12-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
1-
/*! Sentry Replay Worker 7.77.0 (cce7d5ecf) | https://github.com/getsentry/sentry-javascript */
1+
/*! Sentry Replay Worker 8.33.1 (c992b3fad) | https://github.com/getsentry/sentry-javascript */
22
// DEFLATE is a complex format; to read this code, you should probably check the RFC first:
3+
// https://tools.ietf.org/html/rfc1951
4+
// You may also wish to take a look at the guide I made about this program:
5+
// https://gist.github.com/101arrowz/253f31eb5abc3d9275ab943003ffecad
6+
// Some of the following code is similar to that of UZIP.js:
7+
// https://github.com/photopea/UZIP.js
8+
// However, the vast majority of the codebase has diverged from UZIP.js to increase performance and reduce bundle size.
9+
// Sometimes 0 will appear where -1 would be more appropriate. This is because using a uint
10+
// is better for memory in most engines (I *think*).
311

412
// aliases for shorter compressed code (most minifers don't do this)
513
var u8 = Uint8Array,
@@ -849,12 +857,13 @@ function compress(data) {
849857
function mergeUInt8Arrays(chunks) {
850858
// calculate data length
851859
let len = 0;
852-
for (let i = 0, l = chunks.length; i < l; i++) {
853-
len += chunks[i].length;
860+
for (const chunk of chunks) {
861+
len += chunk.length;
854862
}
855863
// join chunks
856864
const result = new Uint8Array(len);
857865
for (let i = 0, pos = 0, l = chunks.length; i < l; i++) {
866+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
858867
const chunk = chunks[i];
859868
result.set(chunk, pos);
860869
pos += chunk.length;

0 commit comments

Comments
 (0)