Skip to content

Commit 913b0ca

Browse files
authored
feat: Try size-limit gh action (#2750)
* feat: Try size-limit gh action * ref: Fix version * feat: Lock typescript version * feat: Pin typescript and lint version * ci: Try skip scripts * ref: Add size check for tracing and react
1 parent 820bd77 commit 913b0ca

File tree

31 files changed

+4683
-3108
lines changed

31 files changed

+4683
-3108
lines changed

.github/workflows/size-limit.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: 'Bundle Size'
2+
on:
3+
pull_request:
4+
branches:
5+
- master
6+
jobs:
7+
job_1:
8+
name: Size Check
9+
runs-on: ubuntu-latest
10+
env:
11+
CI_JOB_NUMBER: 1
12+
steps:
13+
- uses: actions/checkout@v2
14+
- uses: andresz1/[email protected]
15+
with:
16+
github_token: ${{ secrets.GITHUB_TOKEN }}

.size-limit.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
module.exports = [
2+
{
3+
name: '@sentry/browser - CDN Bundle (gzipped)',
4+
path: 'packages/browser/build/bundle.min.js',
5+
gzip: true,
6+
limit: '18 KB',
7+
},
8+
{
9+
name: '@sentry/browser - Webpack',
10+
path: 'packages/browser/esm/index.js',
11+
import: '{ init }',
12+
limit: '18 KB',
13+
},
14+
{
15+
name: '@sentry/react - Webpack',
16+
path: 'packages/react/esm/index.js',
17+
import: '{ init }',
18+
limit: '19 KB',
19+
},
20+
{
21+
name: '@sentry/browser + @sentry/tracing - CDN Bundle (gzipped)',
22+
path: 'packages/tracing/build/bundle.tracing.min.js',
23+
gzip: true,
24+
limit: '23 KB',
25+
},
26+
];

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ branches:
77
- /^release\/.+$/
88
- /^major\/.+$/
99

10-
install: yarn --ignore-engines
10+
install: yarn --ignore-engines --ignore-scripts
1111
os: linux
1212

1313
language: node_js

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"postpublish": "make publish-docs"
1616
},
1717
"volta": {
18-
"node": "10.15.3",
18+
"node": "10.18.1",
1919
"yarn": "1.13.0"
2020
},
2121
"workspaces": [
@@ -35,6 +35,7 @@
3535
],
3636
"devDependencies": {
3737
"@google-cloud/storage": "^2.5.0",
38+
"@size-limit/preset-big-lib": "^4.5.5",
3839
"@strictsoftware/typedoc-plugin-monorepo": "^0.2.1",
3940
"@types/chai": "^4.1.3",
4041
"@types/jest": "^24.0.11",
@@ -56,10 +57,11 @@
5657
"replace-in-file": "^4.0.0",
5758
"rimraf": "^2.6.3",
5859
"sinon": "^7.3.2",
60+
"size-limit": "^4.5.5",
5961
"ts-jest": "^24.0.2",
60-
"tslint": "^5.16.0",
62+
"tslint": "5.16.0",
6163
"typedoc": "^0.14.2",
62-
"typescript": "^3.4.5",
64+
"typescript": "3.4.5",
6365
"typescript-tslint-plugin": "^0.3.1"
6466
},
6567
"resolutions": {

packages/apm/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
"rollup-plugin-node-resolve": "^4.2.3",
3737
"rollup-plugin-terser": "^4.0.4",
3838
"rollup-plugin-typescript2": "^0.21.0",
39-
"tslint": "^5.16.0",
40-
"typescript": "^3.4.5"
39+
"tslint": "5.16.0",
40+
"typescript": "3.4.5"
4141
},
4242
"scripts": {
4343
"build": "run-p build:es5 build:esm build:bundle",

packages/apm/src/integrations/tracing.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,9 +350,7 @@ export class Tracing implements Integration {
350350
if (Tracing._heartbeatCounter >= 3) {
351351
if (Tracing._activeTransaction) {
352352
Tracing._log(
353-
`[Tracing] Transaction: ${
354-
SpanStatus.Cancelled
355-
} -> Heartbeat safeguard kicked in since content hasn't changed for 3 beats`,
353+
`[Tracing] Transaction: ${SpanStatus.Cancelled} -> Heartbeat safeguard kicked in since content hasn't changed for 3 beats`,
356354
);
357355
Tracing._activeTransaction.setStatus(SpanStatus.DeadlineExceeded);
358356
Tracing._activeTransaction.setTag('heartbeat', 'failed');

packages/browser/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@
4949
"rollup-plugin-terser": "^4.0.4",
5050
"rollup-plugin-typescript2": "^0.21.0",
5151
"sinon": "^7.3.2",
52-
"tslint": "^5.16.0",
53-
"typescript": "^3.4.5",
52+
"tslint": "5.16.0",
53+
"typescript": "3.4.5",
5454
"webpack": "^4.30.0"
5555
},
5656
"scripts": {

packages/core/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
"prettier": "^1.17.0",
2929
"prettier-check": "^2.0.0",
3030
"rimraf": "^2.6.3",
31-
"tslint": "^5.16.0",
32-
"typescript": "^3.4.5"
31+
"tslint": "5.16.0",
32+
"typescript": "3.4.5"
3333
},
3434
"scripts": {
3535
"build": "run-p build:es5 build:esm",

packages/core/test/lib/base.test.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -804,9 +804,15 @@ describe('BaseClient', () => {
804804
const client = new TestClient({ dsn: PUBLIC_DSN });
805805

806806
return Promise.all([
807-
client.flush(1).then(() => expect(true).toEqual(true)),
808-
client.flush(1).then(() => expect(true).toEqual(true)),
809-
client.flush(1).then(() => expect(true).toEqual(true)),
807+
client.flush(1).then(() => {
808+
expect(true).toEqual(true);
809+
}),
810+
client.flush(1).then(() => {
811+
expect(true).toEqual(true);
812+
}),
813+
client.flush(1).then(() => {
814+
expect(true).toEqual(true);
815+
}),
810816
]);
811817
});
812818
});

packages/gatsby/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838
"prettier": "^1.17.0",
3939
"prettier-check": "^2.0.0",
4040
"rimraf": "^2.6.3",
41-
"tslint": "^5.16.0",
42-
"typescript": "^3.5.1"
41+
"tslint": "5.16.0",
42+
"typescript": "3.4.5"
4343
},
4444
"scripts": {
4545
"build": "run-p build:es5 build:esm",

packages/hub/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
"prettier": "^1.17.0",
2727
"prettier-check": "^2.0.0",
2828
"rimraf": "^2.6.3",
29-
"tslint": "^5.16.0",
30-
"typescript": "^3.4.5"
29+
"tslint": "5.16.0",
30+
"typescript": "3.4.5"
3131
},
3232
"scripts": {
3333
"build": "run-p build:es5 build:esm",

packages/hub/src/scope.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ export class Scope implements ScopeInterface {
268268
}
269269

270270
if (typeof captureContext === 'function') {
271-
const updatedScope = (captureContext as (<T>(scope: T) => T))(this);
271+
const updatedScope = (captureContext as <T>(scope: T) => T)(this);
272272
return updatedScope instanceof Scope ? updatedScope : this;
273273
}
274274

packages/integrations/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
"rollup-plugin-node-resolve": "^4.2.3",
3333
"rollup-plugin-terser": "^4.0.4",
3434
"rollup-plugin-typescript2": "^0.21.0",
35-
"tslint": "^5.16.0",
36-
"typescript": "^3.4.5"
35+
"tslint": "5.16.0",
36+
"typescript": "3.4.5"
3737
},
3838
"scripts": {
3939
"build": "run-p build:es5 build:esm build:bundle",

packages/integrations/src/ember.ts

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,18 @@ export class Ember implements Integration {
5050
}
5151
};
5252

53-
this._Ember.RSVP.on(
54-
'error',
55-
(reason: any): void => {
56-
if (getCurrentHub().getIntegration(Ember)) {
57-
getCurrentHub().withScope(scope => {
58-
if (isInstanceOf(reason, Error)) {
59-
scope.setExtra('context', 'Unhandled Promise error detected');
60-
getCurrentHub().captureException(reason, { originalException: reason });
61-
} else {
62-
scope.setExtra('reason', reason);
63-
getCurrentHub().captureMessage('Unhandled Promise error detected');
64-
}
65-
});
66-
}
67-
},
68-
);
53+
this._Ember.RSVP.on('error', (reason: any): void => {
54+
if (getCurrentHub().getIntegration(Ember)) {
55+
getCurrentHub().withScope(scope => {
56+
if (isInstanceOf(reason, Error)) {
57+
scope.setExtra('context', 'Unhandled Promise error detected');
58+
getCurrentHub().captureException(reason, { originalException: reason });
59+
} else {
60+
scope.setExtra('reason', reason);
61+
getCurrentHub().captureMessage('Unhandled Promise error detected');
62+
}
63+
});
64+
}
65+
});
6966
}
7067
}

packages/integrations/src/reportingobserver.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export class ReportingObserver implements Integration {
8989

9090
this._getCurrentHub = getCurrentHub;
9191

92-
const observer = new (getGlobalObject<any>()).ReportingObserver(this.handler.bind(this), {
92+
const observer = new (getGlobalObject<any>().ReportingObserver)(this.handler.bind(this), {
9393
buffered: true,
9494
types: this._options.types,
9595
});

packages/minimal/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
"prettier": "^1.17.0",
2727
"prettier-check": "^2.0.0",
2828
"rimraf": "^2.6.3",
29-
"tslint": "^5.16.0",
30-
"typescript": "^3.4.5"
29+
"tslint": "5.16.0",
30+
"typescript": "3.4.5"
3131
},
3232
"scripts": {
3333
"build": "run-p build:es5 build:esm",

packages/node/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
"prettier": "^1.17.0",
3838
"prettier-check": "^2.0.0",
3939
"rimraf": "^2.6.3",
40-
"tslint": "^5.16.0",
41-
"typescript": "^3.4.5"
40+
"tslint": "5.16.0",
41+
"typescript": "3.4.5"
4242
},
4343
"scripts": {
4444
"build": "run-p build:es5 build:esm",

packages/node/src/handlers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ function extractTransaction(req: { [key: string]: any }, type: boolean | Transac
8888
stack: [
8989
{
9090
name: string;
91-
}
91+
},
9292
];
9393
};
9494
};

packages/react/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@
4242
"react-test-renderer": "^16.13.1",
4343
"redux": "^4.0.5",
4444
"rimraf": "^2.6.3",
45-
"tslint": "^5.16.0",
45+
"tslint": "5.16.0",
4646
"tslint-react": "^5.0.0",
4747
"tslint-react-hooks": "^2.2.2",
48-
"typescript": "^3.5.1"
48+
"typescript": "3.4.5"
4949
},
5050
"scripts": {
5151
"build": "run-p build:es5 build:esm",

packages/tracing/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838
"rollup-plugin-node-resolve": "^4.2.3",
3939
"rollup-plugin-terser": "^4.0.4",
4040
"rollup-plugin-typescript2": "^0.21.0",
41-
"tslint": "^5.16.0",
42-
"typescript": "^3.4.5"
41+
"tslint": "5.16.0",
42+
"typescript": "3.4.5"
4343
},
4444
"scripts": {
4545
"build": "run-p build:es5 build:esm build:bundle",

packages/tracing/src/browser/backgroundtab.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ export function registerBackgroundTabDetection(): void {
1717
const activeTransaction = getActiveTransaction() as IdleTransaction;
1818
if (global.document.hidden && activeTransaction) {
1919
logger.log(
20-
`[Tracing] Transaction: ${SpanStatus.Cancelled} -> since tab moved to the background, op: ${
21-
activeTransaction.op
22-
}`,
20+
`[Tracing] Transaction: ${SpanStatus.Cancelled} -> since tab moved to the background, op: ${activeTransaction.op}`,
2321
);
2422
activeTransaction.setStatus(SpanStatus.Cancelled);
2523
activeTransaction.setTag('visibilitychange', 'document.hidden');

packages/tracing/src/idletransaction.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,7 @@ export class IdleTransaction extends Transaction {
115115

116116
if (this._heartbeatCounter >= 3) {
117117
logger.log(
118-
`[Tracing] Transaction: ${
119-
SpanStatus.Cancelled
120-
} -> Heartbeat safeguard kicked in since content hasn't changed for 3 beats`,
118+
`[Tracing] Transaction: ${SpanStatus.Cancelled} -> Heartbeat safeguard kicked in since content hasn't changed for 3 beats`,
121119
);
122120
this.setStatus(SpanStatus.DeadlineExceeded);
123121
this.setTag('heartbeat', 'failed');

packages/tracing/test/tslint.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"extends": ["../tslint.json"],
33
"rules": {
4-
"no-unsafe-any": false
4+
"no-unsafe-any": false,
5+
"no-implicit-dependencies": false
56
}
67
}

packages/types/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
"npm-run-all": "^4.1.2",
2020
"prettier": "^1.17.0",
2121
"prettier-check": "^2.0.0",
22-
"tslint": "^5.16.0",
23-
"typescript": "^3.4.5"
22+
"tslint": "5.16.0",
23+
"typescript": "3.4.5"
2424
},
2525
"scripts": {
2626
"build": "run-p build:es5 build:esm",

packages/typescript/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"tslint-consistent-codestyle": "^1.15.1"
1616
},
1717
"peerDependencies": {
18-
"tslint": "^5.11.0",
18+
"tslint": "5.16.0",
1919
"typescript": "^3.2.0"
2020
},
2121
"scripts": {

packages/utils/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
"prettier": "^1.17.0",
2727
"prettier-check": "^2.0.0",
2828
"rimraf": "^2.6.3",
29-
"tslint": "^5.16.0",
30-
"typescript": "^3.4.5"
29+
"tslint": "5.16.0",
30+
"typescript": "3.4.5"
3131
},
3232
"scripts": {
3333
"build": "run-p build:es5 build:esm",

packages/utils/src/path.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,10 @@ export function resolve(...args: string[]): string {
6060
// handle relative paths to be safe (might happen when process.cwd() fails)
6161

6262
// Normalize the path
63-
resolvedPath = normalizeArray(resolvedPath.split('/').filter(p => !!p), !resolvedAbsolute).join('/');
63+
resolvedPath = normalizeArray(
64+
resolvedPath.split('/').filter(p => !!p),
65+
!resolvedAbsolute,
66+
).join('/');
6467

6568
return (resolvedAbsolute ? '/' : '') + resolvedPath || '.';
6669
}
@@ -125,7 +128,10 @@ export function normalizePath(path: string): string {
125128
const trailingSlash = path.substr(-1) === '/';
126129

127130
// Normalize the path
128-
let normalizedPath = normalizeArray(path.split('/').filter(p => !!p), !isPathAbsolute).join('/');
131+
let normalizedPath = normalizeArray(
132+
path.split('/').filter(p => !!p),
133+
!isPathAbsolute,
134+
).join('/');
129135

130136
if (!normalizedPath && !isPathAbsolute) {
131137
normalizedPath = '.';

packages/utils/test/object.test.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,10 @@ describe('normalize()', () => {
204204
obj.children[1].self = obj.children[1];
205205
expect(normalize(obj)).toEqual({
206206
name: 'Alice',
207-
children: [{ name: 'Bob', self: '[Circular ~]' }, { name: 'Eve', self: '[Circular ~]' }],
207+
children: [
208+
{ name: 'Bob', self: '[Circular ~]' },
209+
{ name: 'Eve', self: '[Circular ~]' },
210+
],
208211
});
209212
});
210213

@@ -219,7 +222,10 @@ describe('normalize()', () => {
219222
const obj: object[] = [];
220223
obj.push({ name: 'Alice', self: obj });
221224
obj.push({ name: 'Bob', self: obj });
222-
expect(normalize(obj)).toEqual([{ name: 'Alice', self: '[Circular ~]' }, { name: 'Bob', self: '[Circular ~]' }]);
225+
expect(normalize(obj)).toEqual([
226+
{ name: 'Alice', self: '[Circular ~]' },
227+
{ name: 'Bob', self: '[Circular ~]' },
228+
]);
223229
});
224230

225231
test('repeated objects in objects', () => {

0 commit comments

Comments
 (0)