Skip to content

Commit 18b9aed

Browse files
authored
Merge branch 'master' into sentry-nextjs-without-webpack-plugin
2 parents 9a05bf8 + a5307b1 commit 18b9aed

File tree

87 files changed

+1818
-1103
lines changed

Some content is hidden

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

87 files changed

+1818
-1103
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ jobs:
233233
id: changed-files-specific
234234
uses: tj-actions/[email protected]
235235
with:
236-
files: .*packages\/(ember|browser|core|tracing|hub|minimal|types|utils)($|/.*)
236+
files: .*packages\/ember($|/.*)
237237
# Only run ember tests if the files above have changed
238238
- name: Run Ember tests
239239
if: steps.changed-files-specific.outputs.any_changed == 'true' || github.event_name == 'push'

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,32 @@
44

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

7+
## 6.12.0
8+
9+
- fix(nextjs): Differentiate between webpack 4 and 5 in server builds (#3878)
10+
- fix(core): Skip native frames while searching frame URLs. (#3897)
11+
- fix(vue): Attach props only if VM is available (#3902)
12+
- feat(tracing): Add pg-native support to Postgres integration. (#3894)
13+
- ref(ember): Update addon to support Ember 4.0.0 (beta) (#3915)
14+
- feat(react): Make Profiler _mountSpan attribute protected (#3904)
15+
- fix(ember): allow ember-beta to fail (#3910)
16+
- fix(tracing): Prevent metrics erroring module load in web workers (#3941)
17+
- misc(browser): Log when event is dropped by Dedupe integration (#3943)
18+
19+
## 6.11.0
20+
21+
- feat(nextjs): Allow for TypeScript user config files (#3847)
22+
- fix(browser): Make sure handler exists for LinkedErrors Integration (#3861)
23+
- fix(core): Skip anonymous callbacks while searching frame URLs. (#3842)
24+
- fix(core): Stop rejecting in `flush` and `close` when client undefined (#3846)
25+
- fix(nextjs): Stop `SentryWebpackPlugin` from uploading unnecessary files (#3845)
26+
- fix(react): Require ReactElement in ErrorBoundary props and render (#3857)
27+
- fix(tests): Allow tests to run on Windows without WSL (#3813)
28+
- fix(utils): Fix false-positive circular references when normalizing `Event` objects (#3864)
29+
- fix(vue): Make Router.name type optional to match VueRouter (#3843)
30+
- ref(core): Prevent redundant setup work (#3862)
31+
- ref(nextjs): Stop reinitializing the server SDK unnecessarily (#3860)
32+
733
## 6.10.0
834

935
- feat(vue): Rework tracing and add support for `Vue 3` (#3804)

MIGRATION.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Upgrading from 4.x to 5.x
1+
# Upgrading from 4.x to 5.x/6.x
22

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

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.10.0",
3+
"version": "6.12.0",
44
"packages": "packages/*",
55
"npmClient": "yarn",
66
"useWorkspaces": true

packages/angular/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry/angular",
3-
"version": "6.10.0",
3+
"version": "6.12.0",
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,17 +21,17 @@
2121
"@angular/router": "10.x || 11.x || 12.x"
2222
},
2323
"dependencies": {
24-
"@sentry/browser": "6.10.0",
25-
"@sentry/types": "6.10.0",
26-
"@sentry/utils": "6.10.0",
24+
"@sentry/browser": "6.12.0",
25+
"@sentry/types": "6.12.0",
26+
"@sentry/utils": "6.12.0",
2727
"rxjs": "^6.6.0",
2828
"tslib": "^1.9.3"
2929
},
3030
"devDependencies": {
3131
"@angular/common": "^10.0.3",
3232
"@angular/core": "^10.0.3",
3333
"@angular/router": "^10.0.3",
34-
"@sentry-internal/eslint-config-sdk": "6.10.0",
34+
"@sentry-internal/eslint-config-sdk": "6.12.0",
3535
"npm-run-all": "^4.1.2",
3636
"prettier": "1.19.0",
3737
"rimraf": "^2.6.3",

packages/browser/.eslintrc.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ module.exports = {
2525
'prefer-template': 'off',
2626
'no-unused-expressions': 'off',
2727
'guard-for-in': 'off',
28+
'@typescript-eslint/no-explicit-any': 'off',
29+
'@typescript-eslint/no-non-null-assertion': 'off',
2830
},
2931
},
3032
{

packages/browser/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry/browser",
3-
"version": "6.10.0",
3+
"version": "6.12.0",
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,13 +16,13 @@
1616
"access": "public"
1717
},
1818
"dependencies": {
19-
"@sentry/core": "6.10.0",
20-
"@sentry/types": "6.10.0",
21-
"@sentry/utils": "6.10.0",
19+
"@sentry/core": "6.12.0",
20+
"@sentry/types": "6.12.0",
21+
"@sentry/utils": "6.12.0",
2222
"tslib": "^1.9.3"
2323
},
2424
"devDependencies": {
25-
"@sentry-internal/eslint-config-sdk": "6.10.0",
25+
"@sentry-internal/eslint-config-sdk": "6.12.0",
2626
"@types/eslint": "^7.2.0",
2727
"@types/md5": "2.1.33",
2828
"btoa": "^1.2.1",
@@ -73,8 +73,8 @@
7373
"fix:prettier": "prettier --write \"{src,test}/**/*.ts\"",
7474
"fix:eslint": "eslint . --format stylish --fix",
7575
"test": "run-s test:unit",
76-
"test:unit": "karma start test/unit/karma.conf.js",
77-
"test:unit:watch": "karma start test/unit/karma.conf.js --auto-watch --no-single-run",
76+
"test:unit": "jest --config test/unit/jest.config.js",
77+
"test:unit:watch": "jest --config test/unit/jest.config.js --watch",
7878
"test:integration": "test/integration/run.js",
7979
"test:integration:watch": "test/integration/run.js --watch",
8080
"test:integration:checkbrowsers": "node scripts/checkbrowsers.js",

packages/browser/src/helpers.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,5 +211,9 @@ export function injectReportDialog(options: ReportDialogOptions = {}): void {
211211
script.onload = options.onLoad;
212212
}
213213

214-
(document.head || document.body).appendChild(script);
214+
const injectionPoint = document.head || document.body;
215+
216+
if (injectionPoint) {
217+
injectionPoint.appendChild(script);
218+
}
215219
}

packages/browser/src/integrations/dedupe.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Event, EventProcessor, Exception, Hub, Integration, StackFrame } from '@sentry/types';
2+
import { logger } from '@sentry/utils';
23

34
/** Deduplication filter */
45
export class Dedupe implements Integration {
@@ -27,6 +28,7 @@ export class Dedupe implements Integration {
2728
// Juuust in case something goes wrong
2829
try {
2930
if (self._shouldDropEvent(currentEvent, self._previousEvent)) {
31+
logger.warn(`Event dropped due to being a duplicate of previously captured event.`);
3032
return null;
3133
}
3234
} catch (_oO) {

packages/browser/src/tracekit.ts

Lines changed: 41 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* largely modified and is now maintained as part of Sentry JS SDK.
44
*/
55

6-
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
6+
/* eslint-disable @typescript-eslint/no-unsafe-member-access, max-lines */
77

88
/**
99
* An object representing a single stack frame.
@@ -124,16 +124,10 @@ function computeStackTraceFromStackProp(ex: any): StackTrace | null {
124124
// Arpad: Working with the regexp above is super painful. it is quite a hack, but just stripping the `address at `
125125
// prefix here seems like the quickest solution for now.
126126
let url = parts[2] && parts[2].indexOf('address at ') === 0 ? parts[2].substr('address at '.length) : parts[2];
127-
128127
// Kamil: One more hack won't hurt us right? Understanding and adding more rules on top of these regexps right now
129128
// would be way too time consuming. (TODO: Rewrite whole RegExp to be more readable)
130129
let func = parts[1] || UNKNOWN_FUNCTION;
131-
const isSafariExtension = func.indexOf('safari-extension') !== -1;
132-
const isSafariWebExtension = func.indexOf('safari-web-extension') !== -1;
133-
if (isSafariExtension || isSafariWebExtension) {
134-
func = func.indexOf('@') !== -1 ? func.split('@')[0] : UNKNOWN_FUNCTION;
135-
url = isSafariExtension ? `safari-extension:${url}` : `safari-web-extension:${url}`;
136-
}
130+
[func, url] = extractSafariExtensionDetails(func, url);
137131

138132
element = {
139133
url,
@@ -165,9 +159,14 @@ function computeStackTraceFromStackProp(ex: any): StackTrace | null {
165159
// NOTE: this hack doesn't work if top-most frame is eval
166160
stack[0].column = (ex.columnNumber as number) + 1;
167161
}
162+
163+
let url = parts[3];
164+
let func = parts[1] || UNKNOWN_FUNCTION;
165+
[func, url] = extractSafariExtensionDetails(func, url);
166+
168167
element = {
169-
url: parts[3],
170-
func: parts[1] || UNKNOWN_FUNCTION,
168+
url,
169+
func,
171170
args: parts[2] ? parts[2].split(',') : [],
172171
line: parts[4] ? +parts[4] : null,
173172
column: parts[5] ? +parts[5] : null,
@@ -249,6 +248,38 @@ function computeStackTraceFromStacktraceProp(ex: any): StackTrace | null {
249248
};
250249
}
251250

251+
/**
252+
* Safari web extensions, starting version unknown, can produce "frames-only" stacktraces.
253+
* What it means, is that instead of format like:
254+
*
255+
* Error: wat
256+
* at function@url:row:col
257+
* at function@url:row:col
258+
* at function@url:row:col
259+
*
260+
* it produces something like:
261+
*
262+
* function@url:row:col
263+
* function@url:row:col
264+
* function@url:row:col
265+
*
266+
* Because of that, it won't be captured by `chrome` RegExp and will fall into `Gecko` branch.
267+
* This function is extracted so that we can use it in both places without duplicating the logic.
268+
* Unfortunatelly "just" changing RegExp is too complicated now and making it pass all tests
269+
* and fix this case seems like an impossible, or at least way too time-consuming task.
270+
*/
271+
const extractSafariExtensionDetails = (func: string, url: string): [string, string] => {
272+
const isSafariExtension = func.indexOf('safari-extension') !== -1;
273+
const isSafariWebExtension = func.indexOf('safari-web-extension') !== -1;
274+
275+
return isSafariExtension || isSafariWebExtension
276+
? [
277+
func.indexOf('@') !== -1 ? func.split('@')[0] : UNKNOWN_FUNCTION,
278+
isSafariExtension ? `safari-extension:${url}` : `safari-web-extension:${url}`,
279+
]
280+
: [func, url];
281+
};
282+
252283
/** Remove N number of frames from the stack */
253284
function popFrames(stacktrace: StackTrace, popSize: number): StackTrace {
254285
try {
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
import { expect } from 'chai';
2-
31
import { BrowserBackend } from '../../src/backend';
42

53
let backend: BrowserBackend;
64

75
describe('BrowserBackend', () => {
86
describe('sendEvent()', () => {
9-
it('should use NoopTransport', async () => {
7+
it('should use NoopTransport', () => {
108
backend = new BrowserBackend({});
11-
expect(backend.getTransport().constructor.name).to.equal('NoopTransport');
9+
expect(backend.getTransport().constructor.name).toBe('NoopTransport');
1210
});
1311
});
1412
});

0 commit comments

Comments
 (0)