Skip to content

feat: Try size-limit gh action #2750

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jul 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/size-limit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: 'Bundle Size'
on:
pull_request:
branches:
- master
jobs:
job_1:
name: Size Check
runs-on: ubuntu-latest
env:
CI_JOB_NUMBER: 1
steps:
- uses: actions/checkout@v2
- uses: andresz1/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
26 changes: 26 additions & 0 deletions .size-limit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
module.exports = [
{
name: '@sentry/browser - CDN Bundle (gzipped)',
path: 'packages/browser/build/bundle.min.js',
gzip: true,
limit: '18 KB',
},
{
name: '@sentry/browser - Webpack',
path: 'packages/browser/esm/index.js',
import: '{ init }',
limit: '18 KB',
},
{
name: '@sentry/react - Webpack',
path: 'packages/react/esm/index.js',
import: '{ init }',
limit: '19 KB',
},
{
name: '@sentry/browser + @sentry/tracing - CDN Bundle (gzipped)',
path: 'packages/tracing/build/bundle.tracing.min.js',
gzip: true,
limit: '23 KB',
},
];
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ branches:
- /^release\/.+$/
- /^major\/.+$/

install: yarn --ignore-engines
install: yarn --ignore-engines --ignore-scripts
os: linux

language: node_js
Expand Down
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"postpublish": "make publish-docs"
},
"volta": {
"node": "10.15.3",
"node": "10.18.1",
"yarn": "1.13.0"
},
"workspaces": [
Expand All @@ -35,6 +35,7 @@
],
"devDependencies": {
"@google-cloud/storage": "^2.5.0",
"@size-limit/preset-big-lib": "^4.5.5",
"@strictsoftware/typedoc-plugin-monorepo": "^0.2.1",
"@types/chai": "^4.1.3",
"@types/jest": "^24.0.11",
Expand All @@ -56,10 +57,11 @@
"replace-in-file": "^4.0.0",
"rimraf": "^2.6.3",
"sinon": "^7.3.2",
"size-limit": "^4.5.5",
"ts-jest": "^24.0.2",
"tslint": "^5.16.0",
"tslint": "5.16.0",
"typedoc": "^0.14.2",
"typescript": "^3.4.5",
"typescript": "3.4.5",
"typescript-tslint-plugin": "^0.3.1"
},
"resolutions": {
Expand Down
4 changes: 2 additions & 2 deletions packages/apm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
"rollup-plugin-node-resolve": "^4.2.3",
"rollup-plugin-terser": "^4.0.4",
"rollup-plugin-typescript2": "^0.21.0",
"tslint": "^5.16.0",
"typescript": "^3.4.5"
"tslint": "5.16.0",
"typescript": "3.4.5"
},
"scripts": {
"build": "run-p build:es5 build:esm build:bundle",
Expand Down
4 changes: 1 addition & 3 deletions packages/apm/src/integrations/tracing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,9 +350,7 @@ export class Tracing implements Integration {
if (Tracing._heartbeatCounter >= 3) {
if (Tracing._activeTransaction) {
Tracing._log(
`[Tracing] Transaction: ${
SpanStatus.Cancelled
} -> Heartbeat safeguard kicked in since content hasn't changed for 3 beats`,
`[Tracing] Transaction: ${SpanStatus.Cancelled} -> Heartbeat safeguard kicked in since content hasn't changed for 3 beats`,
);
Tracing._activeTransaction.setStatus(SpanStatus.DeadlineExceeded);
Tracing._activeTransaction.setTag('heartbeat', 'failed');
Expand Down
4 changes: 2 additions & 2 deletions packages/browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
"rollup-plugin-terser": "^4.0.4",
"rollup-plugin-typescript2": "^0.21.0",
"sinon": "^7.3.2",
"tslint": "^5.16.0",
"typescript": "^3.4.5",
"tslint": "5.16.0",
"typescript": "3.4.5",
"webpack": "^4.30.0"
},
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
"prettier": "^1.17.0",
"prettier-check": "^2.0.0",
"rimraf": "^2.6.3",
"tslint": "^5.16.0",
"typescript": "^3.4.5"
"tslint": "5.16.0",
"typescript": "3.4.5"
},
"scripts": {
"build": "run-p build:es5 build:esm",
Expand Down
12 changes: 9 additions & 3 deletions packages/core/test/lib/base.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -804,9 +804,15 @@ describe('BaseClient', () => {
const client = new TestClient({ dsn: PUBLIC_DSN });

return Promise.all([
client.flush(1).then(() => expect(true).toEqual(true)),
client.flush(1).then(() => expect(true).toEqual(true)),
client.flush(1).then(() => expect(true).toEqual(true)),
client.flush(1).then(() => {
expect(true).toEqual(true);
}),
client.flush(1).then(() => {
expect(true).toEqual(true);
}),
client.flush(1).then(() => {
expect(true).toEqual(true);
}),
]);
});
});
Expand Down
4 changes: 2 additions & 2 deletions packages/gatsby/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
"prettier": "^1.17.0",
"prettier-check": "^2.0.0",
"rimraf": "^2.6.3",
"tslint": "^5.16.0",
"typescript": "^3.5.1"
"tslint": "5.16.0",
"typescript": "3.4.5"
},
"scripts": {
"build": "run-p build:es5 build:esm",
Expand Down
4 changes: 2 additions & 2 deletions packages/hub/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
"prettier": "^1.17.0",
"prettier-check": "^2.0.0",
"rimraf": "^2.6.3",
"tslint": "^5.16.0",
"typescript": "^3.4.5"
"tslint": "5.16.0",
"typescript": "3.4.5"
},
"scripts": {
"build": "run-p build:es5 build:esm",
Expand Down
2 changes: 1 addition & 1 deletion packages/hub/src/scope.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ export class Scope implements ScopeInterface {
}

if (typeof captureContext === 'function') {
const updatedScope = (captureContext as (<T>(scope: T) => T))(this);
const updatedScope = (captureContext as <T>(scope: T) => T)(this);
return updatedScope instanceof Scope ? updatedScope : this;
}

Expand Down
4 changes: 2 additions & 2 deletions packages/integrations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"rollup-plugin-node-resolve": "^4.2.3",
"rollup-plugin-terser": "^4.0.4",
"rollup-plugin-typescript2": "^0.21.0",
"tslint": "^5.16.0",
"typescript": "^3.4.5"
"tslint": "5.16.0",
"typescript": "3.4.5"
},
"scripts": {
"build": "run-p build:es5 build:esm build:bundle",
Expand Down
29 changes: 13 additions & 16 deletions packages/integrations/src/ember.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,18 @@ export class Ember implements Integration {
}
};

this._Ember.RSVP.on(
'error',
(reason: any): void => {
if (getCurrentHub().getIntegration(Ember)) {
getCurrentHub().withScope(scope => {
if (isInstanceOf(reason, Error)) {
scope.setExtra('context', 'Unhandled Promise error detected');
getCurrentHub().captureException(reason, { originalException: reason });
} else {
scope.setExtra('reason', reason);
getCurrentHub().captureMessage('Unhandled Promise error detected');
}
});
}
},
);
this._Ember.RSVP.on('error', (reason: any): void => {
if (getCurrentHub().getIntegration(Ember)) {
getCurrentHub().withScope(scope => {
if (isInstanceOf(reason, Error)) {
scope.setExtra('context', 'Unhandled Promise error detected');
getCurrentHub().captureException(reason, { originalException: reason });
} else {
scope.setExtra('reason', reason);
getCurrentHub().captureMessage('Unhandled Promise error detected');
}
});
}
});
}
}
2 changes: 1 addition & 1 deletion packages/integrations/src/reportingobserver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export class ReportingObserver implements Integration {

this._getCurrentHub = getCurrentHub;

const observer = new (getGlobalObject<any>()).ReportingObserver(this.handler.bind(this), {
const observer = new (getGlobalObject<any>().ReportingObserver)(this.handler.bind(this), {
buffered: true,
types: this._options.types,
});
Expand Down
4 changes: 2 additions & 2 deletions packages/minimal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
"prettier": "^1.17.0",
"prettier-check": "^2.0.0",
"rimraf": "^2.6.3",
"tslint": "^5.16.0",
"typescript": "^3.4.5"
"tslint": "5.16.0",
"typescript": "3.4.5"
},
"scripts": {
"build": "run-p build:es5 build:esm",
Expand Down
4 changes: 2 additions & 2 deletions packages/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
"prettier": "^1.17.0",
"prettier-check": "^2.0.0",
"rimraf": "^2.6.3",
"tslint": "^5.16.0",
"typescript": "^3.4.5"
"tslint": "5.16.0",
"typescript": "3.4.5"
},
"scripts": {
"build": "run-p build:es5 build:esm",
Expand Down
2 changes: 1 addition & 1 deletion packages/node/src/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ function extractTransaction(req: { [key: string]: any }, type: boolean | Transac
stack: [
{
name: string;
}
},
];
};
};
Expand Down
4 changes: 2 additions & 2 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@
"react-test-renderer": "^16.13.1",
"redux": "^4.0.5",
"rimraf": "^2.6.3",
"tslint": "^5.16.0",
"tslint": "5.16.0",
"tslint-react": "^5.0.0",
"tslint-react-hooks": "^2.2.2",
"typescript": "^3.5.1"
"typescript": "3.4.5"
},
"scripts": {
"build": "run-p build:es5 build:esm",
Expand Down
4 changes: 2 additions & 2 deletions packages/tracing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
"rollup-plugin-node-resolve": "^4.2.3",
"rollup-plugin-terser": "^4.0.4",
"rollup-plugin-typescript2": "^0.21.0",
"tslint": "^5.16.0",
"typescript": "^3.4.5"
"tslint": "5.16.0",
"typescript": "3.4.5"
},
"scripts": {
"build": "run-p build:es5 build:esm build:bundle",
Expand Down
4 changes: 1 addition & 3 deletions packages/tracing/src/browser/backgroundtab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ export function registerBackgroundTabDetection(): void {
const activeTransaction = getActiveTransaction() as IdleTransaction;
if (global.document.hidden && activeTransaction) {
logger.log(
`[Tracing] Transaction: ${SpanStatus.Cancelled} -> since tab moved to the background, op: ${
activeTransaction.op
}`,
`[Tracing] Transaction: ${SpanStatus.Cancelled} -> since tab moved to the background, op: ${activeTransaction.op}`,
);
activeTransaction.setStatus(SpanStatus.Cancelled);
activeTransaction.setTag('visibilitychange', 'document.hidden');
Expand Down
4 changes: 1 addition & 3 deletions packages/tracing/src/idletransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,7 @@ export class IdleTransaction extends Transaction {

if (this._heartbeatCounter >= 3) {
logger.log(
`[Tracing] Transaction: ${
SpanStatus.Cancelled
} -> Heartbeat safeguard kicked in since content hasn't changed for 3 beats`,
`[Tracing] Transaction: ${SpanStatus.Cancelled} -> Heartbeat safeguard kicked in since content hasn't changed for 3 beats`,
);
this.setStatus(SpanStatus.DeadlineExceeded);
this.setTag('heartbeat', 'failed');
Expand Down
3 changes: 2 additions & 1 deletion packages/tracing/test/tslint.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": ["../tslint.json"],
"rules": {
"no-unsafe-any": false
"no-unsafe-any": false,
"no-implicit-dependencies": false
}
}
4 changes: 2 additions & 2 deletions packages/types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"npm-run-all": "^4.1.2",
"prettier": "^1.17.0",
"prettier-check": "^2.0.0",
"tslint": "^5.16.0",
"typescript": "^3.4.5"
"tslint": "5.16.0",
"typescript": "3.4.5"
},
"scripts": {
"build": "run-p build:es5 build:esm",
Expand Down
2 changes: 1 addition & 1 deletion packages/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"tslint-consistent-codestyle": "^1.15.1"
},
"peerDependencies": {
"tslint": "^5.11.0",
"tslint": "5.16.0",
"typescript": "^3.2.0"
},
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions packages/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
"prettier": "^1.17.0",
"prettier-check": "^2.0.0",
"rimraf": "^2.6.3",
"tslint": "^5.16.0",
"typescript": "^3.4.5"
"tslint": "5.16.0",
"typescript": "3.4.5"
},
"scripts": {
"build": "run-p build:es5 build:esm",
Expand Down
10 changes: 8 additions & 2 deletions packages/utils/src/path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ export function resolve(...args: string[]): string {
// handle relative paths to be safe (might happen when process.cwd() fails)

// Normalize the path
resolvedPath = normalizeArray(resolvedPath.split('/').filter(p => !!p), !resolvedAbsolute).join('/');
resolvedPath = normalizeArray(
resolvedPath.split('/').filter(p => !!p),
!resolvedAbsolute,
).join('/');

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

// Normalize the path
let normalizedPath = normalizeArray(path.split('/').filter(p => !!p), !isPathAbsolute).join('/');
let normalizedPath = normalizeArray(
path.split('/').filter(p => !!p),
!isPathAbsolute,
).join('/');

if (!normalizedPath && !isPathAbsolute) {
normalizedPath = '.';
Expand Down
10 changes: 8 additions & 2 deletions packages/utils/test/object.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,10 @@ describe('normalize()', () => {
obj.children[1].self = obj.children[1];
expect(normalize(obj)).toEqual({
name: 'Alice',
children: [{ name: 'Bob', self: '[Circular ~]' }, { name: 'Eve', self: '[Circular ~]' }],
children: [
{ name: 'Bob', self: '[Circular ~]' },
{ name: 'Eve', self: '[Circular ~]' },
],
});
});

Expand All @@ -219,7 +222,10 @@ describe('normalize()', () => {
const obj: object[] = [];
obj.push({ name: 'Alice', self: obj });
obj.push({ name: 'Bob', self: obj });
expect(normalize(obj)).toEqual([{ name: 'Alice', self: '[Circular ~]' }, { name: 'Bob', self: '[Circular ~]' }]);
expect(normalize(obj)).toEqual([
{ name: 'Alice', self: '[Circular ~]' },
{ name: 'Bob', self: '[Circular ~]' },
]);
});

test('repeated objects in objects', () => {
Expand Down
Loading