Skip to content

Commit

Permalink
Merge branch 'develop' into abhi-profiling-node-experimental
Browse files Browse the repository at this point in the history
  • Loading branch information
AbhiPrasad committed Mar 22, 2024
2 parents 9aa11a2 + b846671 commit 8c4e908
Show file tree
Hide file tree
Showing 219 changed files with 378 additions and 660 deletions.
8 changes: 4 additions & 4 deletions .craft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ targets:
- name: npm
id: '@sentry-internal/tracing'
includeNames: /^sentry-internal-tracing-\d.*\.tgz$/
## 1.5 Replay package (browser only)
## 1.5 Replay Internal package (browser only)
- name: npm
id: '@sentry/replay'
includeNames: /^sentry-replay-\d.*\.tgz$/
## 1.6. OpenTelemetry package
id: '@sentry-internal/replay'
includeNames: /^sentry-internal-replay-\d.*\.tgz$/
## 1.6 OpenTelemetry package
- name: npm
id: '@sentry/opentelemetry'
includeNames: /^sentry-opentelemetry-\d.*\.tgz$/
Expand Down
61 changes: 61 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,67 @@

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

## 8.0.0-alpha.5

This is the fifth alpha release of Sentry JavaScript SDK v8, which includes a variety of breaking changes.

Read the [in-depth migration guide](./MIGRATION.md) to find out how to address any breaking changes in your code.

### Important Changes

- **feat(nextjs): Remove `client.(server|client).config.ts` functionality in favor of `instrumentation.ts` (#11059)**
- feat(nextjs): Bump minimum required Next.js version to `13.2.0` (#11097)

With version 8 of the SDK we will no longer support the use of `sentry.server.config.ts` and `sentry.edge.config.ts`
files. Instead, please initialize the Sentry Next.js SDK for the serverside in a
[Next.js instrumentation hook](https://nextjs.org/docs/app/building-your-application/optimizing/instrumentation).
**`sentry.client.config.ts|js` is still supported and encouraged for initializing the clientside SDK.** Please see the
[Migration Guide](./MIGRATION.md#updated-the-recommended-way-of-calling-sentryinit) for more details.

In addition, the Next.js SDK now requires a minimum Next.js version of `13.2.0`.

### Removal/Refactoring of deprecated functionality

- feat(aws-serverless): Remove deprecated `rethrowAfterCapture` option (#11126)
- feat(node): Remove deprecated/duplicate/unused definitions (#11120)
- feat(v8): Remove deprecated integration methods on client (#11134)
- feat(v8/browser): Remove class export for linked errors (#11129)
- feat(v8/browser): Remove deprecated wrap export (#11127)
- feat(v8/core): Remove deprecated client.setupIntegrations method (#11179)
- feat(v8/core): Remove deprecated integration classes (#11132)
- feat(v8/ember): Remove InitSentryForEmber export (#11202)
- feat(v8/nextjs): Remove usage of class integrations (#11182)
- feat(v8/replay): Delete deprecated types (#11177)
- feat(v8/utils): Remove deprecated util functions (#11143)
- ref(node): Remove class based export for local variable integration (#11128)

### Other Changes

- feat(browser): Make fetch the default transport for offline (#11209)
- feat(core): Filter out noisy GoogleTag error by default (#11208)
- feat(deps): Bump @sentry/cli from 2.30.0 to 2.30.2 (#11168)
- feat(nextjs): Prefix webpack plugin log messages with runtime (#11173)
- feat(node-profiling): Output ESM and remove Sentry deps from output (#11135)
- feat(node): Allow Anr worker to be stopped and restarted (#11214)
- feat(node): Support `tunnel` option for ANR (#11163)
- feat(opentelemetry): Do not capture exceptions for timed events (#11221)
- feat(serverless): Add Node.js 20 to compatible runtimes (#11103)
- feat(sveltekit): Switch to Otel-based `@sentry/node` package (#11075)
- fix(attachments): Add missing `view_hierarchy` attachment type (#11197)
- fix(build): Ensure tree shaking works properly for ESM output (#11122)
- fix(feedback): Only allow screenshots in secure contexts (#11188)
- fix(feedback): Reduce force layout in screenshots (#11181)
- fix(feedback): Smoother cropping experience and better UI (#11165)
- fix(feedback): Fix screenshot black bars in Safari (#11233)
- fix(metrics): use correct statsd data category (#11184)
- fix(metrics): use web-vitals ttfb calculation (#11185)
- fix(node): Export `initOpenTelemetry` (#11158)
- fix(node): Clear ANR timer on stop (#11229)
- fix(node): Time zone handling for `cron` (#11225)
- fix(node): Use unique variable for ANR context transfer (#11161)
- fix(opentelemetry): Do not stomp span error status (#11169)
- fix(types): Fix incorrect `sampled` type on `Transaction` (#11115)

## 8.0.0-alpha.4

This is the fourth Alpha release of the v8 cycle, which includes a variety of breaking changes.
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 Functional Software, Inc. dba Sentry
Copyright (c) 2024 Functional Software, Inc. dba Sentry

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
22 changes: 15 additions & 7 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ stable release of `8.x` comes out).
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 ES2017+ compatible
**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.

New minimum supported browsers:

- Chrome 58
- Edge 15
- Safari/iOS Safari 11
- Firefox 54
- Opera 45
- Samsung Internet 7.2
- Chrome 63
- Edge 79
- Safari/iOS Safari 12
- Firefox 58
- Opera 50
- Samsung Internet 8.2

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

Expand Down Expand Up @@ -577,6 +577,8 @@ Removed top-level exports: `Offline`, `makeXHRTransport`, `BrowserTracing`, `wra
- [Removal of Offline integration](./MIGRATION.md#removal-of-the-offline-integration)
- [Removal of `makeXHRTransport` transport](./MIGRATION.md#removal-of-makexhrtransport-transport)
- [Removal of `wrap` method](./MIGRATION.md#removal-of-wrap-method)
- [Removal of `@sentry/angular-ivy` package](./MIGRATION.md#removal-of-sentryangular-ivy-package)
- [Removal of `@sentry/replay` package](./MIGRATION.md#removal-of-sentryreplay-package)

#### Removal of the `BrowserTracing` integration

Expand Down Expand Up @@ -605,6 +607,10 @@ requires at least Angular 14. If you are using Angular 13 or lower, we suggest u
migrating to v8. If you can't upgrade your Angular version to at least Angular 14, you can also continue using the
`@sentry/angular-ivy@7` SDK. However, v7 of the SDKs will no longer be fully supported going forward.

#### Removal of `@sentry/replay` package

You can import from `@sentry/browser` (or from a respective SDK package like `@sentry/react` or `@sentry/vue`).

### Server-side SDKs (Node, Deno, Bun, etc.)

Removed top-level exports: `enableAnrDetection`, `Anr`, `deepReadDirSync`
Expand Down Expand Up @@ -907,6 +913,8 @@ SDK.
- [Updated behaviour of `transactionContext` passed to `tracesSampler`](./MIGRATION.md#transactioncontext-no-longer-passed-to-tracessampler)
- [Updated behaviour of `getClient()`](./MIGRATION.md#getclient-always-returns-a-client)
- [Removal of Client-Side health check transaction filters](./MIGRATION.md#removal-of-client-side-health-check-transaction-filters)
- [Change of Replay default options (`unblock` and `unmask`)](./MIGRATION.md#change-of-replay-default-options-unblock-and-unmask)
- [Angular Tracing Decorator renaming](./MIGRATION.md#angular-tracing-decorator-renaming)

#### Updated behaviour of `tracePropagationTargets` in the browser (HTTP tracing headers & CORS)

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ Besides the high-level SDKs, this repository contains shared packages, helpers a
development. If you're thinking about contributing to or creating a JavaScript-based SDK, have a look at the resources
below:

- [`@sentry/replay`](https://github.com/getsentry/sentry-javascript/tree/master/packages/replay): Provides the
integration for Session Replay.
- [`@sentry-internal/replay`](https://github.com/getsentry/sentry-javascript/tree/master/packages/replay-internal):
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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect } from '@playwright/test';
import type { replayIntegration as actualReplayIntegration } from '@sentry/replay';
import type { ReplayContainer } from '@sentry/replay/build/npm/types/types';
import type { replayIntegration as actualReplayIntegration } from '@sentry-internal/replay';
import type { ReplayContainer } from '@sentry-internal/replay/build/npm/types/types';

import { sentryTest } from '../../../utils/fixtures';
import { envelopeRequestParser, waitForErrorRequest } from '../../../utils/helpers';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { replayIntegration } from '@sentry-internal/replay';
import * as Sentry from '@sentry/browser';
import { replayIntegration } from '@sentry/replay';

window.Sentry = Sentry;
window.Replay = replayIntegration({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { SDK_VERSION } from '@sentry/browser';
import { sentryTest } from '../../../utils/fixtures';
import { getReplayEvent, shouldSkipReplayTest, waitForReplayRequest } from '../../../utils/replayHelpers';

sentryTest('should capture replays (@sentry/replay export)', async ({ getLocalTestPath, page }) => {
sentryTest('should capture replays (@sentry-internal/replay export)', async ({ getLocalTestPath, page }) => {
if (shouldSkipReplayTest()) {
sentryTest.skip();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class SentryScenarioGenerationPlugin {
? {
// To help Webpack resolve Sentry modules in `import` statements in cases where they're provided in bundles rather than in `node_modules`
'@sentry/browser': 'Sentry',
'@sentry/replay': 'Sentry',
'@sentry-internal/replay': 'Sentry',
'@sentry/wasm': 'Sentry',
}
: {};
Expand Down
8 changes: 4 additions & 4 deletions dev-packages/browser-integration-tests/utils/replayHelpers.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import type { Page, Request, Response } from '@playwright/test';
/* eslint-disable max-lines */
import type { ReplayCanvasIntegrationOptions } from '@sentry-internal/replay-canvas';
import type { fullSnapshotEvent, incrementalSnapshotEvent } from '@sentry-internal/rrweb';
import { EventType } from '@sentry-internal/rrweb';
import type { ReplayEventWithTime } from '@sentry/browser';
import type {
InternalEventContext,
RecordingEvent,
ReplayContainer,
ReplayPluginOptions,
Session,
} from '@sentry/replay/build/npm/types/types';
} from '@sentry-internal/replay/build/npm/types/types';
import type { fullSnapshotEvent, incrementalSnapshotEvent } from '@sentry-internal/rrweb';
import { EventType } from '@sentry-internal/rrweb';
import type { ReplayEventWithTime } from '@sentry/browser';
import type { Breadcrumb, Event, ReplayEvent, ReplayRecordingMode } from '@sentry/types';
import pako from 'pako';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "es2017",
"target": "es2018",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "es2017",
"target": "es2018",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// biome-ignore lint/nursery/noUnusedImports:
import * as _SentryReplay from '@sentry-internal/replay';
// biome-ignore lint/nursery/noUnusedImports: we need to import the SDK to ensure tsc check the types
import * as _SentryBrowser from '@sentry/browser';
// biome-ignore lint/nursery/noUnusedImports:
import * as _SentryCore from '@sentry/core';
// biome-ignore lint/nursery/noUnusedImports:
import * as _SentryNode from '@sentry/node';
// biome-ignore lint/nursery/noUnusedImports:
import * as _SentryReplay from '@sentry/replay';
// biome-ignore lint/nursery/noUnusedImports:
import * as _SentryTypes from '@sentry/types';
// biome-ignore lint/nursery/noUnusedImports:
import * as _SentryUtils from '@sentry/utils';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@sentry/browser": "latest || *",
"@sentry/core": "latest || *",
"@sentry/node": "latest || *",
"@sentry/replay": "latest || *",
"@sentry-internal/replay": "latest || *",
"@sentry/types": "latest || *",
"@sentry/utils": "latest || *",
"@sentry/wasm": "latest || *"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"include": ["index.ts"],
"compilerOptions": {
"lib": ["es2017", "DOM"],
"lib": ["es2018", "DOM"],
"skipLibCheck": false,
"noEmit": true,
"types": [],
"target": "es2017",
"target": "es2018",
"moduleResolution": "node"
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "es2017",
"target": "es2018",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "es2017",
"target": "es2018",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"compilerOptions": {
"types": ["node"],
"esModuleInterop": true,
"lib": ["es2017"],
"lib": ["es2018"],
"strict": true,
"outDir": "dist",
"target": "ESNext",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"compilerOptions": {
"types": ["node"],
"esModuleInterop": true,
"lib": ["es2017"],
"lib": ["es2018"],
"strict": true,
"outDir": "dist"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "es2017",
"target": "es2018",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "es2017",
"target": "es2018",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "es2017",
"target": "es2018",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,7 @@
<li>
<a id="redirectLink" href="/redirect1">Redirect</a>
</li>
<li>
<a href="/server-load-fetch">Route with nested fetch in server load</a>
</li>
</ul>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export const load = async ({ fetch }) => {
const res = await fetch('/api/users');
const data = await res.json();
return { data };
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<script lang="ts">
export let data;
</script>

<main>
<h1>Server Load Fetch</h1>
<p>{JSON.stringify(data, null, 2)}</p>
</main>
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { expect, test } from '@playwright/test';
import { waitForTransaction } from '../event-proxy-server';

test('server pageload request span has nested request span for sub request', async ({ page }) => {
const serverTxnEventPromise = waitForTransaction('sveltekit-2', txnEvent => {
return txnEvent?.transaction === 'GET /server-load-fetch';
});

await page.goto('/server-load-fetch');

const serverTxnEvent = await serverTxnEventPromise;
const spans = serverTxnEvent.spans;

expect(serverTxnEvent).toMatchObject({
transaction: 'GET /server-load-fetch',
tags: { runtime: 'node' },
transaction_info: { source: 'route' },
type: 'transaction',
contexts: {
trace: {
op: 'http.server',
origin: 'auto.http.sveltekit',
},
},
});

expect(spans).toEqual(
expect.arrayContaining([
// load span where the server load function initiates the sub request:
expect.objectContaining({ op: 'function.sveltekit.server.load', description: '/server-load-fetch' }),
// sub request span:
expect.objectContaining({ op: 'http.server', description: 'GET /api/users' }),
]),
);
});
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@sentry/utils": "latest || *",
"@sveltejs/adapter-auto": "^2.0.0",
"@sveltejs/adapter-node": "^1.2.4",
"@sveltejs/kit": "^1.30.3",
"@sveltejs/kit": "1.20.5",
"svelte": "^3.54.0",
"svelte-check": "^3.0.1",
"ts-node": "10.9.1",
Expand Down

0 comments on commit 8c4e908

Please sign in to comment.