Skip to content

Commit

Permalink
Merge branch 'develop' into sig/nitro-utils
Browse files Browse the repository at this point in the history
  • Loading branch information
s1gr1d authored Dec 3, 2024
2 parents 199e5a6 + 9581a2e commit 7011146
Show file tree
Hide file tree
Showing 1,064 changed files with 7,175 additions and 4,593 deletions.
2 changes: 2 additions & 0 deletions .craft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ targets:
# NPM Targets
## 1. Base Packages, node or browser SDKs depend on
## 1.1 Types
# TODO(v9): Remove
- name: npm
id: '@sentry/types'
includeNames: /^sentry-types-\d.*\.tgz$/
## 1.2 Utils
# TODO(v9): Remove
- name: npm
id: '@sentry/utils'
includeNames: /^sentry-utils-\d.*\.tgz$/
Expand Down
4 changes: 3 additions & 1 deletion .github/dependency-review-config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
fail-on-severity: 'high'
allow-ghsas:
# dependency review does not allow specific file exclusions
# we use an older version of NextJS in our tests and thus need to
# we use an older version of NextJS in our tests and thus need to
# exclude this
# once our minimum supported version is over 14.1.1 this can be removed
- GHSA-fr5h-rqp8-mj6g
# we need this for an E2E test for the minimum required version of Nuxt 3.7.0
- GHSA-v784-fjjh-f8r4
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ jobs:
if: github.event_name != 'pull_request'

- name: Compute test coverage
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}

Expand Down Expand Up @@ -491,7 +491,7 @@ jobs:
NODE_VERSION: ${{ matrix.node }}

- name: Compute test coverage
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}

Expand Down Expand Up @@ -1408,6 +1408,10 @@ jobs:
key: ${{ needs.job_build.outputs.dependency_cache_key }}
enableCrossOsArchive: true

- name: Increase yarn network timeout on Windows
if: contains(matrix.os, 'windows')
run: yarn config set network-timeout 600000 -g

- name: Install dependencies
env:
SKIP_PLAYWRIGHT_BROWSER_INSTALL: "1"
Expand All @@ -1418,10 +1422,6 @@ jobs:
run: |
git config --global --add safe.directory "*"
- name: Increase yarn network timeout on Windows
if: contains(matrix.os, 'windows')
run: yarn config set network-timeout 600000 -g

- name: Setup python
uses: actions/setup-python@v5
if: ${{ !contains(matrix.container, 'alpine') }}
Expand Down
10 changes: 5 additions & 5 deletions .size-limit.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ module.exports = [
path: 'packages/browser/build/npm/esm/index.js',
import: createImport('init', 'browserTracingIntegration'),
gzip: true,
limit: '36.5 KB',
limit: '37.5 KB',
},
{
name: '@sentry/browser (incl. Tracing, Replay)',
Expand Down Expand Up @@ -124,22 +124,22 @@ module.exports = [
import: createImport('init', 'ErrorBoundary', 'reactRouterV6BrowserTracingIntegration'),
ignore: ['react/jsx-runtime'],
gzip: true,
limit: '39.5 KB',
limit: '40.5 KB',
},
// Vue SDK (ESM)
{
name: '@sentry/vue',
path: 'packages/vue/build/esm/index.js',
import: createImport('init'),
gzip: true,
limit: '28 KB',
limit: '29 KB',
},
{
name: '@sentry/vue (incl. Tracing)',
path: 'packages/vue/build/esm/index.js',
import: createImport('init', 'browserTracingIntegration'),
gzip: true,
limit: '38.5 KB',
limit: '39.5 KB',
},
// Svelte SDK (ESM)
{
Expand Down Expand Up @@ -219,7 +219,7 @@ module.exports = [
import: createImport('init'),
ignore: ['$app/stores'],
gzip: true,
limit: '37 KB',
limit: '38 KB',
},
// Node SDK (ESM)
{
Expand Down
145 changes: 144 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,150 @@

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

Work in this release was contributed by @NEKOYASAN. Thank you for your contribution!
## 8.42.0

### Important Changes

- **feat(react): React Router v7 support (library) ([#14513](https://github.com/getsentry/sentry-javascript/pull/14513))**

This release adds support for [React Router v7 (library mode)](https://reactrouter.com/home#react-router-as-a-library).
Check out the docs on how to set up the integration: [Sentry React Router v7 Integration Docs](https://docs.sentry.io/platforms/javascript/guides/react/features/react-router/v7/)

### Deprecations

- **feat: Warn about source-map generation ([#14533](https://github.com/getsentry/sentry-javascript/pull/14533))**

In the next major version of the SDK we will change how source maps are generated when the SDK is added to an application.
Currently, the implementation varies a lot between different SDKs and can be difficult to understand.
Moving forward, our goal is to turn on source maps for every framework, unless we detect that they are explicitly turned off.
Additionally, if we end up enabling source maps, we will emit a log message that we did so.

With this particular release, we are emitting warnings that source map generation will change in the future and we print instructions on how to prepare for the next major.

- **feat(nuxt): Deprecate `tracingOptions` in favor of `vueIntegration` ([#14530](https://github.com/getsentry/sentry-javascript/pull/14530))**

Currently it is possible to configure tracing options in two places in the Sentry Nuxt SDK:

- In `Sentry.init()`
- Inside `tracingOptions` in `Sentry.init()`

For tree-shaking purposes and alignment with the Vue SDK, it is now recommended to instead use the newly exported `vueIntegration()` and its `tracingOptions` option to configure tracing options in the Nuxt SDK:

```ts
// sentry.client.config.ts
import * as Sentry from '@sentry/nuxt';

Sentry.init({
// ...
integrations: [
Sentry.vueIntegration({
tracingOptions: {
trackComponents: true,
},
}),
],
});
```

### Other Changes

- feat(browser-utils): Update `web-vitals` to v4.2.4 ([#14439](https://github.com/getsentry/sentry-javascript/pull/14439))
- feat(nuxt): Expose `vueIntegration` ([#14526](https://github.com/getsentry/sentry-javascript/pull/14526))
- fix(feedback): Handle css correctly in screenshot mode ([#14535](https://github.com/getsentry/sentry-javascript/pull/14535))

## 8.41.0

### Important Changes

- **meta(nuxt): Require minimum Nuxt v3.7.0 ([#14473](https://github.com/getsentry/sentry-javascript/pull/14473))**

We formalized that the Nuxt SDK is at minimum compatible with Nuxt version 3.7.0 and above.
Additionally, the SDK requires the implicit `nitropack` dependency to satisfy version `^2.10.0` and `ofetch` to satisfy `^1.4.0`.
It is recommended to check your lock-files and manually upgrade these dependencies if they don't match the version ranges.

### Deprecations

We are deprecating a few APIs which will be removed in the next major.

The following deprecations will _potentially_ affect you:

- **feat(core): Update & deprecate `undefined` option handling ([#14450](https://github.com/getsentry/sentry-javascript/pull/14450))**

In the next major version we will change how passing `undefined` to `tracesSampleRate` / `tracesSampler` / `enableTracing` will behave.

Currently, doing the following:

```ts
Sentry.init({
tracesSampleRate: undefined,
});
```

Will result in tracing being _enabled_ (although no spans will be generated) because the `tracesSampleRate` key is present in the options object.
In the next major version, this behavior will be changed so that passing `undefined` (or rather having a `tracesSampleRate` key) will result in tracing being disabled, the same as not passing the option at all.
If you are currently relying on `undefined` being passed, and and thus have tracing enabled, it is recommended to update your config to set e.g. `tracesSampleRate: 0` instead, which will also enable tracing in v9.

The same applies to `tracesSampler` and `enableTracing`.

- **feat(core): Log warnings when returning `null` in `beforeSendSpan` ([#14433](https://github.com/getsentry/sentry-javascript/pull/14433))**

Currently, the `beforeSendSpan` option in `Sentry.init()` allows you to drop individual spans from a trace by returning `null` from the hook.
Since this API lends itself to creating "gaps" inside traces, we decided to change how this API will work in the next major version.

With the next major version the `beforeSendSpan` API can only be used to mutate spans, but no longer to drop them.
With this release the SDK will warn you if you are using this API to drop spans.
Instead, it is recommended to configure instrumentation (i.e. integrations) directly to control what spans are created.

Additionally, with the next major version, root spans will also be passed to `beforeSendSpan`.

- **feat(utils): Deprecate `@sentry/utils` ([#14431](https://github.com/getsentry/sentry-javascript/pull/14431))**

With the next major version the `@sentry/utils` package will be merged into the `@sentry/core` package.
It is therefore no longer recommended to use the `@sentry/utils` package.

- **feat(vue): Deprecate configuring Vue tracing options anywhere else other than through the `vueIntegration`'s `tracingOptions` option ([#14385](https://github.com/getsentry/sentry-javascript/pull/14385))**

Currently it is possible to configure tracing options in various places in the Sentry Vue SDK:

- In `Sentry.init()`
- Inside `tracingOptions` in `Sentry.init()`
- In the `vueIntegration()` options
- Inside `tracingOptions` in the `vueIntegration()` options

Because this is a bit messy and confusing to document, the only recommended way to configure tracing options going forward is through the `tracingOptions` in the `vueIntegration()`.
The other means of configuration will be removed in the next major version of the SDK.

- **feat: Deprecate `registerEsmLoaderHooks.include` and `registerEsmLoaderHooks.exclude` ([#14486](https://github.com/getsentry/sentry-javascript/pull/14486))**

Currently it is possible to define `registerEsmLoaderHooks.include` and `registerEsmLoaderHooks.exclude` options in `Sentry.init()` to only apply ESM loader hooks to a subset of modules.
This API served as an escape hatch in case certain modules are incompatible with ESM loader hooks.

Since this API was introduced, a way was found to only wrap modules that there exists instrumentation for (meaning a vetted list).
To only wrap modules that have instrumentation, it is recommended to instead set `registerEsmLoaderHooks.onlyIncludeInstrumentedModules` to `true`.

Note that `onlyIncludeInstrumentedModules: true` will become the default behavior in the next major version and the `registerEsmLoaderHooks` will no longer accept fine-grained options.

The following deprecations will _most likely_ not affect you unless you are building an SDK yourself:

- feat(core): Deprecate `arrayify` ([#14405](https://github.com/getsentry/sentry-javascript/pull/14405))
- feat(core): Deprecate `flatten` ([#14454](https://github.com/getsentry/sentry-javascript/pull/14454))
- feat(core): Deprecate `urlEncode` ([#14406](https://github.com/getsentry/sentry-javascript/pull/14406))
- feat(core): Deprecate `validSeverityLevels` ([#14407](https://github.com/getsentry/sentry-javascript/pull/14407))
- feat(core/utils): Deprecate `getNumberOfUrlSegments` ([#14458](https://github.com/getsentry/sentry-javascript/pull/14458))
- feat(utils): Deprecate `memoBuilder`, `BAGGAGE_HEADER_NAME`, and `makeFifoCache` ([#14434](https://github.com/getsentry/sentry-javascript/pull/14434))
- feat(utils/core): Deprecate `addRequestDataToEvent` and `extractRequestData` ([#14430](https://github.com/getsentry/sentry-javascript/pull/14430))

### Other Changes

- feat: Streamline `sentry-trace`, `baggage` and DSC handling ([#14364](https://github.com/getsentry/sentry-javascript/pull/14364))
- feat(core): Further optimize debug ID parsing ([#14365](https://github.com/getsentry/sentry-javascript/pull/14365))
- feat(node): Add `openTelemetryInstrumentations` option ([#14484](https://github.com/getsentry/sentry-javascript/pull/14484))
- feat(nuxt): Add filter for not found source maps (devtools) ([#14437](https://github.com/getsentry/sentry-javascript/pull/14437))
- feat(nuxt): Only delete public source maps ([#14438](https://github.com/getsentry/sentry-javascript/pull/14438))
- fix(nextjs): Don't report `NEXT_REDIRECT` from browser ([#14440](https://github.com/getsentry/sentry-javascript/pull/14440))
- perf(opentelemetry): Bucket spans for cleanup ([#14154](https://github.com/getsentry/sentry-javascript/pull/14154))

Work in this release was contributed by @NEKOYASAN and @fmorett. Thank you for your contributions!

## 8.40.0

Expand Down
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,6 @@ below:
Provides the integration for Session Replay.
- [`@sentry/core`](https://github.com/getsentry/sentry-javascript/tree/master/packages/core): The base for all
JavaScript SDKs with interfaces, type definitions and base classes.
- [`@sentry/utils`](https://github.com/getsentry/sentry-javascript/tree/master/packages/utils): A set of helpers and
utility functions useful for various SDKs.
- [`@sentry/types`](https://github.com/getsentry/sentry-javascript/tree/master/packages/types): Types used in all
packages.

## Bug Bounty Program

Expand Down
3 changes: 3 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@
"angular.json",
"ember/instance-initializers/**",
"ember/types.d.ts",
"solidstart/*.d.ts",
"solidstart/client/",
"solidstart/server/",
".output",
".vinxi"
]
Expand Down
4 changes: 2 additions & 2 deletions dev-packages/browser-integration-tests/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry-internal/browser-integration-tests",
"version": "8.40.0",
"version": "8.42.0",
"main": "index.js",
"license": "MIT",
"engines": {
Expand Down Expand Up @@ -43,7 +43,7 @@
"@babel/preset-typescript": "^7.16.7",
"@playwright/test": "^1.44.1",
"@sentry-internal/rrweb": "2.29.0",
"@sentry/browser": "8.40.0",
"@sentry/browser": "8.42.0",
"axios": "1.7.7",
"babel-loader": "^8.2.2",
"html-webpack-plugin": "^5.5.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from '@playwright/test';
import type { Event } from '@sentry/types';
import type { Event } from '@sentry/core';

import { sentryTest } from '../../../../../utils/fixtures';
import { getFirstSentryEnvelopeRequest } from '../../../../../utils/helpers';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from '@playwright/test';
import type { Event } from '@sentry/types';
import type { Event } from '@sentry/core';

import { sentryTest } from '../../../../../utils/fixtures';
import { getFirstSentryEnvelopeRequest } from '../../../../../utils/helpers';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from '@playwright/test';
import type { Event } from '@sentry/types';
import type { Event } from '@sentry/core';

import { sentryTest } from '../../../../../utils/fixtures';
import { getFirstSentryEnvelopeRequest } from '../../../../../utils/helpers';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from '@playwright/test';
import type { Event } from '@sentry/types';
import type { Event } from '@sentry/core';

import { sentryTest } from '../../../../../utils/fixtures';
import { getFirstSentryEnvelopeRequest } from '../../../../../utils/helpers';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from '@playwright/test';
import type { Event } from '@sentry/types';
import type { Event } from '@sentry/core';

import { sentryTest } from '../../../../../utils/fixtures';
import { getFirstSentryEnvelopeRequest } from '../../../../../utils/helpers';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from '@playwright/test';
import type { Event } from '@sentry/types';
import type { Event } from '@sentry/core';

import { sentryTest } from '../../../../../utils/fixtures';
import { getFirstSentryEnvelopeRequest } from '../../../../../utils/helpers';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from '@playwright/test';
import type { Event } from '@sentry/types';
import type { Event } from '@sentry/core';

import { sentryTest } from '../../../../../utils/fixtures';
import { getFirstSentryEnvelopeRequest } from '../../../../../utils/helpers';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from '@playwright/test';
import type { Event } from '@sentry/types';
import type { Event } from '@sentry/core';

import { sentryTest } from '../../../../../utils/fixtures';
import { getFirstSentryEnvelopeRequest } from '../../../../../utils/helpers';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from '@playwright/test';
import type { Event } from '@sentry/types';
import type { Event } from '@sentry/core';

import { sentryTest } from '../../../../../utils/fixtures';
import { getFirstSentryEnvelopeRequest } from '../../../../../utils/helpers';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from '@playwright/test';
import type { Event } from '@sentry/types';
import type { Event } from '@sentry/core';

import { sentryTest } from '../../../../../utils/fixtures';
import { getFirstSentryEnvelopeRequest } from '../../../../../utils/helpers';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ sentryTest('should not add source context lines to errors from script files', as
const url = await getLocalTestUrl({ testDir: __dirname });

const eventReqPromise = waitForErrorRequestOnUrl(page, url);
await page.waitForFunction('window.Sentry');

const clickPromise = page.locator('#script-error-btn').click();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from '@playwright/test';
import type { Event } from '@sentry/types';
import type { Event } from '@sentry/core';

import { sentryTest } from '../../../utils/fixtures';
import { getMultipleSentryEnvelopeRequests } from '../../../utils/helpers';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from '@playwright/test';
import type { Event } from '@sentry/types';
import type { Event } from '@sentry/core';

import { sentryTest } from '../../../../utils/fixtures';
import { getMultipleSentryEnvelopeRequests } from '../../../../utils/helpers';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from '@playwright/test';
import type { Event } from '@sentry/types';
import type { Event } from '@sentry/core';

import { sentryTest } from '../../../utils/fixtures';
import { getFirstSentryEnvelopeRequest } from '../../../utils/helpers';
Expand Down
Loading

0 comments on commit 7011146

Please sign in to comment.