Skip to content

Commit 2fe44fc

Browse files
committed
Merge remote-tracking branch 'upstream/master' into feat/separate-source-reading
2 parents 647999d + 15c2100 commit 2fe44fc

File tree

132 files changed

+1107
-5063
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+1107
-5063
lines changed

.prettierrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"arrowParens": "avoid",
23
"printWidth": 120,
34
"proseWrap": "always",
45
"singleQuote": true,

CHANGELOG.md

Lines changed: 56 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,77 @@
44

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

7+
## 6.17.6
8+
9+
- fix(angular): Add check for global.location in angular universal (#4513)
10+
- fix(nextjs): Stop injecting sentry into API middleware (#4517)
11+
- fix(nextjs): Revert #4139 - remove manipulation of res.finished value (#4516)
12+
13+
Work in this release contributed by @mobilestar1. Thank you for your contribution!
14+
15+
## 6.17.5
16+
17+
This release deprecates the `Severity` enum, the `SeverityLevel` type, and the internal `SeverityLevels` array, all from `@sentry/types`. In v7, `Severity` will disappear (in favor of `SeverityLevel`) and `SeverityLevel` and `SeverityLevels` will live in `@sentry/utils`. If you are using any of the three, we encourage you to migrate your usage now, using our [migration guide](./MIGRATION.md#upgrading-from-6.x-to-6.17.x).
18+
19+
- ref: Export Session class from core/browser/node (#4508)
20+
- chore(nextjs): Bump`@sentry/webpack-plugin` to 1.18.5 (#4501)
21+
- ref(types): Move SeverityLevel and SeverityLevels to `@sentry/utils` (#4492)
22+
- fix(vue): Cast name parameter to string (#4483)
23+
24+
Work in this release contributed by @Bobakanoosh and @ssnielsen. Thank you for your contributions!
25+
26+
## 6.17.4
27+
28+
- chore(deps): Bump `@sentry/webpack-plugin` from 1.18.3 to 1.18.4 (#4464)
29+
- fix(browser): Set severity level for events captured by the global error handler (#4460)
30+
- fix(integrations): Add default for `ExtraErrorData`'s `depth` option (#4487)
31+
- fix(nextjs): Export `BrowserTracing` integration directly (#4480)
32+
- fix(tracing): Export `SpanStatus` enum (#4478)
33+
- fix(vue): Property `_isVue` not defined in Vue3 (#4461)
34+
35+
Work in this release contributed by @7inspire, @jaeseokk, and @rchl. Thank you for your contributions!
36+
37+
## 6.17.3
38+
39+
- fix(nextjs): Unwrap `req` and `res` if necessary when instrumenting server (#4467)
40+
41+
## 6.17.2
42+
43+
This patch contains a breaking change for anyone setting the undocumented `rethrowAfterCapture` option for `@sentry/serverless`'s AWS wrapper to `false`, as its functionality has been removed. For backwards compatibility with anyone setting it to `true` (which is also the default), the option remains in the `WrapperOptions` type for now. It will be removed in the next major release, though, so we recommend removing it from your code.
44+
45+
- ref(serverless): Remove `rethrowAfterCapture` use in AWS lambda wrapper (#4448)
46+
- fix(utils): Remove dom is casting (#4451)
47+
48+
## 6.17.1
49+
50+
- ref(core): Renormalize event only after stringification errors (#4425)
51+
- feat(nextjs): Add option to use `hidden-source-map` as webpack devtool value (#4436)
52+
- fix(tracing): ignore the xhr/fetch response if its request is not being tracked (#4428)
53+
- fix(vue): prevent after hook from starting new span (#4438)
54+
55+
Work in this release contributed by @datbth. Thank you for your contribution!
56+
757
## 6.17.0
858

9-
This release contains several internal refactors that help reduce the bundle size of the SDK and help prep for our [upcoming major release](https://github.com/getsentry/sentry-javascript/issues/4240). There are no breaking changes in this patch unless you are using our internal `Dsn` class, which has been removed. We also deprecated a few of our typescript enums and our internal `API` class. We've detailed in our [migration documentation](./MIGRATION.md#upgrading-from-6.x-to-6.17.0) how to update your sdk usage if you are using any of these in your code.
59+
This release contains several internal refactors that help reduce the bundle size of the SDK and help prep for our [upcoming major release](https://github.com/getsentry/sentry-javascript/issues/4240). There are no breaking changes in this patch unless you are using our internal `Dsn` class, which has been removed. We also deprecated a few of our typescript enums and our internal `API` class. We've detailed in our [migration documentation](./MIGRATION.md#upgrading-from-6.x-to-6.17.x) how to update your sdk usage if you are using any of these in your code.
1060

11-
- feat: Undeprecate Severity Enum (#4412)
1261
- feat: Remove Dsn class (#4325)
1362
- feat(core): Add processing metadata to scope and event (#4252)
1463
- feat(core): Deprecate API class (#4281)
1564
- feat(ember): Update ember dependencies (#4253)
1665
- fix(nextjs): Inject sentry.x.config.js into pages/_error (#4397)
1766
- fix(nextjs): Add sentry-cli existence check for enabling webpack plugin #4311
1867
- ref(tracing): deprecate span status enum (#4299)
68+
- ref(tracing): Remove script evaluation span (#4433)
1969
- ref(types): drop unused logLevel (#4317)
2070
- ref(types): deprecate request status enum (#4316)
2171
- ref(types): deprecate outcome enum (#4315)
2272
- ref(types): deprecate transactionmethod enum (#4314)
2373
- ref(types): deprecate status enum (#4298)
24-
- ref(types): deprecate severity enum (#4280)
74+
- ref(utils): improve invalid dsn error message (#4430)
75+
- fix(vue): Prioritize app variable to avoid duplicate name pollution (#4437)
2576

26-
Work in this release contributed by @yordis. Thank you for your contribution!
77+
Work in this release contributed by @yordis, @Badisi, and @lh1me. Thank you for your contribution!
2778

2879
## 6.16.1
2980

@@ -935,7 +986,7 @@ removed in the future. If you are only using the `Tracing` integration there is
935986

936987
## 5.6.3
937988

938-
- [browser] fix: Don't capture our own XHR events that somehow bubbled-up to global handler
989+
- [browser] fix: Don't capture our own XHR events that somehow bubbled-up to global handler (#2221)
939990

940991
## 5.6.2
941992

CONTRIBUTING.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,19 @@ When contributing to the codebase, please note:
7979
_These steps are only relevant to Sentry employees when preparing and publishing a new SDK release._
8080

8181
1. Determine what version will be released (we use [semver](https://semver.org)).
82-
2. Update [`CHANGELOG.md`](https://github.com/getsentry/sentry-javascript/edit/master/CHANGELOG.md) to add an entry for the next release number and a list of changes since the last release.
82+
2. Update [`CHANGELOG.md`](https://github.com/getsentry/sentry-javascript/edit/master/CHANGELOG.md) to add an entry for the next release number and a list of changes since the last release. (See details below.)
8383
3. Run the [Prepare Release](https://github.com/getsentry/sentry-javascript/actions/workflows/release.yml) workflow.
8484
4. A new issue should appear in https://github.com/getsentry/publish/issues.
8585
5. Ask a member of the [@getsentry/releases team](https://github.com/orgs/getsentry/teams/releases/members) to approve the release.
86+
87+
### Updating the Changelog
88+
89+
1. Create a new branch.
90+
2. Run `git log --format="- %s"` and copy everything since the last release.
91+
3. Create a new section in the changelog, deciding based on the changes whether it should be a minor bump or a patch release.
92+
4. Paste in the logs you copied earlier.
93+
5. Delete any which aren't user-facing changes.
94+
6. Alphabetize the rest.
95+
7. Run a regex find and replace, searching for `\(#(\d+)\)` and replacing it with `([#$1](https://github.com/getsentry/sentry-javascript/pull/$1))`. (This will linkify all of the PR references.)
96+
8. If any of the PRs are from external contributors, include underneath the commits `Work in this release contributed by <list of external contributors' GitHub usernames>. Thank you for your contributions!`. If there's only one external PR, don't forget to remove the final `s`. If there are three or more, use an Oxford comma. (It's in the Sentry styleguide!)
97+
9. Commit, push, and open a PR with the title `meta: Update changelog for <fill in relevant version here>`.

MIGRATION.md

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Upgrading from 6.x to 6.17.0
1+
# Upgrading from 6.x to 6.17.x
22

3-
You only need to make changes when migrating to `6.17.0` if you are using our internal `Dsn` class. Our internal API class and typescript enums were deprecated, so we recommend you migrate them as well.
3+
You only need to make changes when migrating to `6.17.x` if you are using our internal `Dsn` class. Our internal API class and typescript enums were deprecated, so we recommend you migrate them as well.
44

55
The internal `Dsn` class was removed in `6.17.0`. For additional details, you can look at the [PR where this change happened](https://github.com/getsentry/sentry-javascript/pull/4325). To migrate, see the following example.
66

@@ -44,7 +44,7 @@ const envelopeEndpoint = api.getEnvelopeEndpointWithUrlEncodedAuth();
4444

4545
## Enum changes
4646

47-
The enums `Status` and `SpanStatus` were deprecated, and we've detailed how to migrate away from them below. We also deprecated the `TransactionMethod`, `Outcome` and `RequestSessionStatus` enums, but those are internal-only APIs. If you are using them, we encourage you to take a look at the corresponding PRs to see how we've changed our code as a result.
47+
The enums `Status`, `SpanStatus`, and `Severity` were deprecated, and we've detailed how to migrate away from them below. We also deprecated the `TransactionMethod`, `Outcome` and `RequestSessionStatus` enums, but those are internal-only APIs. If you are using them, we encourage you to take a look at the corresponding PRs to see how we've changed our code as a result.
4848

4949
- `TransactionMethod`: https://github.com/getsentry/sentry-javascript/pull/4314
5050
- `Outcome`: https://github.com/getsentry/sentry-javascript/pull/4315
@@ -82,6 +82,28 @@ import { SpanStatus } from '@sentry/tracing';
8282
const status = SpanStatus.fromHttpCode(403);
8383
```
8484

85+
#### Severity, SeverityLevel, and SeverityLevels
86+
87+
We deprecated the `Severity` enum in `@sentry/types` and it will be removed in the next major release. We recommend using string literals (typed as `SeverityLevel`) to save on bundle size.
88+
89+
`SeverityLevel` and `SeverityLevels` will continue to exist in v7, but they will live in `@sentry/utils` rather than `@sentry/types`. Currently, they live in both, for ease of migration. (`SeverityLevels` isn't included in the examples below because it is only useful internally.)
90+
91+
```js
92+
// New in 6.17.5:
93+
import { SeverityLevel } from '@sentry/utils';
94+
95+
const levelA = "error" as SeverityLevel;
96+
97+
const levelB: SeverityLevel = "error"
98+
99+
// Before:
100+
import { Severity, SeverityLevel } from '@sentry/types';
101+
102+
const levelA = Severity.error;
103+
104+
const levelB: SeverityLevel = "error"
105+
```
106+
85107
# Upgrading from 4.x to 5.x/6.x
86108

87109
In this version upgrade, there are a few breaking changes. This guide should help you update your code accordingly.

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"lerna": "3.4.0",
3-
"version": "6.17.0-beta.0",
3+
"version": "6.17.5",
44
"packages": "packages/*",
55
"npmClient": "yarn",
66
"useWorkspaces": true

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
"madge": "4.0.2",
6969
"mocha": "^6.1.4",
7070
"npm-run-all": "^4.1.5",
71-
"prettier": "1.19.1",
71+
"prettier": "2.5.1",
7272
"replace-in-file": "^4.0.0",
7373
"rimraf": "^3.0.2",
7474
"sinon": "^7.3.2",

packages/angular/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry/angular",
3-
"version": "6.17.0-beta.0",
3+
"version": "6.17.5",
44
"description": "Official Sentry SDK for Angular",
55
"repository": "git://github.com/getsentry/sentry-javascript.git",
66
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/angular",
@@ -21,9 +21,9 @@
2121
"@angular/router": "10.x || 11.x || 12.x || 13.x"
2222
},
2323
"dependencies": {
24-
"@sentry/browser": "6.17.0-beta.0",
25-
"@sentry/types": "6.17.0-beta.0",
26-
"@sentry/utils": "6.17.0-beta.0",
24+
"@sentry/browser": "6.17.5",
25+
"@sentry/types": "6.17.5",
26+
"@sentry/utils": "6.17.5",
2727
"rxjs": "^6.6.0",
2828
"tslib": "^1.9.3"
2929
},
@@ -39,10 +39,10 @@
3939
"build:es5": "yarn build:cjs # *** backwards compatibility - remove in v7 ***",
4040
"build:esm": "tsc -p tsconfig.esm.json",
4141
"build:watch": "run-p build:cjs:watch build:esm:watch",
42-
"build:cjs:watch": "tsc -p tsconfig.cjs.json -w --preserveWatchOutput",
42+
"build:cjs:watch": "tsc -p tsconfig.cjs.json --watch",
4343
"build:dev:watch": "run-s build:watch",
4444
"build:es5:watch": "yarn build:cjs:watch # *** backwards compatibility - remove in v7 ***",
45-
"build:esm:watch": "tsc -p tsconfig.esm.json -w --preserveWatchOutput",
45+
"build:esm:watch": "tsc -p tsconfig.esm.json --watch",
4646
"circularDepCheck": "madge --circular src/index.ts",
4747
"clean": "rimraf dist esm build coverage",
4848
"fix": "run-s fix:eslint fix:prettier",

packages/angular/src/tracing.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export function routingInstrumentation(
2727
stashedStartTransaction = customStartTransaction;
2828
stashedStartTransactionOnLocationChange = startTransactionOnLocationChange;
2929

30-
if (startTransactionOnPageLoad) {
30+
if (startTransactionOnPageLoad && global && global.location) {
3131
customStartTransaction({
3232
name: global.location.pathname,
3333
op: 'pageload',
@@ -183,7 +183,7 @@ export function TraceClassDecorator(): ClassDecorator {
183183
return target => {
184184
const originalOnInit = target.prototype.ngOnInit;
185185
// eslint-disable-next-line @typescript-eslint/no-explicit-any
186-
target.prototype.ngOnInit = function(...args: any[]): ReturnType<typeof originalOnInit> {
186+
target.prototype.ngOnInit = function (...args: any[]): ReturnType<typeof originalOnInit> {
187187
const activeTransaction = getActiveTransaction();
188188
if (activeTransaction) {
189189
tracingSpan = activeTransaction.startChild({
@@ -198,7 +198,7 @@ export function TraceClassDecorator(): ClassDecorator {
198198

199199
const originalAfterViewInit = target.prototype.ngAfterViewInit;
200200
// eslint-disable-next-line @typescript-eslint/no-explicit-any
201-
target.prototype.ngAfterViewInit = function(...args: any[]): ReturnType<typeof originalAfterViewInit> {
201+
target.prototype.ngAfterViewInit = function (...args: any[]): ReturnType<typeof originalAfterViewInit> {
202202
if (tracingSpan) {
203203
tracingSpan.finish();
204204
}
@@ -218,7 +218,7 @@ export function TraceMethodDecorator(): MethodDecorator {
218218
return (target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {
219219
const originalMethod = descriptor.value;
220220
// eslint-disable-next-line @typescript-eslint/no-explicit-any
221-
descriptor.value = function(...args: any[]): ReturnType<typeof originalMethod> {
221+
descriptor.value = function (...args: any[]): ReturnType<typeof originalMethod> {
222222
const now = timestampWithMs();
223223
const activeTransaction = getActiveTransaction();
224224
if (activeTransaction) {

packages/browser/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry/browser",
3-
"version": "6.17.0-beta.0",
3+
"version": "6.17.5",
44
"description": "Official Sentry SDK for browsers",
55
"repository": "git://github.com/getsentry/sentry-javascript.git",
66
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/browser",
@@ -16,9 +16,9 @@
1616
"access": "public"
1717
},
1818
"dependencies": {
19-
"@sentry/core": "6.17.0-beta.0",
20-
"@sentry/types": "6.17.0-beta.0",
21-
"@sentry/utils": "6.17.0-beta.0",
19+
"@sentry/core": "6.17.5",
20+
"@sentry/types": "6.17.5",
21+
"@sentry/utils": "6.17.5",
2222
"tslib": "^1.9.3"
2323
},
2424
"devDependencies": {
@@ -58,10 +58,10 @@
5858
"build:esm": "tsc -p tsconfig.esm.json",
5959
"build:watch": "run-p build:cjs:watch build:esm:watch build:bundle:watch",
6060
"build:bundle:watch": "rollup --config --watch",
61-
"build:cjs:watch": "tsc -p tsconfig.cjs.json -w --preserveWatchOutput",
61+
"build:cjs:watch": "tsc -p tsconfig.cjs.json --watch",
6262
"build:es5:watch": "yarn build:cjs:watch # *** backwards compatibility - remove in v7 ***",
6363
"build:dev:watch": "run-p build:cjs:watch build:esm:watch",
64-
"build:esm:watch": "tsc -p tsconfig.esm.json -w --preserveWatchOutput",
64+
"build:esm:watch": "tsc -p tsconfig.esm.json --watch",
6565
"circularDepCheck": "madge --circular src/index.ts",
6666
"clean": "rimraf dist esm build coverage .rpt2_cache",
6767
"fix": "run-s fix:eslint fix:prettier",

packages/browser/src/exports.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@ export {
99
Exception,
1010
Response,
1111
Severity,
12-
SeverityLevel,
1312
StackFrame,
1413
Stacktrace,
1514
Thread,
1615
User,
1716
} from '@sentry/types';
1817

18+
export { SeverityLevel } from '@sentry/utils';
19+
1920
export {
2021
addGlobalEventProcessor,
2122
addBreadcrumb,
@@ -28,6 +29,7 @@ export {
2829
Hub,
2930
makeMain,
3031
Scope,
32+
Session,
3133
startTransaction,
3234
SDK_VERSION,
3335
setContext,

packages/browser/src/helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export function wrap(
8080

8181
/* eslint-disable prefer-rest-params */
8282
// eslint-disable-next-line @typescript-eslint/no-explicit-any
83-
const sentryWrapped: WrappedFunction = function(this: any): void {
83+
const sentryWrapped: WrappedFunction = function (this: any): void {
8484
const args = Array.prototype.slice.call(arguments);
8585

8686
try {

packages/browser/src/integrations/breadcrumbs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ function _domBreadcrumb(dom: BreadcrumbsOptions['dom']): (handlerData: { [key: s
121121
try {
122122
target = handlerData.event.target
123123
? htmlTreeAsString(handlerData.event.target as Node, keyAttrs)
124-
: htmlTreeAsString((handlerData.event as unknown) as Node, keyAttrs);
124+
: htmlTreeAsString(handlerData.event as unknown as Node, keyAttrs);
125125
} catch (e) {
126126
target = '<unknown>';
127127
}

packages/browser/src/integrations/globalhandlers.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ function _installGlobalOnErrorHandler(): void {
101101
column,
102102
);
103103

104+
event.level = Severity.Error;
105+
104106
addMechanismAndCapture(hub, error, event, 'onerror');
105107
},
106108
);
@@ -181,7 +183,8 @@ function _eventFromRejectionWithPrimitive(reason: Primitive): Event {
181183
*/
182184
// eslint-disable-next-line @typescript-eslint/no-explicit-any
183185
function _eventFromIncompleteOnError(msg: any, url: any, line: any, column: any): Event {
184-
const ERROR_TYPES_RE = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;
186+
const ERROR_TYPES_RE =
187+
/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;
185188

186189
// If 'message' is ErrorEvent, get real message from inside
187190
let message = isErrorEvent(msg) ? msg.message : msg;

0 commit comments

Comments
 (0)