Skip to content

Commit 72714e0

Browse files
committed
Merge branch 'master' of https://github.com/getsentry/sentry-javascript into onur/node-integration-tests
2 parents 18ecd7b + ebc9da5 commit 72714e0

File tree

190 files changed

+2632
-2396
lines changed

Some content is hidden

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

190 files changed

+2632
-2396
lines changed

.eslintrc.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,16 @@ module.exports = {
1010
ecmaVersion: 2018,
1111
},
1212
extends: ['@sentry-internal/sdk'],
13-
ignorePatterns: ['coverage/**', 'build/**', 'dist/**', 'esm/**', 'examples/**', 'scripts/**', 'test/manual/**'],
13+
ignorePatterns: [
14+
'coverage/**',
15+
'build/**',
16+
'dist/**',
17+
'esm/**',
18+
'examples/**',
19+
'scripts/**',
20+
'test/manual/**',
21+
'types/**',
22+
],
1423
overrides: [
1524
{
1625
files: ['*.ts', '*.tsx', '*.d.ts'],

.github/workflows/build.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,8 @@ jobs:
280280
name: Upload Artifacts
281281
needs: job_build
282282
runs-on: ubuntu-latest
283+
# Build artifacts are only needed for releasing workflow.
284+
if: startsWith(github.ref, 'refs/heads/release/')
283285
steps:
284286
- name: Check out current commit (${{ github.sha }})
285287
uses: actions/checkout@v2
@@ -302,7 +304,7 @@ jobs:
302304
with:
303305
name: ${{ github.sha }}
304306
path: |
305-
${{ github.workspace }}/packages/browser/build/**
307+
${{ github.workspace }}/packages/browser/build/bundles/**
306308
${{ github.workspace }}/packages/integrations/build/**
307309
${{ github.workspace }}/packages/tracing/build/**
308310
${{ github.workspace }}/packages/**/*.tgz

.github/workflows/release.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
force:
99
description: Force a release even when there are release-blockers (optional)
1010
required: false
11+
merge_target:
12+
description: Target branch to merge into. Uses the default branch as a fallback (optional)
13+
required: false
1114
jobs:
1215
release:
1316
runs-on: ubuntu-latest
@@ -24,3 +27,4 @@ jobs:
2427
with:
2528
version: ${{ github.event.inputs.version }}
2629
force: ${{ github.event.inputs.force }}
30+
merge_target: ${{ github.event.inputs.merge_target }}

.github/workflows/stale.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: 'close stale issues/PRs'
22
on:
33
schedule:
4-
- cron: '* */3 * * *'
4+
- cron: '0 0 * * *'
55
workflow_dispatch:
66
jobs:
77
stale:

.size-limit.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
11
module.exports = [
22
{
33
name: '@sentry/browser - ES5 CDN Bundle (gzipped + minified)',
4-
path: 'packages/browser/build/bundle.min.js',
4+
path: 'packages/browser/build/bundles/bundle.min.js',
55
gzip: true,
66
limit: '100 KB',
77
},
88
{
99
name: '@sentry/browser - ES5 CDN Bundle (minified)',
10-
path: 'packages/browser/build/bundle.min.js',
10+
path: 'packages/browser/build/bundles/bundle.min.js',
1111
gzip: false,
1212
limit: '120 KB',
1313
},
1414
{
1515
name: '@sentry/browser - ES6 CDN Bundle (gzipped + minified)',
16-
path: 'packages/browser/build/bundle.es6.min.js',
16+
path: 'packages/browser/build/bundles/bundle.es6.min.js',
1717
gzip: true,
1818
limit: '100 KB',
1919
},
2020
{
2121
name: '@sentry/browser - ES6 CDN Bundle (minified)',
22-
path: 'packages/browser/build/bundle.es6.min.js',
22+
path: 'packages/browser/build/bundles/bundle.es6.min.js',
2323
gzip: false,
2424
limit: '120 KB',
2525
},
2626
{
2727
name: '@sentry/browser - Webpack (gzipped + minified)',
28-
path: 'packages/browser/esm/index.js',
28+
path: 'packages/browser/build/esm/index.js',
2929
import: '{ init }',
3030
gzip: true,
3131
limit: '100 KB',
3232
},
3333
{
3434
name: '@sentry/browser - Webpack (minified)',
35-
path: 'packages/browser/esm/index.js',
35+
path: 'packages/browser/build/esm/index.js',
3636
import: '{ init }',
3737
gzip: false,
3838
limit: '100 KB',

.vscode/settings.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,8 @@
1717
"editor.formatOnType": false,
1818
"editor.formatOnPaste": false,
1919
"editor.formatOnSave": false
20-
}
20+
},
21+
"yaml.schemas": {
22+
"https://json.schemastore.org/github-workflow.json": ".github/workflows/**.yml"
23+
},
2124
}

CHANGELOG.md

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

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

7+
## 6.19.0
8+
9+
This release makes a change to the data normalization process, limiting the number of entries or properties which will be included in any given array or object to 1000. Previously there was no limit, so in rare cases you may notice a change in your context data. If this is a problem, you can increase the limit with the new `maxNormalizationBreadth` setting. See [#4689](https://github.com/getsentry/sentry-javascript/pull/4689) for details.
10+
11+
feat(build): Create debug versions of minified bundles ([#4699](https://github.com/getsentry/sentry-javascript/pull/4699))
12+
feat(integrations): Make ES6 integration bundles ([#4718](https://github.com/getsentry/sentry-javascript/pull/4718))
13+
feat(utils): Limit `normalize` maximum properties/elements ([#4689](https://github.com/getsentry/sentry-javascript/pull/4689))
14+
feat(various): Apply debug guard to logger everywhere ([#4698](https://github.com/getsentry/sentry-javascript/pull/4698))
15+
fix(browser): Use `apply` rather than `call` in `try-catch` integration ([#4695](https://github.com/getsentry/sentry-javascript/pull/4695))
16+
fix(ember): Fix merging env config ([#4714](https://github.com/getsentry/sentry-javascript/pull/4714))
17+
fix(nextjs): Add env var to suppress API non-response meta-warning ([#4706](https://github.com/getsentry/sentry-javascript/pull/4706))
18+
fix(nextjs): Widen scope for client file upload ([#4705](https://github.com/getsentry/sentry-javascript/pull/4705))
19+
fix(node): Fix async stack parsing ([#4721](https://github.com/getsentry/sentry-javascript/pull/4721))
20+
ref(browser): Use ratelimit utils in base transport ([#4686](https://github.com/getsentry/sentry-javascript/pull/4686))
21+
ref(build): Introduce root build directory in `@sentry/browser` ([#4688](https://github.com/getsentry/sentry-javascript/pull/4688))
22+
ref(minimal): Simplify `syntheticException` creation ([#4691](https://github.com/getsentry/sentry-javascript/pull/4691))
23+
ref(tracing): Remove `BrowserTracing` logging flag default value ([#4708](https://github.com/getsentry/sentry-javascript/pull/4708))
24+
ref(utils): Simplify `isDebugBuild` logging guard ([#4696](https://github.com/getsentry/sentry-javascript/pull/4696))
25+
26+
Work in this release contributed by @Turbo87. Thank you for your contribution!
27+
728
## 6.18.2
829

930
If you are using `@sentry-internal/eslint-config-sdk`, please note that this release turns on the [quotes rule](https://eslint.org/docs/rules/quotes) to enforce usage of single quotes.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ package. Please refer to the README and instructions of those SDKs for more deta
5252
- [`@sentry/node`](https://github.com/getsentry/sentry-javascript/tree/master/packages/node): SDK for Node, including
5353
integrations for Express, Koa, Loopback, Sails and Connect
5454
- [`@sentry/angular`](https://github.com/getsentry/sentry-javascript/tree/master/packages/angular): browser SDK with Angular integration enabled
55-
- [`@sentry/react`](https://github.com/getsentry/sentry-javascript/tree/master/packages/react): browser SDK with React integration enabled
55+
- [`@sentry/react`](https://github.com/getsentry/sentry-javascript/tree/master/packages/react): browser SDK with React integration enabled
5656
- [`@sentry/ember`](https://github.com/getsentry/sentry-javascript/tree/master/packages/ember): browser SDK with Ember integration enabled
5757
- [`@sentry/vue`](https://github.com/getsentry/sentry-javascript/tree/master/packages/vue): browser SDK with Vue integration enabled
5858
- [`@sentry/gatsby`](https://github.com/getsentry/sentry-javascript/tree/master/packages/gatsby): SDK for Gatsby

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@
88
"build:dev:filter": "lerna run --stream --concurrency 1 --sort build:dev --include-filtered-dependencies --include-filtered-dependents --scope",
99
"build:es5": "yarn lerna run --stream --concurrency 1 --sort build:cjs # *** backwards compatibility - remove in v7 ***",
1010
"build:esm": "lerna run --stream --concurrency 1 --sort build:esm",
11+
"build:types": "lerna run --stream --concurrency 1 --sort build:types",
1112
"build:watch": "lerna run --parallel build:watch",
1213
"build:dev:watch": "lerna run --parallel build:dev:watch",
14+
"build:types:watch": "ts-node scripts/build-types-watch.ts",
1315
"circularDepCheck": "lerna run --parallel circularDepCheck",
1416
"clean": "lerna run --parallel clean && lerna clean --yes",
1517
"codecov": "codecov",
@@ -83,6 +85,8 @@
8385
"sinon": "^7.3.2",
8486
"size-limit": "^4.5.5",
8587
"ts-jest": "^24.3.0",
88+
"ts-node": "^10.7.0",
89+
"tslib": "^2.3.1",
8690
"typedoc": "^0.18.0",
8791
"typescript": "3.7.5"
8892
},

packages/angular/package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
},
1212
"main": "dist/index.js",
1313
"module": "esm/index.js",
14-
"types": "dist/index.d.ts",
14+
"types": "build/types/index.d.ts",
1515
"publishConfig": {
1616
"access": "public"
1717
},
@@ -33,16 +33,18 @@
3333
"@angular/router": "^10.0.3"
3434
},
3535
"scripts": {
36-
"build": "run-p build:cjs build:esm",
36+
"build": "run-p build:cjs build:esm build:types",
3737
"build:cjs": "tsc -p tsconfig.cjs.json",
3838
"build:dev": "run-s build",
3939
"build:es5": "yarn build:cjs # *** backwards compatibility - remove in v7 ***",
4040
"build:esm": "tsc -p tsconfig.esm.json",
41-
"build:watch": "run-p build:cjs:watch build:esm:watch",
41+
"build:types": "tsc -p tsconfig.types.json",
42+
"build:watch": "run-p build:cjs:watch build:esm:watch build:types:watch",
4243
"build:cjs:watch": "tsc -p tsconfig.cjs.json --watch",
4344
"build:dev:watch": "run-s build:watch",
4445
"build:es5:watch": "yarn build:cjs:watch # *** backwards compatibility - remove in v7 ***",
4546
"build:esm:watch": "tsc -p tsconfig.esm.json --watch",
47+
"build:types:watch": "tsc -p tsconfig.types.json --watch",
4648
"circularDepCheck": "madge --circular src/index.ts",
4749
"clean": "rimraf dist esm build coverage",
4850
"fix": "run-s fix:eslint fix:prettier",

packages/angular/src/tracing.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { AfterViewInit, Directive, Injectable, Input, NgModule, OnDestroy, OnIni
22
import { Event, NavigationEnd, NavigationStart, Router } from '@angular/router';
33
import { getCurrentHub } from '@sentry/browser';
44
import { Span, Transaction, TransactionContext } from '@sentry/types';
5-
import { getGlobalObject, logger, stripUrlQueryAndFragment, timestampWithMs } from '@sentry/utils';
5+
import { getGlobalObject, isDebugBuild, logger, stripUrlQueryAndFragment, timestampWithMs } from '@sentry/utils';
66
import { Observable, Subscription } from 'rxjs';
77
import { filter, tap } from 'rxjs/operators';
88

@@ -63,7 +63,8 @@ export class TraceService implements OnDestroy {
6363
filter(event => event instanceof NavigationStart),
6464
tap(event => {
6565
if (!instrumentationInitialized) {
66-
logger.error('Angular integration has tracing enabled, but Tracing integration is not configured');
66+
isDebugBuild() &&
67+
logger.error('Angular integration has tracing enabled, but Tracing integration is not configured');
6768
return;
6869
}
6970

packages/angular/tsconfig.types.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
4+
"compilerOptions": {
5+
"declaration": true,
6+
"declarationMap": true,
7+
"emitDeclarationOnly": true,
8+
"outDir": "build/types"
9+
}
10+
}

packages/browser/examples/bundle.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
../build/bundle.js
1+
../build/bundles/bundle.js

packages/browser/package.json

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
"engines": {
1010
"node": ">=6"
1111
},
12-
"main": "dist/index.js",
13-
"module": "esm/index.js",
14-
"types": "dist/index.d.ts",
12+
"main": "build/dist/index.js",
13+
"module": "build/esm/index.js",
14+
"types": "build/types/index.d.ts",
1515
"publishConfig": {
1616
"access": "public"
1717
},
@@ -44,31 +44,33 @@
4444
"webpack": "^4.30.0"
4545
},
4646
"scripts": {
47-
"build": "run-p build:cjs build:esm build:bundle",
47+
"build": "run-p build:cjs build:esm build:bundle build:types && bash ../../scripts/postbuild.sh",
4848
"build:bundle": "rollup --config",
4949
"build:cjs": "tsc -p tsconfig.cjs.json",
50-
"build:dev": "run-p build:cjs build:esm",
50+
"build:dev": "run-p build:cjs build:esm build:types",
5151
"build:es5": "yarn build:cjs # *** backwards compatibility - remove in v7 ***",
5252
"build:esm": "tsc -p tsconfig.esm.json",
53-
"build:watch": "run-p build:cjs:watch build:esm:watch build:bundle:watch",
53+
"build:types": "tsc -p tsconfig.types.json",
54+
"build:watch": "run-p build:cjs:watch build:esm:watch build:bundle:watch build:types:watch",
5455
"build:bundle:watch": "rollup --config --watch",
5556
"build:cjs:watch": "tsc -p tsconfig.cjs.json --watch",
5657
"build:es5:watch": "yarn build:cjs:watch # *** backwards compatibility - remove in v7 ***",
57-
"build:dev:watch": "run-p build:cjs:watch build:esm:watch",
58+
"build:dev:watch": "run-p build:cjs:watch build:esm:watch build:types:watch",
5859
"build:esm:watch": "tsc -p tsconfig.esm.json --watch",
60+
"build:types:watch": "tsc -p tsconfig.types.json --watch",
5961
"circularDepCheck": "madge --circular src/index.ts",
60-
"clean": "rimraf dist esm build coverage .rpt2_cache",
62+
"clean": "rimraf build coverage .rpt2_cache",
6163
"fix": "run-s fix:eslint fix:prettier",
6264
"fix:eslint": "eslint . --format stylish --fix",
6365
"fix:prettier": "prettier --write \"{src,test}/**/*.ts\"",
6466
"link:yarn": "yarn link",
6567
"lint": "run-s lint:prettier lint:eslint",
6668
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
6769
"lint:prettier": "prettier --check \"{src,test}/**/*.ts\"",
68-
"pack": "npm pack",
70+
"pack": "npm pack ./build",
6971
"size:check": "run-p size:check:es5 size:check:es6",
70-
"size:check:es5": "cat build/bundle.min.js | gzip -9 | wc -c | awk '{$1=$1/1024; print \"ES5: \",$1,\"kB\";}'",
71-
"size:check:es6": "cat build/bundle.es6.min.js | gzip -9 | wc -c | awk '{$1=$1/1024; print \"ES6: \",$1,\"kB\";}'",
72+
"size:check:es5": "cat build/bundles/bundle.min.js | gzip -9 | wc -c | awk '{$1=$1/1024; print \"ES5: \",$1,\"kB\";}'",
73+
"size:check:es6": "cat build/bundles/bundle.es6.min.js | gzip -9 | wc -c | awk '{$1=$1/1024; print \"ES6: \",$1,\"kB\";}'",
7274
"test": "run-s test:unit",
7375
"test:unit": "jest --config test/unit/jest.config.js",
7476
"test:integration": "test/integration/run.js",

packages/browser/rollup.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { makeBaseBundleConfig, makeMinificationVariants } from '../../rollup.config';
1+
import { makeBaseBundleConfig, makeConfigVariants } from '../../rollup.config';
22

33
const builds = [];
44

@@ -8,10 +8,10 @@ const builds = [];
88
isAddOn: false,
99
jsVersion,
1010
licenseTitle: '@sentry/browser',
11-
outputFileBase: `build/bundle${jsVersion === 'es6' ? '.es6' : ''}`,
11+
outputFileBase: `bundles/bundle${jsVersion === 'es6' ? '.es6' : ''}`,
1212
});
1313

14-
builds.push(...makeMinificationVariants(baseBundleConfig));
14+
builds.push(...makeConfigVariants(baseBundleConfig));
1515
});
1616

1717
export default builds;

packages/browser/src/client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { BaseClient, Scope, SDK_VERSION } from '@sentry/core';
22
import { Event, EventHint } from '@sentry/types';
3-
import { getGlobalObject, logger } from '@sentry/utils';
3+
import { getGlobalObject, isDebugBuild, logger } from '@sentry/utils';
44

55
import { BrowserBackend, BrowserOptions } from './backend';
66
import { injectReportDialog, ReportDialogOptions } from './helpers';
@@ -47,7 +47,7 @@ export class BrowserClient extends BaseClient<BrowserBackend, BrowserOptions> {
4747
}
4848

4949
if (!this._isEnabled()) {
50-
logger.error('Trying to call showReportDialog with Sentry Client disabled');
50+
isDebugBuild() && logger.error('Trying to call showReportDialog with Sentry Client disabled');
5151
return;
5252
}
5353

packages/browser/src/helpers.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -192,16 +192,12 @@ export function injectReportDialog(options: ReportDialogOptions = {}): void {
192192
}
193193

194194
if (!options.eventId) {
195-
if (isDebugBuild()) {
196-
logger.error('Missing eventId option in showReportDialog call');
197-
}
195+
isDebugBuild() && logger.error('Missing eventId option in showReportDialog call');
198196
return;
199197
}
200198

201199
if (!options.dsn) {
202-
if (isDebugBuild()) {
203-
logger.error('Missing dsn option in showReportDialog call');
204-
}
200+
isDebugBuild() && logger.error('Missing dsn option in showReportDialog call');
205201
return;
206202
}
207203

packages/browser/src/integrations/dedupe.ts

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

44
/** Deduplication filter */
55
export class Dedupe implements Integration {
@@ -28,7 +28,7 @@ export class Dedupe implements Integration {
2828
// Juuust in case something goes wrong
2929
try {
3030
if (_shouldDropEvent(currentEvent, self._previousEvent)) {
31-
logger.warn('Event dropped due to being a duplicate of previously captured event.');
31+
isDebugBuild() && logger.warn('Event dropped due to being a duplicate of previously captured event.');
3232
return null;
3333
}
3434
} catch (_oO) {

packages/browser/src/integrations/globalhandlers.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,9 +237,7 @@ function _enhanceEventWithInitialFrame(event: Event, url: any, line: any, column
237237
}
238238

239239
function globalHandlerLog(type: string): void {
240-
if (isDebugBuild()) {
241-
logger.log(`Global Handler attached: ${type}`);
242-
}
240+
isDebugBuild() && logger.log(`Global Handler attached: ${type}`);
243241
}
244242

245243
function addMechanismAndCapture(hub: Hub, error: EventHint['originalException'], event: Event, type: string): void {

0 commit comments

Comments
 (0)