Skip to content

Commit

Permalink
Merge branch 'master' into onur/browser-provide-mechanism
Browse files Browse the repository at this point in the history
  • Loading branch information
onurtemizkan committed Oct 18, 2021
2 parents 91b73c8 + 84a6dc0 commit 573feac
Show file tree
Hide file tree
Showing 160 changed files with 4,894 additions and 2,410 deletions.
3 changes: 1 addition & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
* @kamilogorek
packages/* @hazat

2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ jobs:
id: changed-files-specific
uses: tj-actions/changed-files@v6.2
with:
files: .*packages\/(ember|browser|core|tracing|hub|minimal|types|utils)($|/.*)
files: .*packages\/ember($|/.*)
# Only run ember tests if the files above have changed
- name: Run Ember tests
if: steps.changed-files-specific.outputs.any_changed == 'true' || github.event_name == 'push'
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: 'close stale issues/PRs'
on:
schedule:
- cron: '* */3 * * *'
workflow_dispatch:
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@87c2b794b9b47a9bec68ae03c01aeb572ffebdb1
with:
repo-token: ${{ github.token }}
days-before-stale: 21
days-before-close: 7
only-labels: ""
operations-per-run: 100
remove-stale-when-updated: true
debug-only: false
ascending: false

exempt-issue-labels: "Status: Backlog,Status: In Progress"
stale-issue-label: "Status: Stale"
stale-issue-message: |-
This issue has gone three weeks without activity. In another week, I will close it.
But! If you comment or otherwise update it, I will reset the clock, and if you label it `Status: Backlog` or `Status: In Progress`, I will leave it alone ... forever!
----
"A weed is but an unloved flower." ― _Ella Wheeler Wilcox_ 🥀
skip-stale-issue-message: false
close-issue-label: ""
close-issue-message: ""

exempt-pr-labels: "Status: Backlog,Status: In Progress"
stale-pr-label: "Status: Stale"
stale-pr-message: |-
This pull request has gone three weeks without activity. In another week, I will close it.
But! If you comment or otherwise update it, I will reset the clock, and if you label it `Status: Backlog` or `Status: In Progress`, I will leave it alone ... forever!
----
"A weed is but an unloved flower." ― _Ella Wheeler Wilcox_ 🥀
skip-stale-pr-message: false
close-pr-label:
close-pr-message: ""
62 changes: 62 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,68 @@

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

## 6.13.3

- feat(nextjs): Add ability for integration tests to use linked `@sentry/xxxx` packages (#4019)
- feat(nextjs): Support `distDir` Next.js option (#3990)
- fix(tracing): Call hasTracingEnabled with correct options when invoking startTransaction (#4020)
- ref(browser): Refactor sending client reports w. fetch fallback (#4008)
- ref(core): Make getTransport method on client optional (#4013)
- ref(ember): Update htmlbars dependency (#4026)
- ref(integrations): Minor simplification of ExtraErrorData code (#4024)
- ref(react): Rely on error.cause to link ErrorBoundary errors (#4005)

## 6.13.2

- fix(browser): Use getGlobalObject for document check (#3996)
- misc(all): Disallow direct usage of globals (#3999)

## 6.13.1

- fix(browser): Check for document when sending outcomes (#3993)

## 6.13.0

- feat(browser): Client Report Support (#3955)
- feat(perf): Add experimental option to improve LCP collection (#3879)
- fix(browser): Make sure that `document.head` or `document.body` exists for `injectReportDialog` (#3972)
- fix(browser): Parse frames-only `safari(-web)-extension` stack (#3929)
- fix(ember): Move `ember-source` to `devDependencies` (#3962)
- fix(hub): Don't set `lastEventID` for transactions (#3966)
- fix(nextjs): Include nextjs config's `basePath` on `urlPrefix` (#3922)
- fix(node): Add protocol detection for get/request calls without explict protocol (#3950)
- fix(node): Disable `autoSessionTracking` if dsn undefined (#3954)
- fix(vue): Check for matched route existence before starting transaction (#3973)
- ref(browser): Migrate unit tests from Chai and Karma to Jest (#3965)
- ref(nextjs): Exclude cross-platform tracing code from bundles (#3978)
- ref(tracing): Idle transaction refactoring (#3988)

## 6.12.0

- fix(nextjs): Differentiate between webpack 4 and 5 in server builds (#3878)
- fix(core): Skip native frames while searching frame URLs. (#3897)
- fix(vue): Attach props only if VM is available (#3902)
- feat(tracing): Add pg-native support to Postgres integration. (#3894)
- ref(ember): Update addon to support Ember 4.0.0 (beta) (#3915)
- feat(react): Make Profiler _mountSpan attribute protected (#3904)
- fix(ember): allow ember-beta to fail (#3910)
- fix(tracing): Prevent metrics erroring module load in web workers (#3941)
- misc(browser): Log when event is dropped by Dedupe integration (#3943)

## 6.11.0

- feat(nextjs): Allow for TypeScript user config files (#3847)
- fix(browser): Make sure handler exists for LinkedErrors Integration (#3861)
- fix(core): Skip anonymous callbacks while searching frame URLs. (#3842)
- fix(core): Stop rejecting in `flush` and `close` when client undefined (#3846)
- fix(nextjs): Stop `SentryWebpackPlugin` from uploading unnecessary files (#3845)
- fix(react): Require ReactElement in ErrorBoundary props and render (#3857)
- fix(tests): Allow tests to run on Windows without WSL (#3813)
- fix(utils): Fix false-positive circular references when normalizing `Event` objects (#3864)
- fix(vue): Make Router.name type optional to match VueRouter (#3843)
- ref(core): Prevent redundant setup work (#3862)
- ref(nextjs): Stop reinitializing the server SDK unnecessarily (#3860)

## 6.10.0

- feat(vue): Rework tracing and add support for `Vue 3` (#3804)
Expand Down
18 changes: 10 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ We welcome suggested improvements and bug fixes to the `@sentry/*` family of pac

To run the test suite and our code linter, node.js and yarn are required.

[`node` download](https://nodejs.org/download)
[`node` download](https://nodejs.org/download)
[`yarn` download](https://yarnpkg.com/en/docs/install)

`sentry-javascript` is a monorepo containing several packages, and we use `lerna` to manage them. To get started, install all dependencies, use `lerna` to bootstrap the workspace, and then perform an initial build, so TypeScript can read all of the linked type definitions.
Expand All @@ -29,13 +29,15 @@ With that, the repo is fully set up and you are ready to run all commands.

## Building Packages

Since we are using [`TypeScript`](https://www.typescriptlang.org/), you need to transpile the code to JavaScript to be
able to use it. Every package has a `build` script which takes care of everything. You can also run `build` on all of the
packages at once by calling `yarn build` in the project root.
Since we are using [`TypeScript`](https://www.typescriptlang.org/), you need to transpile the code to JavaScript to be able to use it. From the top level of the repo, there are three commands available:

- `yarn build:dev`, which runs a one-time build of ES5 and ES6 versions of every package
- `yarn build:dev:filter <name of npm package>`, which runs `yarn build:dev` only in projects relevant to the given package (so, for example, running `yarn build:dev:filter @sentry/react` will build the `react` package, all of its dependencies (`utils`, `core`, `browser`, etc), and all packages which depend on it (currently `gatsby` and `nextjs`))
- `yarn build:dev:watch`, which runs `yarn build:dev` in watch mode (recommended)

## Adding Tests

**Any nontrivial fixes/features should include tests.** You'll find a `test` folder in each package.
**Any nontrivial fixes/features should include tests.** You'll find a `test` folder in each package.

Note that _for the `browser` package only_, if you add a new file to the [integration test suite](https://github.com/getsentry/sentry-javascript/tree/master/packages/browser/test/integration/suites), you also need to add it to [the list in `shell.js`](https://github.com/getsentry/sentry-javascript/blob/b74e199254147fd984e7bb1ea24193aee70afa74/packages/browser/test/integration/suites/shell.js#L25) as well. Adding tests to existing files will work out of the box in all packages.

Expand All @@ -56,15 +58,15 @@ Note: you must run `yarn build` before `yarn lint` will work.
When contributing to the codebase, please note:

- Non-trivial PRs will not be accepted without tests (see above).
- Please do not bump version numbers yourself.
- [`raven-js`](https://github.com/getsentry/sentry-javascript/tree/3.x/packages/raven-js) and [`raven-node`](https://github.com/getsentry/sentry-javascript/tree/3.x/packages/raven-node) are deprecated, and only bug and security fix PRs will be accepted targeting the [3.x branch](https://github.com/getsentry/sentry-javascript/tree/3.x). Any new features and improvements should be to our new SDKs (`browser` and `node`) and the packages (`core`, `hub`, `integrations`, and the like) which support them.
- Please do not bump version numbers yourself.
- [`raven-js`](https://github.com/getsentry/sentry-javascript/tree/3.x/packages/raven-js) and [`raven-node`](https://github.com/getsentry/sentry-javascript/tree/3.x/packages/raven-node) are deprecated, and only bug and security fix PRs will be accepted targeting the [3.x branch](https://github.com/getsentry/sentry-javascript/tree/3.x). Any new features and improvements should be to our new SDKs (`browser`, `node`, and framework-specific packages like `react` and `nextjs`) and the packages which support them (`core`, `hub`, `integrations`, and the like).

## Publishing a Release

_These steps are only relevant to Sentry employees when preparing and publishing a new SDK release._

1. Determine what version will be released (we use [semver](https://semver.org)).
2. Update [`CHANGELOG.md`](https://github.com/getsentry/sentry-javascript/edit/master/CHANGELOG.md) to add an entry to the next release number and a list of changes since the last release.
2. Update [`CHANGELOG.md`](https://github.com/getsentry/sentry-javascript/edit/master/CHANGELOG.md) to add an entry for the next release number and a list of changes since the last release.
3. Run the [Prepare Release](https://github.com/getsentry/sentry-javascript/actions/workflows/release.yml) workflow.
4. A new issue should appear in https://github.com/getsentry/publish/issues.
5. Ask a member of the [@getsentry/releases team](https://github.com/orgs/getsentry/teams/releases/members) to approve the release.
2 changes: 1 addition & 1 deletion MIGRATION.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Upgrading from 4.x to 5.x
# Upgrading from 4.x to 5.x/6.x

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

Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lerna": "3.4.0",
"version": "6.10.0",
"version": "6.13.3",
"packages": "packages/*",
"npmClient": "yarn",
"useWorkspaces": true
Expand Down
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,23 @@
"private": true,
"scripts": {
"build": "node ./scripts/verify-packages-versions.js && lerna run --stream --concurrency 1 --sort build",
"build:dev": "lerna run --stream --concurrency 1 --sort build:dev",
"build:dev:filter": "lerna run --stream --concurrency 1 --sort build:dev --include-filtered-dependencies --include-filtered-dependents --scope",
"build:es5": "lerna run --stream --concurrency 1 --sort build:es5",
"build:esm": "lerna run --stream --concurrency 1 --sort build:esm",
"build:watch": "lerna run --parallel build:watch",
"build:dev:watch": "lerna run --parallel build:dev:watch",
"circularDepCheck": "lerna run --parallel circularDepCheck",
"clean": "lerna run --parallel clean && lerna clean --yes",
"codecov": "codecov",
"fix": "lerna run --parallel fix",
"link:yarn": "lerna run --stream --concurrency 1 link:yarn",
"lint": "lerna run --parallel lint",
"lint:eslint": "lerna run --parallel lint:eslint",
"test": "lerna run --stream --concurrency 1 --sort test",
"codecov": "codecov",
"pack:changed": "lerna run pack --since",
"prepublishOnly": "lerna run --stream --concurrency 1 prepublishOnly",
"postpublish": "make publish-docs && lerna run --stream --concurrency 1 postpublish",
"circularDepCheck": "lerna run --parallel circularDepCheck"
"test": "lerna run --stream --concurrency 1 --sort test"
},
"volta": {
"node": "14.17.0",
Expand Down
30 changes: 16 additions & 14 deletions packages/angular/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry/angular",
"version": "6.10.0",
"version": "6.13.3",
"description": "Official Sentry SDK for Angular",
"repository": "git://github.com/getsentry/sentry-javascript.git",
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/angular",
Expand All @@ -21,39 +21,41 @@
"@angular/router": "10.x || 11.x || 12.x"
},
"dependencies": {
"@sentry/browser": "6.10.0",
"@sentry/types": "6.10.0",
"@sentry/utils": "6.10.0",
"@sentry/browser": "6.13.3",
"@sentry/types": "6.13.3",
"@sentry/utils": "6.13.3",
"rxjs": "^6.6.0",
"tslib": "^1.9.3"
},
"devDependencies": {
"@angular/common": "^10.0.3",
"@angular/core": "^10.0.3",
"@angular/router": "^10.0.3",
"@sentry-internal/eslint-config-sdk": "6.10.0",
"@sentry-internal/eslint-config-sdk": "6.13.3",
"npm-run-all": "^4.1.2",
"prettier": "1.19.0",
"rimraf": "^2.6.3",
"typescript": "3.7.5"
},
"scripts": {
"build": "run-p build:es5 build:esm",
"build:dev": "run-s build",
"build:es5": "tsc -p tsconfig.build.json",
"build:esm": "tsc -p tsconfig.esm.json",
"build:watch": "run-p build:watch:es5 build:watch:esm",
"build:watch:es5": "tsc -p tsconfig.build.json -w --preserveWatchOutput",
"build:watch:esm": "tsc -p tsconfig.esm.json -w --preserveWatchOutput",
"build:watch": "run-p build:es5:watch build:esm:watch",
"build:dev:watch": "run-s build:watch",
"build:es5:watch": "tsc -p tsconfig.build.json -w --preserveWatchOutput",
"build:esm:watch": "tsc -p tsconfig.esm.json -w --preserveWatchOutput",
"circularDepCheck": "madge --circular src/index.ts",
"clean": "rimraf dist esm build coverage",
"fix": "run-s fix:eslint fix:prettier",
"fix:eslint": "eslint . --format stylish --fix",
"fix:prettier": "prettier --write \"{src,test}/**/*.ts\"",
"link:yarn": "yarn link",
"lint": "run-s lint:prettier lint:eslint",
"lint:prettier": "prettier --check \"{src,test}/**/*.ts\"",
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
"fix": "run-s fix:eslint fix:prettier",
"fix:prettier": "prettier --write \"{src,test}/**/*.ts\"",
"fix:eslint": "eslint . --format stylish --fix",
"pack": "npm pack",
"circularDepCheck": "madge --circular src/index.ts"
"lint:prettier": "prettier --check \"{src,test}/**/*.ts\"",
"pack": "npm pack"
},
"volta": {
"extends": "../../package.json"
Expand Down
6 changes: 4 additions & 2 deletions packages/angular/src/tracing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { AfterViewInit, Directive, Injectable, Input, NgModule, OnDestroy, OnIni
import { Event, NavigationEnd, NavigationStart, Router } from '@angular/router';
import { getCurrentHub } from '@sentry/browser';
import { Span, Transaction, TransactionContext } from '@sentry/types';
import { logger, stripUrlQueryAndFragment, timestampWithMs } from '@sentry/utils';
import { getGlobalObject, logger, stripUrlQueryAndFragment, timestampWithMs } from '@sentry/utils';
import { Observable, Subscription } from 'rxjs';
import { filter, tap } from 'rxjs/operators';

Expand All @@ -12,6 +12,8 @@ let instrumentationInitialized: boolean;
let stashedStartTransaction: (context: TransactionContext) => Transaction | undefined;
let stashedStartTransactionOnLocationChange: boolean;

const global = getGlobalObject<Window>();

/**
* Creates routing instrumentation for Angular Router.
*/
Expand All @@ -26,7 +28,7 @@ export function routingInstrumentation(

if (startTransactionOnPageLoad) {
customStartTransaction({
name: window.location.pathname,
name: global.location.pathname,
op: 'pageload',
});
}
Expand Down
2 changes: 2 additions & 0 deletions packages/browser/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ module.exports = {
'prefer-template': 'off',
'no-unused-expressions': 'off',
'guard-for-in': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
},
},
{
Expand Down
48 changes: 24 additions & 24 deletions packages/browser/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry/browser",
"version": "6.10.0",
"version": "6.13.3",
"description": "Official Sentry SDK for browsers",
"repository": "git://github.com/getsentry/sentry-javascript.git",
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/browser",
Expand All @@ -16,13 +16,13 @@
"access": "public"
},
"dependencies": {
"@sentry/core": "6.10.0",
"@sentry/types": "6.10.0",
"@sentry/utils": "6.10.0",
"@sentry/core": "6.13.3",
"@sentry/types": "6.13.3",
"@sentry/utils": "6.13.3",
"tslib": "^1.9.3"
},
"devDependencies": {
"@sentry-internal/eslint-config-sdk": "6.10.0",
"@sentry-internal/eslint-config-sdk": "6.13.3",
"@types/eslint": "^7.2.0",
"@types/md5": "2.1.33",
"btoa": "^1.2.1",
Expand Down Expand Up @@ -54,36 +54,36 @@
"webpack": "^4.30.0"
},
"scripts": {
"build": "run-s build:dist build:esm build:bundle",
"build": "run-s build:es5 build:esm build:bundle",
"build:bundle": "rollup --config",
"build:bundle:watch": "rollup --config --watch",
"build:dist": "tsc -p tsconfig.build.json",
"build:dist:watch": "tsc -p tsconfig.build.json -w --preserveWatchOutput",
"build:es5": "run-s build:dist",
"build:es5:watch": "run-s build:dist:watch",
"build:dev": "run-s build:es5 build:esm",
"build:es5": "tsc -p tsconfig.build.json",
"build:esm": "tsc -p tsconfig.esm.json",
"build:watch": "run-p build:es5:watch build:esm:watch build:bundle:watch",
"build:bundle:watch": "rollup --config --watch",
"build:dev:watch": "run-p build:es5:watch build:esm:watch",
"build:es5:watch": "tsc -p tsconfig.build.json -w --preserveWatchOutput",
"build:esm:watch": "tsc -p tsconfig.esm.json -w --preserveWatchOutput",
"build:watch": "run-p build:dist:watch build:esm:watch build:bundle:watch",
"circularDepCheck": "madge --circular src/index.ts",
"clean": "rimraf dist esm build coverage .rpt2_cache",
"fix": "run-s fix:eslint fix:prettier",
"fix:eslint": "eslint . --format stylish --fix",
"fix:prettier": "prettier --write \"{src,test}/**/*.ts\"",
"link:yarn": "yarn link",
"lint": "run-s lint:prettier lint:eslint",
"lint:prettier": "prettier --check \"{src,test}/**/*.ts\"",
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
"fix": "run-s fix:eslint fix:prettier",
"fix:prettier": "prettier --write \"{src,test}/**/*.ts\"",
"fix:eslint": "eslint . --format stylish --fix",
"lint:prettier": "prettier --check \"{src,test}/**/*.ts\"",
"pack": "npm pack",
"size:check": "run-p size:check:es5 size:check:es6",
"size:check:es5": "cat build/bundle.min.js | gzip -9 | wc -c | awk '{$1=$1/1024; print \"ES5: \",$1,\"kB\";}'",
"size:check:es6": "cat build/bundle.es6.min.js | gzip -9 | wc -c | awk '{$1=$1/1024; print \"ES6: \",$1,\"kB\";}'",
"test": "run-s test:unit",
"test:unit": "karma start test/unit/karma.conf.js",
"test:unit:watch": "karma start test/unit/karma.conf.js --auto-watch --no-single-run",
"test:unit": "jest --config test/unit/jest.config.js",
"test:integration": "test/integration/run.js",
"test:integration:watch": "test/integration/run.js --watch",
"test:integration:checkbrowsers": "node scripts/checkbrowsers.js",
"test:package": "node test/package/npm-build.js && rm test/package/tmp.js",
"size:check": "run-p size:check:es5 size:check:es6",
"size:check:es5": "cat build/bundle.min.js | gzip -9 | wc -c | awk '{$1=$1/1024; print \"ES5: \",$1,\"kB\";}'",
"size:check:es6": "cat build/bundle.es6.min.js | gzip -9 | wc -c | awk '{$1=$1/1024; print \"ES6: \",$1,\"kB\";}'",
"pack": "npm pack",
"circularDepCheck": "madge --circular src/index.ts"
"test:unit:watch": "jest --config test/unit/jest.config.js --watch",
"test:integration:watch": "test/integration/run.js --watch"
},
"volta": {
"extends": "../../package.json"
Expand Down

0 comments on commit 573feac

Please sign in to comment.