Skip to content

Commit

Permalink
Merge pull request #13941 from getsentry/prepare-release/8.34.0
Browse files Browse the repository at this point in the history
meta(changelog): Update changelog for 8.34.0
  • Loading branch information
lforst authored Oct 10, 2024
2 parents 3d3e7ac + 20914b0 commit 2a1dd9a
Show file tree
Hide file tree
Showing 107 changed files with 2,786 additions and 1,439 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ jobs:
id: install_dependencies

- name: Check for Affected Nx Projects
uses: dkhunt27/action-nx-affected-list@v5.3
uses: dkhunt27/action-nx-affected-list@v6.1
id: checkForAffected
if: github.event_name == 'pull_request'
with:
Expand Down Expand Up @@ -611,6 +611,7 @@ jobs:

- name: Upload test results to Codecov
if: cancelled() == false
continue-on-error: true
uses: codecov/test-results-action@v1
with:
directory: dev-packages/browser-integration-tests
Expand Down Expand Up @@ -671,6 +672,7 @@ jobs:

- name: Upload test results to Codecov
if: cancelled() == false
continue-on-error: true
uses: codecov/test-results-action@v1
with:
directory: dev-packages/browser-integration-tests
Expand Down Expand Up @@ -915,6 +917,7 @@ jobs:
'sveltekit',
'sveltekit-2',
'sveltekit-2-svelte-5',
'sveltekit-2-twp',
'tanstack-router',
'generic-ts3.8',
'node-fastify',
Expand All @@ -931,6 +934,7 @@ jobs:
'node-koa',
'node-connect',
'nuxt-3',
'nuxt-4',
'vue-3',
'webpack-4',
'webpack-5'
Expand Down Expand Up @@ -1032,6 +1036,7 @@ jobs:

- name: Upload test results to Codecov
if: cancelled() == false
continue-on-error: true
uses: codecov/test-results-action@v1
with:
directory: dev-packages/e2e-tests
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/external-contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,11 @@ jobs:
author_association: ${{ github.event.pull_request.author_association }}

- name: Create PR with changes
uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f
with:
# This token is scoped to Daniel Griesser
# If we used the default GITHUB_TOKEN, the resulting PR would not trigger CI :(
token: ${{ secrets.REPO_SCOPED_TOKEN }}
commit-message: "ref: Add external contributor to CHANGELOG.md"
title: "ref: Add external contributor to CHANGELOG.md"
branch: 'external-contributor/patch-${{ github.event.pull_request.user.login }}'
Expand Down
2 changes: 1 addition & 1 deletion .size-limit.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ module.exports = [
name: 'CDN Bundle (incl. Tracing, Replay)',
path: createCDNPath('bundle.tracing.replay.min.js'),
gzip: true,
limit: '73 KB',
limit: '74 KB',
},
{
name: 'CDN Bundle (incl. Tracing, Replay, Feedback)',
Expand Down
60 changes: 55 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,56 @@

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

## 8.34.0

### Important Changes

- **ref(nextjs): Remove dead code ([#13828](https://github.com/getsentry/sentry-javascript/pull/13903))**

Relevant for users of the `@sentry/nextjs` package: If you have previously configured a
`SENTRY_IGNORE_API_RESOLUTION_ERROR` environment variable, it is now safe to unset it.

### Other Changes

- feat(cdn): Export `getReplay` in replay CDN bundles
([#13881](https://github.com/getsentry/sentry-javascript/pull/13881))
- feat(replay): Clear fallback buffer when switching buffers
([#13914](https://github.com/getsentry/sentry-javascript/pull/13914))
- feat(replay): Upgrade rrweb packages to 2.28.0 ([#13732](https://github.com/getsentry/sentry-javascript/pull/13732))
- fix(docs): Correct supported browsers due to `globalThis`
([#13788](https://github.com/getsentry/sentry-javascript/pull/13788))
- fix(nextjs): Adjust path to `requestAsyncStorageShim.js` template file
([#13928](https://github.com/getsentry/sentry-javascript/pull/13928))
- fix(nextjs): Detect new locations for request async storage to support Next.js v15.0.0-canary.180 and higher
([#13920](https://github.com/getsentry/sentry-javascript/pull/13920))
- fix(nextjs): Drop `_not-found` spans for all HTTP methods
([#13906](https://github.com/getsentry/sentry-javascript/pull/13906))
- fix(nextjs): Fix resolution of request storage shim fallback
([#13929](https://github.com/getsentry/sentry-javascript/pull/13929))
- fix(node): Ensure graphql options are correct when preloading
([#13769](https://github.com/getsentry/sentry-javascript/pull/13769))
- fix(node): Local variables handle error ([#13827](https://github.com/getsentry/sentry-javascript/pull/13827))
- fix(node): Remove `dataloader` instrumentation from default integrations
([#13873](https://github.com/getsentry/sentry-javascript/pull/13873))
- fix(nuxt): Create declaration files for Nuxt module
([#13909](https://github.com/getsentry/sentry-javascript/pull/13909))
- fix(replay): Ensure `replay_id` is removed from frozen DSC when stopped
([#13893](https://github.com/getsentry/sentry-javascript/pull/13893))
- fix(replay): Try/catch `sendBufferedReplayOrFlush` to prevent cycles
([#13900](https://github.com/getsentry/sentry-javascript/pull/13900))
- fix(sveltekit): Ensure trace meta tags are always injected
([#13231](https://github.com/getsentry/sentry-javascript/pull/13231))
- fix(sveltekit): Update `wrapServerRouteWithSentry` to respect ParamMatchers
([#13390](https://github.com/getsentry/sentry-javascript/pull/13390))
- fix(wasm): Integration wasm uncaught WebAssembly.Exception
([#13787](https://github.com/getsentry/sentry-javascript/pull/13787)) (#13854)
- ref(nextjs): Ignore sentry spans based on query param attribute
([#13905](https://github.com/getsentry/sentry-javascript/pull/13905))
- ref(utils): Move `vercelWaitUntil` to utils ([#13891](https://github.com/getsentry/sentry-javascript/pull/13891))

Work in this release was contributed by @trzeciak, @gurpreetatwal, @ykzts and @lizhiyao. Thank you for your
contributions!

## 8.33.1

- fix(core): Update trpc middleware types ([#13859](https://github.com/getsentry/sentry-javascript/pull/13859))
Expand Down Expand Up @@ -1158,12 +1208,12 @@ with full support for ESM-based node apps using **Node.js 18.19.0 or higher**.
[**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)
compatible browsers. New minimum browser versions:
- Chrome 63
- Chrome 71
- Edge 79
- Safari/iOS Safari 12
- Firefox 58
- Opera 50
- Samsung Internet 8.2
- Safari 12.1, iOS Safari 12.2
- Firefox 65
- Opera 58
- Samsung Internet 10
For more details, please see the
[version support section in our migration guide](./MIGRATION.md#1-version-support-changes).
Expand Down
18 changes: 10 additions & 8 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,20 @@ higher. Lower versions may continue to work, but may not support all features (e
applies to `@sentry/node` and all of our node-based server-side sdks (`@sentry/nextjs`, `@sentry/serverless`, etc.). We
no longer test against Node 8, 10, or 12 and cannot guarantee that the SDK will work as expected on these versions.

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

New minimum supported browsers:

- Chrome 63
- Chrome 71
- Edge 79
- Safari/iOS Safari 12
- Firefox 58
- Opera 50
- Samsung Internet 8.2
- Safari 12.1, iOS Safari 12.2
- Firefox 65
- Opera 58
- Samsung Internet 10

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

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ package. Please refer to the README and instructions of those SDKs for more deta
- [`@sentry/remix`](https://github.com/getsentry/sentry-javascript/tree/master/packages/remix): SDK for Remix
- [`@sentry/aws-serverless`](https://github.com/getsentry/sentry-javascript/tree/master/packages/aws-serverless): SDK
for AWS Lambda Functions
- [`@sentry/google-cloud-serverless`](https://github.com/getsentry/sentry-javascript/tree/master/packages/google-cloud):
- [`@sentry/google-cloud-serverless`](https://github.com/getsentry/sentry-javascript/tree/master/packages/google-cloud-serverless):
SDK for Google Cloud Functions
- [`@sentry/electron`](https://github.com/getsentry/sentry-electron): SDK for Electron with support for native crashes
- [`@sentry/react-native`](https://github.com/getsentry/sentry-react-native): SDK for React Native with support for
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import * as Sentry from '@sentry/browser';

window._triggerError = function (errorCount) {
Sentry.captureException(new Error(`This is error #${errorCount}`));
};
81 changes: 80 additions & 1 deletion dev-packages/browser-integration-tests/suites/replay/dsc/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ import type * as Sentry from '@sentry/browser';
import type { EventEnvelopeHeaders } from '@sentry/types';

import { sentryTest } from '../../../utils/fixtures';
import { envelopeRequestParser, shouldSkipTracingTest, waitForTransactionRequest } from '../../../utils/helpers';
import {
envelopeRequestParser,
shouldSkipTracingTest,
waitForErrorRequest,
waitForTransactionRequest,
} from '../../../utils/helpers';
import { getReplaySnapshot, shouldSkipReplayTest, waitForReplayRunning } from '../../../utils/replayHelpers';

type TestWindow = Window & {
Expand Down Expand Up @@ -216,3 +221,77 @@ sentryTest(
});
},
);

sentryTest('should add replay_id to error DSC while replay is active', async ({ getLocalTestPath, page }) => {
if (shouldSkipReplayTest()) {
sentryTest.skip();
}

const hasTracing = !shouldSkipTracingTest();

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
return route.fulfill({
status: 200,
contentType: 'application/json',
body: JSON.stringify({ id: 'test-id' }),
});
});

const url = await getLocalTestPath({ testDir: __dirname });
await page.goto(url);

const error1Req = waitForErrorRequest(page, event => event.exception?.values?.[0].value === 'This is error #1');
const error2Req = waitForErrorRequest(page, event => event.exception?.values?.[0].value === 'This is error #2');

// We want to wait for the transaction to be done, to ensure we have a consistent test
const transactionReq = hasTracing ? waitForTransactionRequest(page) : Promise.resolve();

// Wait for this to be available
await page.waitForFunction('!!window.Replay');

// We have to start replay before we finish the transaction, otherwise the DSC will not be frozen with the Replay ID
await page.evaluate('window.Replay.start();');
await waitForReplayRunning(page);
await transactionReq;

await page.evaluate('window._triggerError(1)');

const error1Header = envelopeRequestParser(await error1Req, 0) as EventEnvelopeHeaders;
const replay = await getReplaySnapshot(page);

expect(replay.session?.id).toBeDefined();

expect(error1Header.trace).toBeDefined();
expect(error1Header.trace).toEqual({
environment: 'production',
trace_id: expect.any(String),
public_key: 'public',
replay_id: replay.session?.id,
...(hasTracing
? {
sample_rate: '1',
sampled: 'true',
}
: {}),
});

// Now end replay and trigger another error, it should not have a replay_id in DSC anymore
await page.evaluate('window.Replay.stop();');
await page.waitForFunction('!window.Replay.getReplayId();');
await page.evaluate('window._triggerError(2)');

const error2Header = envelopeRequestParser(await error2Req, 0) as EventEnvelopeHeaders;

expect(error2Header.trace).toBeDefined();
expect(error2Header.trace).toEqual({
environment: 'production',
trace_id: expect.any(String),
public_key: 'public',
...(hasTracing
? {
sample_rate: '1',
sampled: 'true',
}
: {}),
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,38 @@ const META_TAG_PARENT_SPAN_ID = '1234567890123456';
const META_TAG_BAGGAGE =
'sentry-trace_id=12345678901234567890123456789012,sentry-public_key=public,sentry-release=1.0.0,sentry-environment=prod';

sentryTest('error on initial page has traceId from meta tag', async ({ getLocalTestUrl, page }) => {
if (shouldSkipTracingTest()) {
sentryTest.skip();
}

const url = await getLocalTestUrl({ testDir: __dirname });
await page.goto(url);

const errorEventPromise = getFirstSentryEnvelopeRequest<EventAndTraceHeader>(
page,
undefined,
eventAndTraceHeaderRequestParser,
);

await page.locator('#errorBtn').click();
const [errorEvent, errorTraceHeader] = await errorEventPromise;

expect(errorEvent.type).toEqual(undefined);
expect(errorEvent.contexts?.trace).toEqual({
trace_id: META_TAG_TRACE_ID,
parent_span_id: META_TAG_PARENT_SPAN_ID,
span_id: expect.stringMatching(/^[0-9a-f]{16}$/),
});

expect(errorTraceHeader).toEqual({
environment: 'prod',
public_key: 'public',
release: '1.0.0',
trace_id: META_TAG_TRACE_ID,
});
});

sentryTest('error has new traceId after navigation', async ({ getLocalTestUrl, page }) => {
if (shouldSkipTracingTest()) {
sentryTest.skip();
Expand Down
12 changes: 10 additions & 2 deletions dev-packages/browser-integration-tests/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ export async function waitForTransactionRequestOnUrl(page: Page, url: string): P
return req;
}

export function waitForErrorRequest(page: Page): Promise<Request> {
export function waitForErrorRequest(page: Page, callback?: (event: Event) => boolean): Promise<Request> {
return page.waitForRequest(req => {
const postData = req.postData();
if (!postData) {
Expand All @@ -209,7 +209,15 @@ export function waitForErrorRequest(page: Page): Promise<Request> {
try {
const event = envelopeRequestParser(req);

return !event.type;
if (event.type) {
return false;
}

if (callback) {
return callback(event);
}

return true;
} catch {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@types/node": "18.11.17",
"@types/react": "18.0.26",
"@types/react-dom": "18.0.9",
"next": "15.0.0-canary.112",
"next": "15.0.0-canary.182",
"react": "beta",
"react-dom": "beta",
"typescript": "4.9.5"
Expand Down
24 changes: 24 additions & 0 deletions dev-packages/e2e-tests/test-applications/nuxt-4/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Nuxt dev/build outputs
.output
.data
.nuxt
.nitro
.cache
dist

# Node dependencies
node_modules

# Logs
logs
*.log

# Misc
.DS_Store
.fleet
.idea

# Local env files
.env
.env.*
!.env.example
2 changes: 2 additions & 0 deletions dev-packages/e2e-tests/test-applications/nuxt-4/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@sentry:registry=http://127.0.0.1:4873
@sentry-internal:registry=http://127.0.0.1:4873
Loading

0 comments on commit 2a1dd9a

Please sign in to comment.