10000 Merge branch 'develop' into priscila/feat/add-remix-e2e-test · Issawat/sentry-javascript@bfd8ff5 · GitHub
[go: up one dir, main page]

Skip to content

Commit bfd8ff5

Browse files
Merge branch 'develop' into priscila/feat/add-remix-e2e-test
2 parents 7a324dd + 1d8c81f commit bfd8ff5

File tree

183 files changed

+3090
-1955
lines changed
  • baggage-header-out
  • baggage-other-vendors-with-sentry-entries
  • tracing
  • utils
  • opentelemetry-node
  • overhead-metrics
  • react
  • remix
  • replay
  • replay-worker
  • serverless
  • svelte
  • sveltekit
  • tracing
  • tracing-internal
  • types
  • typescript
  • utils
  • vue
  • wasm
  • scripts
  • Some content is hidden

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

    183 files changed

    +3090
    -1955
    lines changed

    .github/workflows/build.yml

    Lines changed: 18 additions & 3 deletions
    Original file line numberDiff line numberDiff line change
    @@ -179,7 +179,7 @@ jobs:
    179179
    key: ${{ steps.compute_lockfile_hash.outputs.hash }}
    180180

    181181
    - name: Install dependencies
    182-
    if: steps.cache_dependencies.outputs.cache_hit != 'true'
    182+
    if: steps.cache_dependencies.outputs.cache-hit != 'true'
    183183
    run: yarn install --ignore-engines --frozen-lockfile
    184184
    outputs:
    185185
    dependency_cache_key: ${{ steps.compute_lockfile_hash.outputs.hash }}
    @@ -655,7 +655,9 @@ jobs:
    655655
    yarn test:package
    656656
    657657
    job_node_integration_tests:
    658-
    name: Node (${{ matrix.node }}) Integration Tests
    658+
    name:
    659+
    Node (${{ matrix.node }})${{ (matrix.typescript && format(' (TS {0})', matrix.typescript)) || '' }} Integration
    660+
    Tests
    659661
    needs: [job_get_metadata, job_build]
    660662
    if: needs.job_get_metadata.outputs.changed_node == 'true' || github.event_name != 'pull_request'
    661663
    runs-on: ubuntu-20.04
    @@ -664,6 +666,12 @@ jobs:
    664666
    fail-fast: false
    665667
    matrix:
    666668
    node: [10, 12, 14, 16, 18, 20]
    669+
    typescript:
    670+
    - false
    671+
    include:
    672+
    # Only check typescript for latest version (to streamline CI)
    673+
    - node: 20
    674+
    typescript: '3.8'
    667675
    steps:
    668676
    - name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
    669677
    uses: actions/checkout@v3
    @@ -677,6 +685,11 @@ jobs:
    677685
    uses: ./.github/actions/restore-cache
    678686
    env:
    679687
    DEPENDENCY_CACHE_KEY: ${{ needs.job_build.outputs.dependency_cache_key }}
    688+
    689+
    - name: Overwrite typescript version
    690+
    if: matrix.typescript
    691+
    run: yarn add --dev --ignore-workspace-root-check typescript@${{ matrix.typescript }}
    692+
    680693
    - name: Run integration tests
    681694
    env:
    682695
    NODE_VERSION: ${{ matrix.node }}
    @@ -717,7 +730,7 @@ jobs:
    717730
    yarn test:integration:ci
    718731
    719732
    job_e2e_tests:
    720-
    name: E2E Tests (Shard ${{ matrix.shard }})
    733+
    name: E2E (Shard ${{ matrix.shard }}) Tests
    721734
    # We only run E2E tests for non-fork PRs because the E2E tests require secrets to work and they can't be accessed from forks
    722735
    # Dependabot PRs sadly also don't have access to secrets, so we skip them as well
    723736
    if:
    @@ -730,6 +743,7 @@ jobs:
    730743
    fail-fast: false
    731744
    matrix:
    732745
    shard: [1, 2, 3]
    746+
    733747
    steps:
    734748
    - name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
    735749
    uses: actions/checkout@v3
    @@ -746,6 +760,7 @@ jobs:
    746760
    uses: ./.github/actions/restore-cache
    747761
    env:
    748762
    DEPENDENCY_CACHE_KEY: ${{ needs.job_build.outputs.dependency_cache_key }}
    763+
    749764
    - name: Get node version
    750765
    id: versions
    751766
    run: |

    CHANGELOG.md

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

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

    7+
    ## 7.57.0
    8+
    9+
    ### Important Changes
    10+
    11+
    - **build: Update typescript from 3.8.3 to 4.9.5 (#8255)**
    12+
    13+
    This release version [bumps the internally used typescript version from 3.8.x to 4.9.x](https://github.com/getsentry/sentry-javascript/pull/8255).
    14+
    We use ds-downlevel to generate two versions of our types, one for >=3.8, one for >=4.9.
    15+
    This means that this change should be fully backwards compatible and not have any noticable user impact,
    16+
    but if you still encounter issues please let us know.
    17+
    18+
    - **feat(types): Add tracePropagationTargets to top level options (#8395)**
    19+
    20+
    Instead of passing `tracePropagationTargets` to the `BrowserTracing` integration, you can now define them on the top level:
    21+
    22+
    ```js
    23+
    Sentry.init({
    24+
    tracePropagationTargets: ['api.site.com'],
    25+
    });
    26+
    ```
    27+
    28+
    - **fix(angular): Filter out `TryCatch` integration by default (#8367)**
    29+
    30+
    The Angular and Angular-ivy SDKs will not install the TryCatch integration anymore by default.
    31+
    This integration conflicted with the `SentryErrorHander`, sometimes leading to duplicated errors and/or missing data on events.
    32+
    33+
    - **feat(browser): Better event name handling for non-Error objects (#8374)**
    34+
    35+
    When capturing non-errors via `Sentry.captureException()`, e.g. `Sentry.captureException({ prop: "custom object" })`,
    36+
    we now generate a more helpful value for the synthetic exception. Instead of e.g. `Non-Error exception captured with keys: currentTarget, isTrusted, target, type`, you'll now get messages like:
    37+
    38+
    ```
    39+
    Object captured as exception with keys: prop1, prop2
    40+
    Event `MouseEvent` (type=click) captured as exception
    41+
    Event `ErrorEvent` captured as exception with message `Script error.`
    42+
    ```
    43+
    44+
    ### Other Changes
    45+
    46+
    - feat(browser): Send profiles in same envelope as transactions (#8375)
    47+
    - feat(profiling): Collect timings on profiler s 10000 top calls (#8409)
    48+
    - feat(replay): Do not capture replays < 5 seconds (GA) (#8277)
    49+
    - feat(tracing): Add experiment to capture http timings (#8371)
    50+
    - feat(tracing): Add `http.response.status_code` to `span.data` (#8366)
    51+
    - fix(angular): Stop routing spans on navigation cancel and error events (#8369)
    52+
    - fix(core): Only start spans in `trace` if tracing is enabled (#8357)
    53+
    - fix(nextjs): Inject init calls via loader instead of via entrypoints (#8368)
    54+
    - fix(replay): Mark ui.slowClickDetected `clickCount` as optional (#8376)
    55+
    - fix(serverless): Export `autoDiscoverNodePerformanceMonitoringIntegrations` from SDK (#8382)
    56+
    - fix(sveltekit): Check for cached requests in client-side fetch instrumentation (#8391)
    57+
    - fix(sveltekit): Only instrument SvelteKit `fetch` if the SDK client is valid (#8381)
    58+
    - fix(tracing): Instrument Prisma client in constructor of integration (#8383)
    59+
    - ref(replay): More graceful `sessionStorage` check (#8394)
    60+
    - ref(replay): Remove circular dep in replay eventBuffer (#8389)
    61+
    762
    ## 7.56.0
    863

    964
    - feat(replay): Rework slow click & multi click detection (#8322)

    lerna.json

    Lines changed: 2 additions & 3 deletions
    Original file line numberDiff line numberDiff line change
    @@ -1,6 +1,5 @@
    11
    {
    22
    "$schema": "node_modules/lerna/schemas/lerna-schema.json",
    3-
    "version": "7.56.0",
    4-
    "npmClient": "yarn",
    5-
    "useWorkspaces": true
    3+
    "version": "7.57.0",
    4+
    "npmClient": "yarn"
    65
    }

    nx.json

    Lines changed: 14 additions & 41 deletions
    Original file line numberDiff line numberDiff line change
    @@ -3,68 +3,40 @@
    33
    "default": {
    44
    "runner": "nx/tasks-runners/default",
    55
    "options": {
    6-
    "cacheableOperations": [
    7-
    "build:bundle",
    8-
    "build:transpile",
    9-
    "build:types",
    10-
    "lint:eslint",
    11-
    "test:unit"
    12-
    ],
    6+
    "cacheableOperations": ["build:bundle", "build:transpile", "build:types", "lint:eslint", "test:unit"],
    137
    "cacheDirectory": ".nxcache"
    148
    }
    159
    }
    1610
    },
    1711
    "namedInputs": {
    1812
    "default": ["{projectRoot}/**/*", "sharedGlobals"],
    19-
    "sharedGlobals": [
    20-
    "{workspaceRoot}/*.js",
    21-
    "{workspaceRoot}/*.json"
    22-
    ],
    23-
    "production": [
    24-
    "default",
    25-
    "!{projectRoot}/test/**/*",
    26-
    "!{projectRoot}/**/*.md"
    27-
    ]
    13+
    "sharedGlobals": ["{workspaceRoot}/*.js", "{workspaceRoot}/*.json"],
    14+
    "production": ["default", "!{projectRoot}/test/**/*", "!{projectRoot}/**/*.md"]
    2815
    },
    2916
    "targetDefaults": {
    3017
    "build:bundle": {
    3118
    "inputs": ["production", "^production"],
    32-
    "dependsOn": [
    33-
    "build:transpile"
    34-
    ],
    35-
    "outputs": [
    36-
    "{projectRoot}/build/bundles"
    37-
    ]
    19+
    "dependsOn": ["build:transpile"],
    20+
    "outputs": ["{projectRoot}/build/bundles"]
    3821
    },
    3922
    "build:tarball": {
    4023
    "inputs": ["production", "^production"],
    41-
    "dependsOn": [
    42-
    "build:transpile",
    43-
    "build:types"
    44-
    ],
    24+
    "dependsOn": ["build:transpile", "build:types"],
    4525
    "outputs": []
    4626
    },
    4727
    "build:transpile": {
    4828
    "inputs": ["production", "^production"],
    49-
    "dependsOn": [
    50-
    "^build:transpile:uncached",
    51-
    "^build:transpile",
    52-
    "build:transpile:uncached"
    53-
    ],
    54-
    "outputs": [
    55-
    "{projectRoot}/build/npm",
    56-
    "{projectRoot}/build/esm",
    57-
    "{projectRoot}/build/cjs"
    58-
    ]
    29+
    "dependsOn": ["^build:transpile:uncached", "^build:transpile", "build:transpile:uncached"],
    30+
    "outputs": ["{projectRoot}/build/npm", "{projectRoot}/build/esm", "{projectRoot}/build/cjs"]
    5931
    },
    6032
    "build:types": {
    6133
    "inputs": ["production", "^production"],
    62-
    "dependsOn": [
    63-
    "^build:types"
    64-
    ],
    34+
    "dependsOn": ["^build:types"],
    6535
    "outputs": [
    6636
    "{projectRoot}/build/types",
    67-
    "{projectRoot}/build/npm/types"
    37+
    "{projectRoot}/build/types-ts3.8",
    38+
    "{projectRoot}/build/npm/types",
    39+
    "{projectRoot}/build/npm/types-ts3.8"
    6840
    ]
    6941
    },
    7042
    "lint:eslint": {
    @@ -76,5 +48,6 @@
    7648
    "inputs": ["default"],
    7749
    "outputs": ["{projectRoot}/coverage"]
    7850
    }
    79-
    }
    51+
    },
    52+
    "$schema": "./node_modules/nx/schemas/nx-schema.json"
    8053
    }

    package.json

    Lines changed: 7 additions & 6 deletions
    Original file line numberDiff line numberDiff line change
    @@ -25,9 +25,9 @@
    2525
    "lint:eslint": "lerna run lint:eslint",
    2626
    "validate:es5": "lerna run validate:es5",
    2727
    "postpublish": "lerna run --stream --concurrency 1 postpublish",
    28-
    "test": "lerna run --ignore @sentry-internal/* test",
    29-
    "test:unit": "lerna run --ignore @sentry-internal/* test:unit",
    30-
    "test-ci-browser": "lerna run test --ignore \"@sentry/{node,opentelemetry-node,serverless,nextjs,remix,gatsby,sveltekit}\" --ignore @sentry-internal/*",
    28+
    "test": "lerna run --ignore \"@sentry-internal/{browser-integration-tests,e2e-tests,integration-shims,node-integration-tests,overhead-metrics}\" test",
    29+
    "test:unit": "lerna run --ignore \"@sentry-internal/{browser-integration-tests,e2e-tests,integration-shims,node-integration-tests,overhead-metrics}\" test:unit",
    30+
    "test-ci-browser": "lerna run test --ignore \"@sentry/{node,opentelemetry-node,serverless,nextjs,remix,gatsby,sveltekit}\" --ignore \"@sentry-internal/{browser-integration-tests,e2e-tests,integration-shims,node-integration-tests,overhead-metrics}\"",
    3131
    "test-ci-node": "ts-node ./scripts/node-unit-tests.ts",
    3232
    "test:update-snapshots": "lerna run test:update-snapshots",
    3333
    "yalc:publish": "lerna run yalc:publish"
    @@ -90,14 +90,15 @@
    9090
    "chai": "^4.1.2",
    9191
    "codecov": "^3.6.5",
    9292
    "deepmerge": "^4.2.2",
    93+
    "downlevel-dts": "~0.11.0",
    9394
    "es-check": "7.1.0",
    9495
    "eslint": "7.32.0",
    9596
    "jest": "^27.5.1",
    9697
    "jest-environment-node": "^27.5.1",
    9798
    "jsdom": "^19.0.0",
    9899
    "karma-browserstack-launcher": "^1.5.1",
    99100
    "karma-firefox-launcher": "^1.1.0",
    100-
    "lerna": "6.5.0-alpha.2",
    101+
    "lerna": "7.1.1",
    101102
    "madge": "4.0.2",
    102103
    "mocha": "^6.1.4",
    103104
    "nodemon": "^2.0.16",
    @@ -114,9 +115,9 @@
    114115
    "size-limit": "^4.5.5",
    115116
    "ts-jest": "^27.1.4",
    116117
    "ts-node": "10.9.1",
    117-
    "tslib": "^2.3.1",
    118+
    "tslib": "2.4.1",
    118119
    "typedoc": "^0.18.0",
    119-
    "typescript": "3.8.3",
    120+
    "typescript": "4.9.5",
    120121
    "vitest": "^0.29.2",
    121122
    "yalc": "^1.0.0-pre.53"
    122123
    },

    packages/angular-ivy/README.md

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -175,7 +175,7 @@ import { TraceModule } from '@sentry/angular-ivy';
    175175
    export class AppModule {}
    176176
    ```
    177177

    178-
    Then inside your components template (keep in mind that directive name attribute is required):
    178+
    Then, inside your component's template (keep in mind that the directive's name attribute is required):
    179179

    180180
    ```html
    181181
    <app-header trace="header"></app-header>

    packages/angular-ivy/package.json

    Lines changed: 5 additions & 6 deletions
    Original file line numberDiff line numberDiff line change
    @@ -1,6 +1,6 @@
    11
    {
    22
    "name": "@sentry/angular-ivy",
    3-
    "version": "7.56.0",
    3+
    "version": "7.57.0",
    44
    "description": "Official Sentry SDK for Angular with full Ivy Support",
    55
    "repository": "git://github.com/getsentry/sentry-javascript.git",
    66
    "homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/angular-ivy",
    @@ -21,10 +21,10 @@
    2121
    "rxjs": "^6.5.5 || ^7.x"
    2222
    },
    2323
    "dependencies": {
    24-
    "@sentry/browser": "7.56.0",
    25-
    "@sentry/types": "7.56.0",
    26-
    "@sentry/utils": "7.56.0",
    27-
    "tslib": "^2.3.0"
    24+
    "@sentry/browser": "7.57.0",
    25+
    "@sentry/types": "7.57.0",
    26+
    "@sentry/utils": "7.57.0",
    27+
    "tslib": "^2.4.1"
    2828
    },
    2929
    "devDependencies": {
    3030
    "@angular-devkit/build-angular": "~12.2.18",
    @@ -37,7 +37,6 @@
    3737
    "@angular/platform-browser-dynamic": "~12.2.0",
    3838
    "@angular/router": "~12.2.0",
    3939
    "ng-packagr": "^12.1.1",
    40-
    "typescript": "~4.3.5",
    4140
    "zone.js": "~0.11.4"
    4241
    },
    4342
    "scripts": {

    packages/angular/README.md

    Lines changed: 2 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -21,7 +21,7 @@
    2121

    2222
    If you're using Angular 12 or newer, we recommend using `@sentry/angular-ivy` for native support with Angular's rendering engine Ivy.
    2323

    24-
    This SDK stilll officially supports Angular 10-15. If you are using an older version of Angular and experience problems with the Angular SDK, we recommend downgrading the SDK to version 6.x.
    24+
    This SDK still officially supports Angular 10-15. If you are using an older version of Angular and experience problems with the Angular SDK, we recommend downgrading the SDK to version 6.x.
    2525

    2626
    ## General
    2727

    @@ -175,7 +175,7 @@ import { TraceModule } from '@sentry/angular';
    175175
    export class AppModule {}
    176176
    ```
    177177

    178-
    Then inside your components template (keep in mind that directive name attribute is required):
    178+
    Then, inside your component's template (keep in mind that the directive's name attribute is required):
    179179

    180180
    ```html
    181181
    <app-header trace="header"></app-header>

    packages/angular/package.json

    Lines changed: 6 additions & 6 deletions
    Original file line numberDiff line numberDiff line change
    @@ -1,6 +1,6 @@
    11
    {
    22
    "name": "@sentry/angular",
    3-
    "version": "7.56.0",
    3+
    "version": "7.57.0",
    44
    "description": "Official Sentry SDK for Angular",
    55
    "repository": "git://github.com/getsentry/sentry-javascript.git",
    66
    "homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/angular",
    @@ -21,10 +21,10 @@
    2121
    "rxjs": "^6.5.5 || ^7.x"
    2222
    },
    2323
    "dependencies": {
    24-
    "@sentry/browser": "7.56.0",
    25-
    "@sentry/types": "7.56.0",
    26-
    "@sentry/utils": "7.56.0",
    27-
    "tslib": "^2.0.0"
    24+
    "@sentry/browser": "7.57.0",
    25+
    "@sentry/types": "7.57.0",
    26+
    "@sentry/utils": "7.57.0",
    27+
    "tslib": "^2.4.1"
    2828
    },
    2929
    "devDependencies": {
    3030
    "@angular-devkit/build-angular": "~0.1002.4",
    @@ -38,7 +38,7 @@
    3838
    "@angular/router": "~10.2.5",
    3939
    "ng-packagr": "^10.1.0",
    4040
    "rxjs": "6.5.5",
    41-
    "typescript": "~4.0.2",
    41+
    "typescript": "4.0.2",
    4242
    "zone.js": "^0.11.8"
    4343
    },
    4444
    "scripts": {

    packages/angular/src/errorhandler.ts

    Lines changed: 3 additions & 4 deletions
    Original file line numberDiff line numberDiff line change
    @@ -2,7 +2,7 @@ import { HttpErrorResponse } from '@angular/common/http';
    22
    import type { ErrorHandler as AngularErrorHandler } from '@angular/core';
    33
    import { Inject, Injectable } from '@angular/core';
    44
    import * as Sentry from '@sentry/browser';
    5-
    import { captureException } from '@sentry/browser';
    5+
    import type { Event, Scope } from '@sentry/types';
    66
    import { addExceptionMechanism, isString } from '@sentry/utils';
    77

    88
    import { runOutsideAngular } from './zone';
    @@ -69,7 +69,6 @@ function isErrorOrErrorLikeObject(value: unknown): value is Error {
    6969
    const candidate = value as ErrorCandidate;
    7070

    7171
    return (
    72-
    isString(candidate.name) &&
    7372
    isString(candidate.name) &&
    7473
    isString(candidate.message) &&
    7574
    (undefined === candidate.stack || isString(candidate.stack))
    @@ -101,7 +100,7 @@ class SentryErrorHandler implements AngularErrorHandler {
    101100

    102101
    // Capture handled exception and send it to Sentry.
    103102
    const eventId = runOutsideAngular(() =>
    104-
    captureException(extractedError, scope => {
    103+
    Sentry.captureException(extractedError, (scope: Scope) => {
    105104
    scope.addEventProcessor(event => {
    106105
    addExceptionMechanism(event, {
    107106
    type: 'angular',
    @@ -126,7 +125,7 @@ class SentryErrorHandler implements AngularErrorHandler {
    126125
    const client = Sentry.getCurrentHub().getClient();
    127126

    128127
    if (client && client.on && !this._registeredAfterSendEventHandler) {
    129-
    client.on('afterSendEvent', event => {
    128+
    client.on('afterSendEvent', (event: Event) => {
    130129
    if (!event.type) {
    131130
    Sentry.showReportDialog({ ...this._options.dialogOptions, eventId: event.event_id });
    132131
    }

    0 commit comments

    Comments
     (0)
    0