Skip to content

Commit 012eff3

Browse files
committed
Merge remote-tracking branch 'upstream/master' into feat/separate-source-reading
2 parents 2ff7efd + e5ede4c commit 012eff3

File tree

382 files changed

+8834
-3565
lines changed

Some content is hidden

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

382 files changed

+8834
-3565
lines changed

.eslintrc.js

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Note: All paths are relative to the directory in which eslint is being run, rather than the directory where this file
2+
// lives
3+
14
module.exports = {
25
root: true,
36
env: {
@@ -7,20 +10,18 @@ module.exports = {
710
ecmaVersion: 2018,
811
},
912
extends: ['@sentry-internal/sdk'],
10-
ignorePatterns: [
11-
'coverage/**',
12-
'build/**',
13-
'dist/**',
14-
'esm/**',
15-
'examples/**',
16-
'scripts/**',
17-
'test/manual/**',
18-
],
13+
ignorePatterns: ['coverage/**', 'build/**', 'dist/**', 'esm/**', 'examples/**', 'scripts/**', 'test/manual/**'],
1914
overrides: [
2015
{
2116
files: ['*.ts', '*.tsx', '*.d.ts'],
2217
parserOptions: {
23-
project: './tsconfig.json',
18+
project: ['tsconfig.json'],
19+
},
20+
},
21+
{
22+
files: ['test/**/*.ts', 'test/**/*.tsx'],
23+
parserOptions: {
24+
project: ['tsconfig.test.json'],
2425
},
2526
},
2627
{

.github/workflows/build.yml

Lines changed: 66 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ env:
1010
CACHED_DEPENDENCY_PATHS: |
1111
${{ github.workspace }}/node_modules
1212
${{ github.workspace }}/packages/**/node_modules
13+
~/.cache/ms-playwright/
1314
1415
# DEPENDENCY_CACHE_KEY: can't be set here because we don't have access to yarn.lock
1516

@@ -115,6 +116,8 @@ jobs:
115116
key: ${{ env.BUILD_CACHE_KEY }}
116117
- name: Check bundle sizes
117118
uses: getsentry/size-limit-action@v3
119+
# Only run size check on master or pull requests
120+
if: github.ref == 'refs/heads/master' || github.event_name == 'pull_request'
118121
with:
119122
github_token: ${{ secrets.GITHUB_TOKEN }}
120123
skip_step: build
@@ -268,15 +271,45 @@ jobs:
268271
${{ github.workspace }}/packages/**/*.tgz
269272
${{ github.workspace }}/packages/serverless/dist-awslambda-layer/*.zip
270273
271-
job_browserstack_test:
272-
name: BrowserStack
274+
job_browser_playwright_tests:
275+
name: Browser Playwright Tests
273276
needs: job_build
274277
runs-on: ubuntu-latest
275-
timeout-minutes: 45
278+
steps:
279+
- name: Check out current commit (${{ github.sha }})
280+
uses: actions/checkout@v2
281+
- name: Set up Node
282+
uses: actions/setup-node@v1
283+
with:
284+
node-version: '16'
285+
- name: Check dependency cache
286+
uses: actions/cache@v2
287+
with:
288+
path: ${{ env.CACHED_DEPENDENCY_PATHS }}
289+
key: ${{ needs.job_build.outputs.dependency_cache_key }}
290+
- name: Check build cache
291+
uses: actions/cache@v2
292+
with:
293+
path: ${{ env.CACHED_BUILD_PATHS }}
294+
key: ${{ env.BUILD_CACHE_KEY }}
295+
- name: Run Playwright tests
296+
run: |
297+
cd packages/integration-tests
298+
yarn run playwright install-deps webkit
299+
yarn test:ci
300+
301+
job_browser_integration_tests:
302+
name: Browser Integration Tests (${{ matrix.browser }})
303+
needs: job_build
304+
runs-on: ubuntu-latest
305+
timeout-minutes: 10
276306
continue-on-error: true
277-
# TODO: Fix BrowserStack tests
278-
# if: startsWith(github.ref, 'refs/heads/release/')
279-
if: false
307+
strategy:
308+
matrix:
309+
browser:
310+
- ChromeHeadless
311+
- FirefoxHeadless
312+
- WebkitHeadless
280313
steps:
281314
- name: Check out current commit (${{ github.sha }})
282315
uses: actions/checkout@v2
@@ -294,10 +327,34 @@ jobs:
294327
key: ${{ env.BUILD_CACHE_KEY }}
295328
- name: Run integration tests
296329
env:
297-
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
298-
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
330+
KARMA_BROWSER: ${{ matrix.browser }}
299331
run: |
300332
cd packages/browser
301-
yarn test:integration:checkbrowsers
333+
[[ $KARMA_BROWSER == WebkitHeadless ]] && yarn run playwright install-deps webkit
302334
yarn test:integration
335+
336+
job_browser_build_tests:
337+
name: Browser Build Tests
338+
needs: job_build
339+
runs-on: ubuntu-latest
340+
timeout-minutes: 5
341+
continue-on-error: true
342+
steps:
343+
- name: Check out current commit (${{ github.sha }})
344+
uses: actions/checkout@v2
345+
- name: Set up Node
346+
uses: actions/setup-node@v1
347+
- name: Check dependency cache
348+
uses: actions/cache@v2
349+
with:
350+
path: ${{ env.CACHED_DEPENDENCY_PATHS }}
351+
key: ${{ needs.job_build.outputs.dependency_cache_key }}
352+
- name: Check build cache
353+
uses: actions/cache@v2
354+
with:
355+
path: ${{ env.CACHED_BUILD_PATHS }}
356+
key: ${{ env.BUILD_CACHE_KEY }}
357+
- name: Run build tests
358+
run: |
359+
cd packages/browser
303360
yarn test:package

.size-limit.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,25 @@ module.exports = [
55
gzip: true,
66
limit: '100 KB',
77
},
8+
{
9+
name: '@sentry/browser - CDN Bundle (minified)',
10+
path: 'packages/browser/build/bundle.min.js',
11+
gzip: false,
12+
limit: '120 KB',
13+
},
814
{
915
name: '@sentry/browser - Webpack',
1016
path: 'packages/browser/esm/index.js',
1117
import: '{ init }',
1218
limit: '100 KB',
1319
},
20+
{
21+
name: '@sentry/browser - Webpack - gzip = false',
22+
path: 'packages/browser/esm/index.js',
23+
import: '{ init }',
24+
gzip: false,
25+
limit: '100 KB',
26+
},
1427
{
1528
name: '@sentry/react - Webpack',
1629
path: 'packages/react/esm/index.js',

CHANGELOG.md

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

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

7+
## 6.17.0-beta.0
8+
9+
This beta releases contains several internal refactors that help reduce the bundle size of the SDK and help prep for our [upcoming major release](https://github.com/getsentry/sentry-javascript/issues/4240). There are no breaking changes in this patch unless you are using our internal `Dsn` class. We also deprecated our typescript enums and our internal `API` class. We've detailed how to update your sdk usage if you are using the `Dsn` class or any of the deprecated methods in our [migration documentation](./MIGRATION.md#upgrading-from-6.x-to-6.17.0).
10+
11+
- feat(core): Deprecate API class (#4281)
12+
- feat(dsn): Remove Dsn class (#4325)
13+
- feat(ember): Update ember dependencies (#4253)
14+
- fix(nextjs): Add sentry-cli existence check for enabling webpack plugin #4311
15+
- ref(tracing): deprecate span status enum (#4299)
16+
- ref(types): drop unused logLevel (#4317)
17+
- ref(types): deprecate request status enum (#4316)
18+
- ref(types): deprecate outcome enum (#4315)
19+
- ref(types): deprecate transactionmethod enum (#4314)
20+
- ref(types): deprecate status enum (#4298)
21+
- ref(types): deprecate severity enum (#4280)
22+
23+
## 6.16.1
24+
25+
- feat(nextjs): Support Next.js v12 (#4093)
26+
- fix(nextjs): Disable server instrumentation on Vercel (#4255)
27+
- feat(tracing): Add metadata around idleTimeout (#4251)
28+
29+
Work in this release contributed by @KATT. Thank you for your contribution!
30+
31+
## 6.16.0
32+
33+
- feat(angular): Add Angular 13 to peer dep (#4183)
34+
- fix(angular): Finish routing span before starting another one (#4191)
35+
- fix(angular): Use ui category for span operations (#4222)
36+
- feat(ember): Use @types/ember__debug (#4173)
37+
- fix(ember): Use ui category for span operations (#4221)
38+
- feat(eslint-config): Enable array-callback-return rule (#4229)
39+
- ref(eslint-config): Update spaced-comment rule (#4235)
40+
- fix(integrations): Use ui category for vue span operations (#4219)
41+
- fix(nextjs): Add sideEffects flag to NextJS SDK (#4216)
42+
- fix(node): Make http integration spans have http span operation (#4224)
43+
- fix(react): Mark react package as having no side effects (#4213)
44+
- fix(react): Use ui category for operations (#4218)
45+
- fix(tracing): Add express category to express middleware spans (#4223)
46+
- fix(tracing): Treat HTTP status code below 100 as UnknownError (#4131)
47+
- fix(types): Make Options type method params contravariant (#4234)
48+
- fix(vue): Mark Vue as having no side effects. (#4217)
49+
- fix(vue): Use ui category for span operations (#4220)
50+
51+
Work in this release contributed by @jherdman and @travigd. Thank you for your contribution!
52+
753
## 6.15.0
854

955
- fix(browser): Capture stacktrace on `DOMExceptions`, if possible (#4160)

MIGRATION.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,99 @@
1+
# Upgrading from 6.x to 6.17.0
2+
3+
You only need to make changes when migrating to `6.17.0` if you are using our internal `Dsn` class. Our internal API class and typescript enums were deprecated, so we recommend you migrate them as well.
4+
5+
The internal `Dsn` class was removed in `6.17.0`. For additional details, you can look at the [PR where this change happened](https://github.com/getsentry/sentry-javascript/pull/4325). To migrate, see the following example.
6+
7+
```js
8+
// New in 6.17.0:
9+
import { dsnToString, makeDsn } from '@sentry/utils';
10+
11+
const dsn = makeDsn(process.env.SENTRY_DSN);
12+
console.log(dsnToString(dsn));
13+
14+
// Before:
15+
import { Dsn } from '@sentry/utils';
16+
17+
const dsn = new Dsn(process.env.SENTRY_DSN);
18+
console.log(dsn.toString());
19+
```
20+
21+
The internal API class was deprecated, and will be removed in the next major release. More details can be found in the [PR that made this change](https://github.com/getsentry/sentry-javascript/pull/4281). To migrate, see the following example.
22+
23+
```js
24+
// New in 6.17.0:
25+
import {
26+
initAPIDetails,
27+
getEnvelopeEndpointWithUrlEncodedAuth,
28+
getStoreEndpointWithUrlEncodedAuth,
29+
} from '@sentry/core';
30+
31+
const dsn = initAPIDetails(dsn, metadata, tunnel);
32+
const dsn = api.dsn;
33+
const storeEndpoint = getEnvelopeEndpointWithUrlEncodedAuth(api.dsn, api.tunnel);
34+
const envelopeEndpoint = getStoreEndpointWithUrlEncodedAuth(api.dsn);
35+
36+
// Before:
37+
import { API } from '@sentry/core';
38+
39+
const api = new API(dsn, metadata, tunnel);
40+
const dsn = api.getDsn();
41+
const storeEndpoint = api.getStoreEndpointWithUrlEncodedAuth();
42+
const envelopeEndpoint = api.getEnvelopeEndpointWithUrlEncodedAuth();
43+
```
44+
45+
## Enum changes
46+
47+
We've detailed how to migrate off our enums `Severity`, `Status` and `SpanStatus`. We also made changes to deprecate `TransactionMethod`, `Outcome` and `RequestSessionStatus` enums, but those are internal only APIs.
48+
49+
#### Severity
50+
51+
We deprecated the `Severity` enum in `@sentry/types` and it will be removed in the next major release. We recommend using string literals to save on bundle size. [PR](https://github.com/getsentry/sentry-javascript/pull/4280). We also removed the `Severity.fromString` method. This was done to save on bundle size.
52+
53+
```js
54+
// New in 6.17.0:
55+
import { severityFromString } from '@sentry/utils';
56+
57+
const severity = severityFromString(level);
58+
59+
// Before:
60+
import { Severity } from '@sentry/types';
61+
62+
const severity = Severity.fromString(level);
63+
```
64+
65+
#### Status
66+
67+
We deprecated the `Status` enum in `@sentry/types` and it will be removed in the next major release. We recommend using string literals to save on bundle size. [PR](https://github.com/getsentry/sentry-javascript/pull/4298). We also removed the `Status.fromHttpCode` method. This was done to save on bundle size.
68+
69+
```js
70+
// New in 6.17.0:
71+
import { eventStatusFromHttpCode } from '@sentry/utils';
72+
73+
const status = eventStatusFromHttpCode(500);
74+
75+
// Before:
76+
import { Status } from '@sentry/types';
77+
78+
const status = Status.fromHttpCode(500);
79+
```
80+
81+
#### SpanStatus
82+
83+
We deprecated the `Status` enum in `@sentry/tracing` and it will be removed in the next major release. We recommend using string literals to save on bundle size. [PR](https://github.com/getsentry/sentry-javascript/pull/4299). We also removed the `SpanStatus.fromHttpCode` method. This was done to save on bundle size.
84+
85+
```js
86+
// New in 6.17.0:
87+
import { spanStatusfromHttpCode } from '@sentry/utils';
88+
89+
const status = spanStatusfromHttpCode(403);
90+
91+
// Before:
92+
import { SpanStatus } from '@sentry/tracing';
93+
94+
const status = SpanStatus.fromHttpCode(403);
95+
```
96+
197
# Upgrading from 4.x to 5.x/6.x
298

399
In this version upgrade, there are a few breaking changes. This guide should help you update your code accordingly.

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ _Bad software is everywhere, and we're tired of it. Sentry is on a mission to he
1818
This is the next line of Sentry JavaScript SDKs, comprised in the `@sentry/` namespace. It will provide a more
1919
convenient interface and improved consistency between various JavaScript environments.
2020

21+
---
22+
23+
**Sentry is Hiring!!!**
24+
25+
Would you like to work on Open Source software and help maintain this repository? Apply today https://grnh.se/ca81c1701us.
26+
27+
---
28+
2129
## Links
2230

2331
- [![TypeDoc](https://img.shields.io/badge/documentation-TypeDoc-green.svg)](http://getsentry.github.io/sentry-javascript/)

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

package.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
"private": true,
33
"scripts": {
44
"build": "node ./scripts/verify-packages-versions.js && lerna run --stream --concurrency 1 --sort build",
5+
"build:cjs": "lerna run --stream --concurrency 1 --sort build:cjs",
56
"build:dev": "lerna run --stream --concurrency 1 --sort build:dev",
67
"build:dev:filter": "lerna run --stream --concurrency 1 --sort build:dev --include-filtered-dependencies --include-filtered-dependents --scope",
7-
"build:es5": "lerna run --stream --concurrency 1 --sort build:es5",
8+
"build:es5": "yarn lerna run --stream --concurrency 1 --sort build:cjs # *** backwards compatibility - remove in v7 ***",
89
"build:esm": "lerna run --stream --concurrency 1 --sort build:esm",
910
"build:watch": "lerna run --parallel build:watch",
1011
"build:dev:watch": "lerna run --parallel build:dev:watch",
@@ -18,7 +19,7 @@
1819
"pack:changed": "lerna run pack --since",
1920
"prepublishOnly": "lerna run --stream --concurrency 1 prepublishOnly",
2021
"postpublish": "make publish-docs && lerna run --stream --concurrency 1 postpublish",
21-
"test": "lerna run --stream --concurrency 1 --sort test"
22+
"test": "lerna run --ignore @sentry-internal/browser-integration-tests --stream --concurrency 1 --sort test"
2223
},
2324
"volta": {
2425
"node": "14.17.0",
@@ -33,6 +34,7 @@
3334
"packages/eslint-plugin-sdk",
3435
"packages/gatsby",
3536
"packages/hub",
37+
"packages/integration-tests",
3638
"packages/integrations",
3739
"packages/minimal",
3840
"packages/nextjs",
@@ -58,19 +60,19 @@
5860
"chai": "^4.1.2",
5961
"codecov": "^3.6.5",
6062
"eslint": "7.32.0",
61-
"jest": "^24.7.1",
63+
"jest": "^24.9.0",
6264
"karma-browserstack-launcher": "^1.5.1",
6365
"karma-firefox-launcher": "^1.1.0",
6466
"lerna": "3.13.4",
6567
"madge": "4.0.2",
6668
"mocha": "^6.1.4",
67-
"npm-run-all": "^4.1.2",
68-
"prettier": "1.19.0",
69+
"npm-run-all": "^4.1.5",
70+
"prettier": "1.19.1",
6971
"replace-in-file": "^4.0.0",
70-
"rimraf": "^2.6.3",
72+
"rimraf": "^3.0.2",
7173
"sinon": "^7.3.2",
7274
"size-limit": "^4.5.5",
73-
"ts-jest": "^24.0.2",
75+
"ts-jest": "^24.3.0",
7476
"typedoc": "^0.18.0",
7577
"typescript": "3.7.5"
7678
},

0 commit comments

Comments
 (0)