Skip to content

meta(changelog): Update changelog for 7.42.0 #7389

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 49 commits into from
Mar 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
8c8a601
feat(nextjs): Connect traces for server components
Mar 2, 2023
621a8e3
.
Mar 2, 2023
c2d6cc7
ref(e2e): Make app dir tests more thorough
Mar 3, 2023
e996bc8
.
Mar 3, 2023
8e9ab5e
.
Mar 6, 2023
0bd4174
refine
Mar 6, 2023
629a086
rev yarn lock
Mar 6, 2023
eb0cf64
workers
Mar 6, 2023
4c85ea7
Merge pull request #7338 from getsentry/master
github-actions[bot] Mar 6, 2023
ca8a250
explain
Mar 6, 2023
ac18f5a
fix?
Mar 6, 2023
cca3fb5
chore(angular-ivy): Update Readmes (#7304)
Lms24 Mar 6, 2023
cf430fe
Merge pull request #7336 from getsentry/lforst-thorough-nextjs13-tests
Mar 6, 2023
069731b
Merge branch 'develop' into lforst-connected-traces-servercomponents
Mar 6, 2023
a306abd
feat(tracing): Move common tracing code to core (#7339)
AbhiPrasad Mar 6, 2023
77a810d
test: Run playwright tests in parallel (#7334)
mydea Mar 6, 2023
f1e54bc
Add e2e tests
Mar 6, 2023
bd3f7e9
assert on build
Mar 6, 2023
856ba8a
test: Fix flaky droppedError test (#7337)
mydea Mar 6, 2023
5c17acf
docs: Update replay docs for end of beta (#7349)
mydea Mar 7, 2023
bcae395
test(e2e): Publish otel-node package tarballs (#7351)
AbhiPrasad Mar 7, 2023
efd9a45
fix(core): Avoid using `Object.values()` (#7360)
mydea Mar 7, 2023
af48921
test(replay): Add tests for session expiration (#7253)
mydea Mar 7, 2023
04d551e
feat(replay): Update rrweb to 1.105.0 & add breadcrumb when encounter…
mydea Mar 7, 2023
231e311
uuids suck as transactions
Mar 7, 2023
dc696c0
ref(tracing): Re-organize exports for node/browser (#7345)
AbhiPrasad Mar 7, 2023
9bf840a
fix: Ensure `originalException` has type `unknown` (#7361)
mydea Mar 7, 2023
f8b56b0
test(replay): Make tests less flaky (#7368)
mydea Mar 7, 2023
148dd43
chore(sveltekit): Add boilerplate SvelteKit SDK package (#7365)
Lms24 Mar 7, 2023
14b6fca
ref(replay): Handle checkouts more explicitly (#7321)
mydea Mar 7, 2023
5e4e719
feat(tracing): Expose cancelIdleTimeout and add option to make it per…
krystofwoldrich Mar 7, 2023
0e09695
feat(nextjs): Connect traces for server components (#7320)
Mar 7, 2023
7ab581b
feat(replay): Consider user input in form field as "user activity" (#…
billyvg Mar 7, 2023
e8fe668
test(replay): Add test for session max age handling (#7362)
mydea Mar 8, 2023
0957989
ref(tracing): Revert conditional exports usage (#7372)
AbhiPrasad Mar 8, 2023
a1dab3b
ref(node): parallelize disk io when reading source files for context …
JonasBa Mar 8, 2023
ec70b54
fix: Make redux integration be configurable via `normalizeDepth`
Mar 8, 2023
ec78a02
adress review
Mar 8, 2023
17f31c6
ref(node): Partially remove dynamic `require` calls (#7377)
Lms24 Mar 8, 2023
2b44452
fix: Make redux integration be configurable via normalizeDepth (#7379)
Mar 8, 2023
2996c62
ref(browser): Improve type safety of breadcrumbs integration (#7382)
mydea Mar 8, 2023
3eeef09
feat(core): Add lifecycle hooks (#7370)
AbhiPrasad Mar 8, 2023
486d4be
ref(node): store split file in cache for contextlines (#7383)
JonasBa Mar 8, 2023
67a0dcf
feat(replay): Attach an error `cause` to send exceptions (#7350)
billyvg Mar 9, 2023
c192c9a
test(replay): Add integration tests for input masking on change (#7260)
billyvg Mar 9, 2023
295ea3d
feat(core): Emit hooks for transaction start/finish (#7387)
AbhiPrasad Mar 9, 2023
361c5a4
feat(tracing): Track PerformanceObserver interactions as spans (#7331)
0Calories Mar 9, 2023
1d6d216
fix(tracing): Record LCP and CLS on transaction finish (#7386)
AbhiPrasad Mar 9, 2023
290b895
meta(changelog): Update changelog for 7.42.0
AbhiPrasad Mar 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .craft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ targets:
- name: github
includeNames: /^sentry-.*$/
- name: npm
excludeNames: /^sentry-sveltekit-.*$/
- name: registry
sdks:
'npm:@sentry/browser':
Expand Down
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,31 @@

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

## 7.42.0

- feat(core): Add lifecycle hooks (#7370)
- feat(core): Emit hooks for transaction start/finish (#7387)
- feat(nextjs): Connect traces for server components (#7320)
- feat(replay): Attach an error `cause` to send exceptions (#7350)
- feat(replay): Consider user input in form field as "user activity" (#7355)
- feat(replay): Update rrweb to 1.105.0 & add breadcrumb when encountering large mutation (#7314)
- feat(tracing): Expose cancelIdleTimeout and add option to make it permanent (#7236)
- feat(tracing): Track PerformanceObserver interactions as spans (#7331)
- fix(core): Ensure `originalException` has type `unknown` (#7361)
- fix(core): Avoid using `Object.values()` (#7360)
- fix(react): Make redux integration be configurable via `normalizeDepth` (#7379)
- fix(tracing): Record LCP and CLS on transaction finish (#7386)
- ref(browser): Improve type safety of breadcrumbs integration (#7382)
- ref(node): Parallelize disk io when reading source files for context lines (#7374)
- ref(node): Partially remove dynamic `require` calls (#7377)

**Replay `rrweb` changes:**

`@sentry-internal/rrweb` was updated from 1.104.1 to 1.105.0 (#7314):

- feat: Add `onMutation` option to record ([#70](https://github.com/getsentry/rrweb/pull/69))
- fix: Ensure `<input type='submit' value='Btn text'>` is masked ([#69](https://github.com/getsentry/rrweb/pull/69))

## 7.41.0

- feat: Ensure we use the same default `environment` everywhere (#7327)
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ package. Please refer to the README and instructions of those SDKs for more deta
integrations for Express
- [`@sentry/angular`](https://github.com/getsentry/sentry-javascript/tree/master/packages/angular): Browser SDK with
Angular integration enabled
- [`@sentry/angular-ivy`](https://github.com/getsentry/sentry-javascript/tree/master/packages/angular-ivy): Browser SDK with
Angular integration enabled including native support for Angular's Ivy rendering engine.
- [`@sentry/ember`](https://github.com/getsentry/sentry-javascript/tree/master/packages/ember): Browser SDK with Ember
integration enabled
- [`@sentry/react`](https://github.com/getsentry/sentry-javascript/tree/master/packages/react): Browser SDK with React
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"packages/replay-worker",
"packages/serverless",
"packages/svelte",
"packages/sveltekit",
"packages/tracing",
"packages/types",
"packages/typescript",
Expand Down
8 changes: 4 additions & 4 deletions packages/angular-ivy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@

# Official Sentry SDK for Angular with Ivy Compatibility

[![npm version](https://img.shields.io/npm/v/@sentry/angular-ivy.svg)](https://www.npmjs.com/package/@sentry/angular-ivy)
[![npm dm](https://img.shields.io/npm/dm/@sentry/angular-ivy.svg)](https://www.npmjs.com/package/@sentry/angular-ivy)
[![npm dt](https://img.shields.io/npm/dt/@sentry/angular-ivy.svg)](https://www.npmjs.com/package/@sentry/angular-ivy)

## Links

- [Official SDK Docs](https://docs.sentry.io/platforms/javascript/angular/)

## Angular Version Compatibility

**Note**: This SDK is still experimental and not yet stable.
We do not yet make guarantees in terms of breaking changes, version compatibilities or semver.
Please open a Github issue if you experience bugs or would like to share feedback.

This SDK officially supports Angular 12-15 with Angular's new rendering engine, Ivy.

If you're using Angular 10, 11 or a newer Angular version with View Engine instead of Ivy, please use [`@sentry/angular`](https://github.com/getsentry/sentry-javascript/blob/develop/packages/angular/README.md).
Expand Down
4 changes: 4 additions & 0 deletions packages/angular/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

# Official Sentry SDK for Angular

[![npm version](https://img.shields.io/npm/v/@sentry/angular.svg)](https://www.npmjs.com/package/@sentry/angular)
[![npm dm](https://img.shields.io/npm/dm/@sentry/angular.svg)](https://www.npmjs.com/package/@sentry/angular)
[![npm dt](https://img.shields.io/npm/dt/@sentry/angular.svg)](https://www.npmjs.com/package/@sentry/angular)

## Links

- [Official SDK Docs](https://docs.sentry.io/platforms/javascript/angular/)
Expand Down
41 changes: 21 additions & 20 deletions packages/browser/src/integrations/breadcrumbs.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable max-lines */
import { getCurrentHub } from '@sentry/core';
import type { Event, Integration } from '@sentry/types';
import type { Event as SentryEvent, HandlerDataFetch, Integration, SentryWrappedXMLHttpRequest } from '@sentry/types';
import {
addInstrumentationHandler,
getEventDescription,
Expand All @@ -14,6 +14,8 @@ import {

import { WINDOW } from '../helpers';

type HandlerData = Record<string, unknown>;

/** JSDoc */
interface BreadcrumbsOptions {
console: boolean;
Expand Down Expand Up @@ -99,7 +101,7 @@ export class Breadcrumbs implements Integration {
/**
* Adds a breadcrumb for Sentry events or transactions if this option is enabled.
*/
public addSentryBreadcrumb(event: Event): void {
public addSentryBreadcrumb(event: SentryEvent): void {
if (this.options.sentry) {
getCurrentHub().addBreadcrumb(
{
Expand All @@ -120,10 +122,8 @@ export class Breadcrumbs implements Integration {
* A HOC that creaes a function that creates breadcrumbs from DOM API calls.
* This is a HOC so that we get access to dom options in the closure.
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function _domBreadcrumb(dom: BreadcrumbsOptions['dom']): (handlerData: { [key: string]: any }) => void {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function _innerDomBreadcrumb(handlerData: { [key: string]: any }): void {
function _domBreadcrumb(dom: BreadcrumbsOptions['dom']): (handlerData: HandlerData) => void {
function _innerDomBreadcrumb(handlerData: HandlerData): void {
let target;
let keyAttrs = typeof dom === 'object' ? dom.serializeAttribute : undefined;

Expand All @@ -143,9 +143,10 @@ function _domBreadcrumb(dom: BreadcrumbsOptions['dom']): (handlerData: { [key: s

// Accessing event.target can throw (see getsentry/raven-js#838, #768)
try {
target = handlerData.event.target
? htmlTreeAsString(handlerData.event.target as Node, { keyAttrs, maxStringLength })
: htmlTreeAsString(handlerData.event as unknown as Node, { keyAttrs, maxStringLength });
const event = handlerData.event as Event | Node;
target = _isEvent(event)
? htmlTreeAsString(event.target, { keyAttrs, maxStringLength })
: htmlTreeAsString(event, { keyAttrs, maxStringLength });
} catch (e) {
target = '<unknown>';
}
Expand Down Expand Up @@ -173,8 +174,7 @@ function _domBreadcrumb(dom: BreadcrumbsOptions['dom']): (handlerData: { [key: s
/**
* Creates breadcrumbs from console API calls
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function _consoleBreadcrumb(handlerData: { [key: string]: any }): void {
function _consoleBreadcrumb(handlerData: HandlerData & { args: unknown[]; level: string }): void {
// This is a hack to fix a Vue3-specific bug that causes an infinite loop of
// console warnings. This happens when a Vue template is rendered with
// an undeclared variable, which we try to stringify, ultimately causing
Expand Down Expand Up @@ -216,8 +216,7 @@ function _consoleBreadcrumb(handlerData: { [key: string]: any }): void {
/**
* Creates breadcrumbs from XHR API calls
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function _xhrBreadcrumb(handlerData: { [key: string]: any }): void {
function _xhrBreadcrumb(handlerData: HandlerData & { xhr: SentryWrappedXMLHttpRequest }): void {
if (handlerData.endTimestamp) {
// We only capture complete, non-sentry requests
if (handlerData.xhr.__sentry_own_request__) {
Expand Down Expand Up @@ -249,8 +248,7 @@ function _xhrBreadcrumb(handlerData: { [key: string]: any }): void {
/**
* Creates breadcrumbs from fetch API calls
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function _fetchBreadcrumb(handlerData: { [key: string]: any }): void {
function _fetchBreadcrumb(handlerData: HandlerData & HandlerDataFetch): void {
// We only capture complete fetch requests
if (!handlerData.endTimestamp) {
return;
Expand Down Expand Up @@ -280,7 +278,7 @@ function _fetchBreadcrumb(handlerData: { [key: string]: any }): void {
category: 'fetch',
data: {
...handlerData.fetchData,
status_code: handlerData.response.status,
status_code: handlerData.response && handlerData.response.status,
},
type: 'http',
},
Expand All @@ -295,10 +293,9 @@ function _fetchBreadcrumb(handlerData: { [key: string]: any }): void {
/**
* Creates breadcrumbs from history API calls
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function _historyBreadcrumb(handlerData: { [key: string]: any }): void {
let from = handlerData.from;
let to = handlerData.to;
function _historyBreadcrumb(handlerData: HandlerData & { from: string; to: string }): void {
let from: string | undefined = handlerData.from;
let to: string | undefined = handlerData.to;
const parsedLoc = parseUrl(WINDOW.location.href);
let parsedFrom = parseUrl(from);
const parsedTo = parseUrl(to);
Expand All @@ -325,3 +322,7 @@ function _historyBreadcrumb(handlerData: { [key: string]: any }): void {
},
});
}

function _isEvent(event: unknown): event is Event {
return event && !!(event as Record<string, unknown>).target;
}
38 changes: 37 additions & 1 deletion packages/core/src/baseclient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import type {
SessionAggregates,
Severity,
SeverityLevel,
Transaction,
TransactionEvent,
Transport,
} from '@sentry/types';
Expand Down Expand Up @@ -97,6 +98,9 @@ export abstract class BaseClient<O extends ClientOptions> implements Client<O> {
/** Holds flushable */
private _outcomes: { [key: string]: number } = {};

// eslint-disable-next-line @typescript-eslint/ban-types
private _hooks: Record<string, Function[]> = {};

/**
* Initializes this client instance.
*
Expand Down Expand Up @@ -351,6 +355,38 @@ export abstract class BaseClient<O extends ClientOptions> implements Client<O> {
}
}

// Keep on() & emit() signatures in sync with types' client.ts interface

/** @inheritdoc */
public on(hook: 'startTransaction' | 'finishTransaction', callback: (transaction: Transaction) => void): void;

/** @inheritdoc */
public on(hook: 'beforeEnvelope', callback: (envelope: Envelope) => void): void;

/** @inheritdoc */
public on(hook: string, callback: unknown): void {
if (!this._hooks[hook]) {
this._hooks[hook] = [];
}

// @ts-ignore We assue the types are correct
this._hooks[hook].push(callback);
}

/** @inheritdoc */
public emit(hook: 'startTransaction' | 'finishTransaction', transaction: Transaction): void;

/** @inheritdoc */
public emit(hook: 'beforeEnvelope', envelope: Envelope): void;

/** @inheritdoc */
public emit(hook: string, ...rest: unknown[]): void {
if (this._hooks[hook]) {
// @ts-ignore we cannot enforce the callback to match the hook
this._hooks[hook].forEach(callback => callback(...rest));
}
}

/** Updates existing session based on the provided event */
protected _updateSessionFromEvent(session: Session, event: Event): void {
let crashed = false;
Expand Down Expand Up @@ -560,7 +596,7 @@ export abstract class BaseClient<O extends ClientOptions> implements Client<O> {
data: {
__sentry__: true,
},
originalException: reason as Error,
originalException: reason,
});
throw new SentryError(
`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${reason}`,
Expand Down
3 changes: 1 addition & 2 deletions packages/core/src/hub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,7 @@ export class Hub implements HubInterface {
/**
* @inheritDoc
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
public captureException(exception: any, hint?: EventHint): string {
public captureException(exception: unknown, hint?: EventHint): string {
const eventId = (this._lastEventId = hint && hint.event_id ? hint.event_id : uuid4());
const syntheticException = new Error('Sentry syntheticException');
this._withClient((client, scope) => {
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export type { ClientClass } from './sdk';
export type { Carrier, Layer } from './hub';
export type { OfflineStore, OfflineTransportOptions } from './transports/offline';

export * from './tracing';
export {
addBreadcrumb,
captureException,
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function filterDuplicates(integrations: Integration[]): Integration[] {
integrationsByName[name] = currentInstance;
});

return Object.values(integrationsByName);
return Object.keys(integrationsByName).map(k => integrationsByName[k]);
}

/** Gets integrations to install */
Expand Down
Loading