Skip to content

Commit 29c8ea5

Browse files
committed
Merge remote-tracking branch 'origin/master' into feat/sentry/ember
2 parents 967c60e + a19e33e commit 29c8ea5

40 files changed

+967
-394
lines changed

.craft.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,13 @@ targets:
2929
onlyIfPresent: /^sentry-node-.*\.tgz$/
3030
config:
3131
canonical: 'npm:@sentry/node'
32+
- name: registry
33+
type: sdk
34+
onlyIfPresent: /^sentry-react-.*\.tgz$/
35+
config:
36+
canonical: 'npm:@sentry/react'
37+
- name: registry
38+
type: sdk
39+
onlyIfPresent: /^sentry-gatsby-.*\.tgz$/
40+
config:
41+
canonical: 'npm:@sentry/gatsby'

.github/workflows/build.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: 'Build & Test'
2+
on:
3+
push:
4+
branches:
5+
- master
6+
- release/**
7+
pull_request:
8+
9+
jobs:
10+
job_build:
11+
name: Build
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- uses: actions/setup-node@v1
16+
- uses: actions/cache@v2
17+
with:
18+
path: |
19+
node_modules
20+
*/*/node_modules
21+
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
22+
- name: Install
23+
run: yarn install
24+
- name: Build
25+
run: yarn build
26+
- name: Archive production artifacts
27+
uses: actions/upload-artifact@v2
28+
with:
29+
name: build
30+
path: |
31+
${{ github.workspace }}/packages/**/build
32+
${{ github.workspace }}/packages/**/dist
33+
${{ github.workspace }}/packages/**/esm
34+
35+
job_size_check:
36+
name: Size Check
37+
needs: job_build
38+
runs-on: ubuntu-latest
39+
steps:
40+
- uses: actions/checkout@v2
41+
- uses: actions/setup-node@v1
42+
- uses: actions/cache@v2
43+
with:
44+
path: |
45+
node_modules
46+
*/*/node_modules
47+
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
48+
- uses: actions/download-artifact@v2
49+
with:
50+
name: build
51+
path: ${{ github.workspace }}/packages
52+
- uses: andresz1/[email protected]
53+
with:
54+
github_token: ${{ secrets.GITHUB_TOKEN }}
55+
skip_step: build
56+
57+
job_lint:
58+
name: Lint
59+
needs: job_build
60+
runs-on: ubuntu-latest
61+
steps:
62+
- uses: actions/checkout@v2
63+
- uses: actions/setup-node@v1
64+
- uses: actions/cache@v2
65+
with:
66+
path: |
67+
node_modules
68+
*/*/node_modules
69+
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
70+
- run: yarn install
71+
- uses: actions/download-artifact@v2
72+
with:
73+
name: build
74+
path: ${{ github.workspace }}/packages
75+
- name: Run Linter
76+
run: yarn lint
77+
78+
job_unit_test:
79+
name: Test
80+
needs: job_build
81+
runs-on: ubuntu-latest
82+
steps:
83+
- uses: actions/checkout@v2
84+
- uses: actions/setup-node@v1
85+
- uses: actions/cache@v2
86+
with:
87+
path: |
88+
node_modules
89+
*/*/node_modules
90+
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
91+
- run: yarn install
92+
- uses: actions/download-artifact@v2
93+
with:
94+
name: build
95+
path: ${{ github.workspace }}/packages
96+
- name: Unit Tests
97+
run: yarn test

.github/workflows/size-limit.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

.size-limit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module.exports = [
99
name: '@sentry/browser - Webpack',
1010
path: 'packages/browser/esm/index.js',
1111
import: '{ init }',
12-
limit: '18 KB',
12+
limit: '19 KB',
1313
},
1414
{
1515
name: '@sentry/react - Webpack',

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@
55
- "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott
66
- [ember] feat: Add `@sentry/ember` (#2739)
77

8+
## 5.20.1
9+
10+
- [react] feat: Add instrumentation for React Router v3 (#2759)
11+
- [apm/tracing] fix: Make sure fetch requests are being timed correctly (#2772)
12+
- [apm/tracing] fix: Make sure pageload transactions start timestamps are correctly generated (#2773)
13+
- [react] ref: Use inline types to avoid redux dependency. (#2768)
14+
- [core] ref: Expose sentry request for electron (#2774)
15+
- [node] fix: Set transaction on scope in node for request (#2769)
16+
- [browser] fix: Make sure that DSN is always passed to report dialog (#2770)
17+
818
## 5.20.0
919

1020
- [browser] feat: Make `@sentry/browser` more treeshakeable (#2747)

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
],
3737
"devDependencies": {
3838
"@google-cloud/storage": "^2.5.0",
39-
"@size-limit/preset-big-lib": "^4.5.5",
39+
"@size-limit/preset-small-lib": "^4.5.5",
4040
"@strictsoftware/typedoc-plugin-monorepo": "^0.2.1",
4141
"@types/chai": "^4.1.3",
4242
"@types/jest": "^24.0.11",

packages/apm/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry/apm",
3-
"version": "5.20.0",
3+
"version": "5.20.1",
44
"description": "Extensions for APM",
55
"repository": "git://github.com/getsentry/sentry-javascript.git",
66
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/apm",
@@ -16,11 +16,11 @@
1616
"access": "public"
1717
},
1818
"dependencies": {
19-
"@sentry/browser": "5.20.0",
20-
"@sentry/hub": "5.20.0",
21-
"@sentry/minimal": "5.20.0",
22-
"@sentry/types": "5.20.0",
23-
"@sentry/utils": "5.20.0",
19+
"@sentry/browser": "5.20.1",
20+
"@sentry/hub": "5.20.1",
21+
"@sentry/minimal": "5.20.1",
22+
"@sentry/types": "5.20.1",
23+
"@sentry/utils": "5.20.1",
2424
"tslib": "^1.9.3"
2525
},
2626
"devDependencies": {

packages/apm/src/integrations/tracing.ts

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ export class Tracing implements Integration {
581581

582582
// tslint:disable-next-line: completed-docs
583583
function addPerformanceNavigationTiming(parent: Span, entry: { [key: string]: number }, event: string): void {
584-
parent.startChild({
584+
_startChild(parent, {
585585
description: event,
586586
endTimestamp: timeOrigin + Tracing._msToSec(entry[`${event}End`]),
587587
op: 'browser',
@@ -591,14 +591,14 @@ export class Tracing implements Integration {
591591

592592
// tslint:disable-next-line: completed-docs
593593
function addRequest(parent: Span, entry: { [key: string]: number }): void {
594-
parent.startChild({
594+
_startChild(parent, {
595595
description: 'request',
596596
endTimestamp: timeOrigin + Tracing._msToSec(entry.responseEnd),
597597
op: 'browser',
598598
startTimestamp: timeOrigin + Tracing._msToSec(entry.requestStart),
599599
});
600600

601-
parent.startChild({
601+
_startChild(parent, {
602602
description: 'response',
603603
endTimestamp: timeOrigin + Tracing._msToSec(entry.responseEnd),
604604
op: 'browser',
@@ -648,35 +648,27 @@ export class Tracing implements Integration {
648648
case 'mark':
649649
case 'paint':
650650
case 'measure':
651-
const mark = transactionSpan.startChild({
651+
const mark = _startChild(transactionSpan, {
652652
description: entry.name,
653+
endTimestamp: timeOrigin + startTime + duration,
653654
op: entry.entryType,
655+
startTimestamp: timeOrigin + startTime,
654656
});
655-
mark.startTimestamp = timeOrigin + startTime;
656-
mark.endTimestamp = mark.startTimestamp + duration;
657657
if (tracingInitMarkStartTime === undefined && entry.name === 'sentry-tracing-init') {
658658
tracingInitMarkStartTime = mark.startTimestamp;
659659
}
660660
break;
661661
case 'resource':
662662
const resourceName = entry.name.replace(window.location.origin, '');
663-
if (entry.initiatorType === 'xmlhttprequest' || entry.initiatorType === 'fetch') {
664-
// We need to update existing spans with new timing info
665-
if (transactionSpan.spanRecorder) {
666-
transactionSpan.spanRecorder.spans.map((finishedSpan: Span) => {
667-
if (finishedSpan.description && finishedSpan.description.indexOf(resourceName) !== -1) {
668-
finishedSpan.startTimestamp = timeOrigin + startTime;
669-
finishedSpan.endTimestamp = finishedSpan.startTimestamp + duration;
670-
}
671-
});
672-
}
673-
} else {
674-
const resource = transactionSpan.startChild({
663+
// we already instrument based on fetch and xhr, so we don't need to
664+
// duplicate spans here.
665+
if (entry.initiatorType !== 'xmlhttprequest' && entry.initiatorType !== 'fetch') {
666+
const resource = _startChild(transactionSpan, {
675667
description: `${entry.initiatorType} ${resourceName}`,
668+
endTimestamp: timeOrigin + startTime + duration,
676669
op: `resource`,
670+
startTimestamp: timeOrigin + startTime,
677671
});
678-
resource.startTimestamp = timeOrigin + startTime;
679-
resource.endTimestamp = resource.startTimestamp + duration;
680672
// We remember the entry script end time to calculate the difference to the first init mark
681673
if (entryScriptStartEndTime === undefined && (entryScriptSrc || '').indexOf(resourceName) > -1) {
682674
entryScriptStartEndTime = resource.endTimestamp;
@@ -689,7 +681,7 @@ export class Tracing implements Integration {
689681
});
690682

691683
if (entryScriptStartEndTime !== undefined && tracingInitMarkStartTime !== undefined) {
692-
transactionSpan.startChild({
684+
_startChild(transactionSpan, {
693685
description: 'evaluation',
694686
endTimestamp: tracingInitMarkStartTime,
695687
op: `script`,
@@ -1054,3 +1046,19 @@ function historyCallback(_: { [key: string]: any }): void {
10541046
});
10551047
}
10561048
}
1049+
1050+
/**
1051+
* Helper function to start child on transactions. This function will make sure that the transaction will
1052+
* use the start timestamp of the created child span if it is earlier than the transactions actual
1053+
* start timestamp.
1054+
*/
1055+
export function _startChild(parent: Span, { startTimestamp, ...ctx }: SpanContext): Span {
1056+
if (startTimestamp && parent.startTimestamp > startTimestamp) {
1057+
parent.startTimestamp = startTimestamp;
1058+
}
1059+
1060+
return parent.startChild({
1061+
startTimestamp,
1062+
...ctx,
1063+
});
1064+
}

packages/browser/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry/browser",
3-
"version": "5.20.0",
3+
"version": "5.20.1",
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": "5.20.0",
20-
"@sentry/types": "5.20.0",
21-
"@sentry/utils": "5.20.0",
19+
"@sentry/core": "5.20.1",
20+
"@sentry/types": "5.20.1",
21+
"@sentry/utils": "5.20.1",
2222
"tslib": "^1.9.3"
2323
},
2424
"devDependencies": {

0 commit comments

Comments
 (0)