Skip to content

Commit 76d8998

Browse files
committed
Merge branch 'master' into feat/separate-source-reading
2 parents 270e13e + d5c3929 commit 76d8998

Some content is hidden

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

67 files changed

+3057
-3186
lines changed

.size-limit.js

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,58 @@
11
module.exports = [
22
{
3-
name: '@sentry/browser - CDN Bundle (gzipped)',
3+
name: '@sentry/browser - ES5 CDN Bundle (gzipped + minified)',
44
path: 'packages/browser/build/bundle.min.js',
55
gzip: true,
66
limit: '100 KB',
77
},
88
{
9-
name: '@sentry/browser - CDN Bundle (minified)',
9+
name: '@sentry/browser - ES5 CDN Bundle (minified)',
1010
path: 'packages/browser/build/bundle.min.js',
1111
gzip: false,
1212
limit: '120 KB',
1313
},
1414
{
15-
name: '@sentry/browser - Webpack',
15+
name: '@sentry/browser - ES6 CDN Bundle (gzipped + minified)',
16+
path: 'packages/browser/build/bundle.es6.min.js',
17+
gzip: true,
18+
limit: '100 KB',
19+
},
20+
{
21+
name: '@sentry/browser - ES6 CDN Bundle (minified)',
22+
path: 'packages/browser/build/bundle.es6.min.js',
23+
gzip: false,
24+
limit: '120 KB',
25+
},
26+
{
27+
name: '@sentry/browser - Webpack (gzipped + minified)',
1628
path: 'packages/browser/esm/index.js',
1729
import: '{ init }',
30+
gzip: true,
1831
limit: '100 KB',
1932
},
2033
{
21-
name: '@sentry/browser - Webpack - gzip = false',
34+
name: '@sentry/browser - Webpack (minified)',
2235
path: 'packages/browser/esm/index.js',
2336
import: '{ init }',
2437
gzip: false,
2538
limit: '100 KB',
2639
},
2740
{
28-
name: '@sentry/react - Webpack',
41+
name: '@sentry/react - Webpack (gzipped + minified)',
2942
path: 'packages/react/esm/index.js',
3043
import: '{ init }',
44+
gzip: true,
3145
limit: '100 KB',
3246
},
3347
{
34-
name: '@sentry/nextjs Client - Webpack',
48+
name: '@sentry/nextjs Client - Webpack (gzipped + minified)',
3549
path: 'packages/nextjs/esm/index.client.js',
3650
import: '{ init }',
51+
gzip: true,
3752
limit: '100 KB',
3853
},
3954
{
40-
name: '@sentry/browser + @sentry/tracing - CDN Bundle (gzipped)',
55+
name: '@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified)',
4156
path: 'packages/tracing/build/bundle.tracing.min.js',
4257
gzip: true,
4358
limit: '100 KB',

CHANGELOG.md

Lines changed: 583 additions & 576 deletions
Large diffs are not rendered by default.

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

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
],
5252
"devDependencies": {
5353
"@google-cloud/storage": "^5.7.0",
54+
"@rollup/plugin-replace": "^3.0.1",
5455
"@size-limit/preset-small-lib": "^4.5.5",
5556
"@strictsoftware/typedoc-plugin-monorepo": "^0.3.1",
5657
"@types/chai": "^4.1.3",
@@ -71,6 +72,9 @@
7172
"prettier": "2.5.1",
7273
"replace-in-file": "^4.0.0",
7374
"rimraf": "^3.0.2",
75+
"rollup-plugin-license": "^2.6.1",
76+
"rollup-plugin-terser": "^7.0.2",
77+
"rollup-plugin-typescript2": "^0.31.2",
7478
"sinon": "^7.3.2",
7579
"size-limit": "^4.5.5",
7680
"ts-jest": "^24.3.0",

packages/angular/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry/angular",
3-
"version": "6.17.5",
3+
"version": "6.17.7",
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.5",
25-
"@sentry/types": "6.17.5",
26-
"@sentry/utils": "6.17.5",
24+
"@sentry/browser": "6.17.7",
25+
"@sentry/types": "6.17.7",
26+
"@sentry/utils": "6.17.7",
2727
"rxjs": "^6.6.0",
2828
"tslib": "^1.9.3"
2929
},

packages/browser/package.json

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry/browser",
3-
"version": "6.17.5",
3+
"version": "6.17.7",
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.5",
20-
"@sentry/types": "6.17.5",
21-
"@sentry/utils": "6.17.5",
19+
"@sentry/core": "6.17.7",
20+
"@sentry/types": "6.17.7",
21+
"@sentry/utils": "6.17.7",
2222
"tslib": "^1.9.3"
2323
},
2424
"devDependencies": {
@@ -42,10 +42,7 @@
4242
"playwright": "^1.17.1",
4343
"rollup": "^1.10.1",
4444
"rollup-plugin-commonjs": "^9.3.4",
45-
"rollup-plugin-license": "^0.8.1",
4645
"rollup-plugin-node-resolve": "^4.2.3",
47-
"rollup-plugin-terser": "^4.0.4",
48-
"rollup-plugin-typescript2": "^0.21.0",
4946
"sinon": "^7.3.2",
5047
"webpack": "^4.30.0"
5148
},

packages/browser/rollup.config.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import typescript from 'rollup-plugin-typescript2';
33
import license from 'rollup-plugin-license';
44
import resolve from 'rollup-plugin-node-resolve';
55
import commonjs from 'rollup-plugin-commonjs';
6+
import replace from '@rollup/plugin-replace';
67

78
const commitHash = require('child_process')
89
.execSync('git rev-parse --short HEAD', { encoding: 'utf-8' })
@@ -13,7 +14,6 @@ const terserInstance = terser({
1314
// Tell env.ts that we're building a browser bundle and that we do not
1415
// want to have unnecessary debug functionality.
1516
global_defs: {
16-
__SENTRY_BROWSER_BUNDLE__: true,
1717
__SENTRY_NO_DEBUG__: false,
1818
},
1919
},
@@ -33,6 +33,9 @@ const terserInstance = terser({
3333
reserved: ['_mergeOptions'],
3434
},
3535
},
36+
output: {
37+
comments: false,
38+
},
3639
});
3740

3841
const paths = {
@@ -56,6 +59,16 @@ const plugins = [
5659
},
5760
include: ['*.ts+(|x)', '**/*.ts+(|x)', '../**/*.ts+(|x)'],
5861
}),
62+
replace({
63+
// don't replace `__placeholder__` where it's followed immediately by a single `=` (to prevent ending up
64+
// with something of the form `let "replacementValue" = "some assigned value"`, which would cause a
65+
// syntax error)
66+
preventAssignment: true,
67+
// the replacements to make
68+
values: {
69+
__SENTRY_BROWSER_BUNDLE__: true,
70+
},
71+
}),
5972
resolve({
6073
mainFields: ['module'],
6174
}),
@@ -78,6 +91,7 @@ const bundleConfig = {
7891
banner: `/*! @sentry/browser <%= pkg.version %> (${commitHash}) | https://github.com/getsentry/sentry-javascript */`,
7992
}),
8093
],
94+
treeshake: 'smallest',
8195
};
8296

8397
export default [

packages/browser/src/parsers.ts

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Event, Exception, StackFrame } from '@sentry/types';
22
import { extractExceptionKeysForMessage, isEvent, normalizeToSize } from '@sentry/utils';
33

4-
import { computeStackTrace, StackFrame as TraceKitStackFrame, StackTrace as TraceKitStackTrace } from './tracekit';
4+
import { computeStackTrace, StackTrace as TraceKitStackTrace } from './tracekit';
55

66
const STACKTRACE_LIMIT = 50;
77

@@ -80,15 +80,15 @@ export function eventFromStacktrace(stacktrace: TraceKitStackTrace): Event {
8080
/**
8181
* @hidden
8282
*/
83-
export function prepareFramesForEvent(stack: TraceKitStackFrame[]): StackFrame[] {
84-
if (!stack || !stack.length) {
83+
export function prepareFramesForEvent(stack: StackFrame[]): StackFrame[] {
84+
if (!stack.length) {
8585
return [];
8686
}
8787

8888
let localStack = stack;
8989

90-
const firstFrameFunction = localStack[0].func || '';
91-
const lastFrameFunction = localStack[localStack.length - 1].func || '';
90+
const firstFrameFunction = localStack[0].function || '';
91+
const lastFrameFunction = localStack[localStack.length - 1].function || '';
9292

9393
// If stack starts with one of our API calls, remove it (starts, meaning it's the top of the stack - aka last call)
9494
if (firstFrameFunction.indexOf('captureMessage') !== -1 || firstFrameFunction.indexOf('captureException') !== -1) {
@@ -103,14 +103,12 @@ export function prepareFramesForEvent(stack: TraceKitStackFrame[]): StackFrame[]
103103
// The frame where the crash happened, should be the last entry in the array
104104
return localStack
105105
.slice(0, STACKTRACE_LIMIT)
106-
.map(
107-
(frame: TraceKitStackFrame): StackFrame => ({
108-
colno: frame.column === null ? undefined : frame.column,
109-
filename: frame.url || localStack[0].url,
110-
function: frame.func || '?',
111-
in_app: true,
112-
lineno: frame.line === null ? undefined : frame.line,
113-
}),
114-
)
106+
.map(frame => ({
107+
filename: frame.filename || localStack[0].filename,
108+
function: frame.function || '?',
109+
lineno: frame.lineno,
110+
colno: frame.colno,
111+
in_app: true,
112+
}))
115113
.reverse();
116114
}

0 commit comments

Comments
 (0)