Skip to content

Commit

Permalink
Merge branch 'develop' into feat/component-names
Browse files Browse the repository at this point in the history
  • Loading branch information
0Calories authored Dec 19, 2023
2 parents 365f24d + ce9efc7 commit 0507f8c
Show file tree
Hide file tree
Showing 361 changed files with 23,925 additions and 3,494 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ jobs:
- name: Set up Deno
uses: denoland/[email protected]
with:
deno-version: v1.37.1
deno-version: v1.38.5
- name: Restore caches
uses: ./.github/actions/restore-cache
env:
Expand Down Expand Up @@ -864,13 +864,16 @@ jobs:
'create-remix-app-v2',
'debug-id-sourcemaps',
'nextjs-app-dir',
'nextjs-14',
'react-create-hash-router',
'react-router-6-use-routes',
'standard-frontend-react',
'standard-frontend-react-tracing-import',
'sveltekit',
'sveltekit-2',
'generic-ts3.8',
'node-experimental-fastify-app',
'node-hapi-app',
]
build-command:
- false
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ jobs:
- test-application: 'nextjs-app-dir'
build-command: 'test:build-latest'
label: 'nextjs-app-dir (latest)'
- test-application: 'nextjs-14'
build-command: 'test:build-canary'
label: 'nextjs-14 (canary)'
- test-application: 'nextjs-14'
build-command: 'test:build-latest'
label: 'nextjs-14 (latest)'
- test-application: 'react-create-hash-router'
build-command: 'test:build-canary'
label: 'react-create-hash-router (canary)'
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ tmp.js
.eslintcache
**/eslintcache/*

# node worker scripts
packages/node/src/integrations/anr/worker-script.*

# deno
packages/deno/build-types
packages/deno/build-test
Expand Down
3 changes: 3 additions & 0 deletions .size-limit.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,21 @@ module.exports = [
name: '@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (minified & uncompressed)',
path: 'packages/browser/build/bundles/bundle.tracing.replay.min.js',
gzip: false,
brotli: false,
limit: '260 KB',
},
{
name: '@sentry/browser (incl. Tracing) - ES6 CDN Bundle (minified & uncompressed)',
path: 'packages/browser/build/bundles/bundle.tracing.min.js',
gzip: false,
brotli: false,
limit: '100 KB',
},
{
name: '@sentry/browser - ES6 CDN Bundle (minified & uncompressed)',
path: 'packages/browser/build/bundles/bundle.min.js',
gzip: false,
brotli: false,
limit: '70 KB',
},

Expand Down
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
],
"deno.enablePaths": ["packages/deno/test"],
"editor.codeActionsOnSave": {
"source.organizeImports.biome": true,
"quickfix.biome": true
"source.organizeImports.biome": "explicit",
"quickfix.biome": "explicit"
},
"editor.defaultFormatter": "biomejs.biome"
}
139 changes: 139 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,145 @@

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

## 7.89.0

### Important Changes

#### Deprecations

- **feat(core): Deprecate `configureScope` (#9887)**
- **feat(core): Deprecate `pushScope` & `popScope` (#9890)**

This release deprecates `configureScope`, `pushScope`, and `popScope`, which will be removed in the upcoming v8 major release.

#### Hapi Integration

- **feat(node): Add Hapi Integration (#9539)**

This release adds an integration for Hapi. It can be used as follows:

```ts
const Sentry = require('@sentry/node');
const Hapi = require('@hapi/hapi');

const init = async () => {
const server = Hapi.server({
// your server configuration ...
});

Sentry.init({
dsn: '__DSN__',
tracesSampleRate: 1.0,
integrations: [
new Sentry.Integrations.Hapi({ server }),
],
});

server.route({
// your route configuration ...
});

await server.start();
};
```

#### SvelteKit 2.0

- **chore(sveltekit): Add SvelteKit 2.0 to peer dependencies (#9861)**

This release adds support for SvelteKit 2.0 in the `@sentry/sveltekit` package. If you're upgrading from SvelteKit 1.x to 2.x and already use the Sentry SvelteKit SDK, no changes apart from upgrading to this (or a newer) version are necessary.

### Other Changes

- feat(core): Add type & utility for function-based integrations (#9818)
- feat(core): Update `withScope` to return callback return value (#9866)
- feat(deno): Support `Deno.CronSchedule` for cron jobs (#9880)
- feat(nextjs): Auto instrument generation functions (#9781)
- feat(nextjs): Connect server component transactions if there is no incoming trace (#9845)
- feat(node-experimental): Update to new Scope APIs (#9799)
- feat(replay): Add `canvas.type` setting (#9877)
- fix(nextjs): Export `createReduxEnhancer` (#9854)
- fix(remix): Do not capture thrown redirect responses. (#9909)
- fix(sveltekit): Add conditional exports (#9872)
- fix(sveltekit): Avoid capturing 404 errors on client side (#9902)
- fix(utils): Do not use `Event` type in worldwide (#9864)
- fix(utils): Support crypto.getRandomValues in old Chromium versions (#9251)
- fix(utils): Update `eventFromUnknownInput` to avoid scope pollution & `getCurrentHub` (#9868)
- ref: Use `addBreadcrumb` directly & allow to pass hint (#9867)

Work in this release contributed by @adam187, and @jghinestrosa. Thank you for your contributions!

## 7.88.0

### Important Changes

- **feat(browser): Add browser metrics sdk (#9794)**

The release adds alpha support for [Sentry developer metrics](https://github.com/getsentry/sentry/discussions/58584) in the Browser SDKs (`@sentry/browser` and related framework SDKs). Via the newly introduced APIs, you can now flush metrics directly to Sentry.

To enable capturing metrics, you first need to add the `MetricsAggregator` integration.

```js
Sentry.init({
dsn: '__DSN__',
integrations: [
new Sentry.metrics.MetricsAggregator(),
],
});
```

Then you'll be able to add `counters`, `sets`, `distributions`, and `gauges` under the `Sentry.metrics` namespace.

```js
// Add 4 to a counter named `hits`
Sentry.metrics.increment('hits', 4);

// Add 2 to gauge named `parallel_requests`, tagged with `happy: "no"`
Sentry.metrics.gauge('parallel_requests', 2, { tags: { happy: 'no' } });

// Add 4.6 to a distribution named `response_time` with unit seconds
Sentry.metrics.distribution('response_time', 4.6, { unit: 'seconds' });

// Add 2 to a set named `valuable.ids`
Sentry.metrics.set('valuable.ids', 2);
```

In a future release we'll add support for server runtimes (Node, Deno, Bun, Vercel Edge, etc.)

- **feat(deno): Optionally instrument `Deno.cron` (#9808)**

This releases add support for instrumenting [Deno cron's](https://deno.com/blog/cron) with [Sentry cron monitors](https://docs.sentry.io/product/crons/). This requires v1.38 of Deno run with the `--unstable` flag and the usage of the `DenoCron` Sentry integration.

```ts
// Import from the Deno registry
import * as Sentry from "https://deno.land/x/sentry/index.mjs";

Sentry.init({
dsn: '__DSN__',
integrations: [
new Sentry.DenoCron(),
],
});
```

### Other Changes

- feat(replay): Bump `rrweb` to 2.6.0 (#9847)
- fix(nextjs): Guard against injecting multiple times (#9807)
- ref(remix): Bump Sentry CLI to ^2.23.0 (#9773)

## 7.87.0

- feat: Add top level `getCurrentScope()` method (#9800)
- feat(replay): Bump `rrweb` to 2.5.0 (#9803)
- feat(replay): Capture hydration error breadcrumb (#9759)
- feat(types): Add profile envelope types (#9798)
- fix(astro): Avoid RegExp creation during route interpolation (#9815)
- fix(browser): Avoid importing from `./exports` (#9775)
- fix(nextjs): Catch rejecting flushes (#9811)
- fix(nextjs): Fix devserver CORS blockage when `assetPrefix` is defined (#9766)
- fix(node): Capture errors in tRPC middleware (#9782)

## 7.86.0

- feat(core): Use SDK_VERSION for hub API version (#9732)
Expand Down
12 changes: 12 additions & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@ npx @sentry/migr8@latest

This will let you select which updates to run, and automatically update your code. Make sure to still review all code changes!

## Deprecate `pushScope` & `popScope` in favor of `withScope`

Instead of manually pushing/popping a scope, you should use `Sentry.withScope(callback: (scope: Scope))` instead.

## Deprecate `configureScope` in favor of using `getCurrentScope()`

Instead of updating the scope in a callback via `configureScope()`, you should access it via `getCurrentScope()` and configure it directly:

```js
Sentry.getCurrentScope().setTag('xx', 'yy');
```

## Deprecate `addGlobalEventProcessor` in favor of `addEventProcessor`

Instead of using `addGlobalEventProcessor`, you should use `addEventProcessor` which does not add the event processor globally, but to the current client.
Expand Down
5 changes: 5 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ codecov:
notify:
require_ci_to_pass: no

ai_pr_review:
enabled: true
method: "label"
label_name: "ci-codecov-ai-review"

coverage:
precision: 2
round: down
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "7.86.0",
"version": "7.89.0",
"npmClient": "yarn"
}
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@
"@rollup/plugin-replace": "^3.0.1",
"@rollup/plugin-sucrase": "^4.0.3",
"@rollup/plugin-typescript": "^8.3.1",
"@size-limit/preset-small-lib": "~9.0.0",
"@size-limit/webpack": "~9.0.0",
"@size-limit/file": "~11.0.1",
"@size-limit/webpack": "~11.0.1",
"@strictsoftware/typedoc-plugin-monorepo": "^0.3.1",
"@types/chai": "^4.1.3",
"@types/jest": "^27.4.1",
Expand Down Expand Up @@ -124,7 +124,7 @@
"rollup-plugin-license": "^2.6.1",
"rollup-plugin-terser": "^7.0.2",
"sinon": "^7.3.2",
"size-limit": "~9.0.0",
"size-limit": "~11.0.1",
"ts-jest": "^27.1.4",
"ts-node": "10.9.1",
"typedoc": "^0.18.0",
Expand Down
8 changes: 4 additions & 4 deletions packages/angular-ivy/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry/angular-ivy",
"version": "7.86.0",
"version": "7.89.0",
"description": "Official Sentry SDK for Angular with full Ivy Support",
"repository": "git://github.com/getsentry/sentry-javascript.git",
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/angular-ivy",
Expand All @@ -21,9 +21,9 @@
"rxjs": "^6.5.5 || ^7.x"
},
"dependencies": {
"@sentry/browser": "7.86.0",
"@sentry/types": "7.86.0",
"@sentry/utils": "7.86.0",
"@sentry/browser": "7.89.0",
"@sentry/types": "7.89.0",
"@sentry/utils": "7.89.0",
"tslib": "^2.4.1"
},
"devDependencies": {
Expand Down
8 changes: 4 additions & 4 deletions packages/angular/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry/angular",
"version": "7.86.0",
"version": "7.89.0",
"description": "Official Sentry SDK for Angular",
"repository": "git://github.com/getsentry/sentry-javascript.git",
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/angular",
Expand All @@ -21,9 +21,9 @@
"rxjs": "^6.5.5 || ^7.x"
},
"dependencies": {
"@sentry/browser": "7.86.0",
"@sentry/types": "7.86.0",
"@sentry/utils": "7.86.0",
"@sentry/browser": "7.89.0",
"@sentry/types": "7.89.0",
"@sentry/utils": "7.89.0",
"tslib": "^2.4.1"
},
"devDependencies": {
Expand Down
11 changes: 2 additions & 9 deletions packages/angular/src/tracing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type { ActivatedRouteSnapshot, Event, RouterState } from '@angular/router
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
import { NavigationCancel, NavigationError, Router } from '@angular/router';
import { NavigationEnd, NavigationStart, ResolveEnd } from '@angular/router';
import { WINDOW, getCurrentHub } from '@sentry/browser';
import { WINDOW, getCurrentScope } from '@sentry/browser';
import type { Span, Transaction, TransactionContext } from '@sentry/types';
import { logger, stripUrlQueryAndFragment, timestampInSeconds } from '@sentry/utils';
import type { Observable } from 'rxjs';
Expand Down Expand Up @@ -50,14 +50,7 @@ export const instrumentAngularRouting = routingInstrumentation;
* Grabs active transaction off scope
*/
export function getActiveTransaction(): Transaction | undefined {
const currentHub = getCurrentHub();

if (currentHub) {
const scope = currentHub.getScope();
return scope.getTransaction();
}

return undefined;
return getCurrentScope().getTransaction();
}

/**
Expand Down
12 changes: 4 additions & 8 deletions packages/angular/test/tracing.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,12 @@ jest.mock('@sentry/browser', () => {
const original = jest.requireActual('@sentry/browser');
return {
...original,
getCurrentHub: () => {
getCurrentScope() {
return {
getScope: () => {
return {
getTransaction: () => {
return transaction;
},
};
getTransaction: () => {
return transaction;
},
} as unknown as Hub;
};
},
};
});
Expand Down
12 changes: 6 additions & 6 deletions packages/astro/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry/astro",
"version": "7.86.0",
"version": "7.89.0",
"description": "Official Sentry SDK for Astro",
"repository": "git://github.com/getsentry/sentry-javascript.git",
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/astro",
Expand Down Expand Up @@ -43,11 +43,11 @@
"astro": ">=3.x || >=4.0.0-beta"
},
"dependencies": {
"@sentry/browser": "7.86.0",
"@sentry/core": "7.86.0",
"@sentry/node": "7.86.0",
"@sentry/types": "7.86.0",
"@sentry/utils": "7.86.0",
"@sentry/browser": "7.89.0",
"@sentry/core": "7.89.0",
"@sentry/node": "7.89.0",
"@sentry/types": "7.89.0",
"@sentry/utils": "7.89.0",
"@sentry/vite-plugin": "^2.8.0"
},
"devDependencies": {
Expand Down
Loading

0 comments on commit 0507f8c

Please sign in to comment.