Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: getsentry/sentry-javascript
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 9.10.1
Choose a base ref
...
head repository: getsentry/sentry-javascript
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 9.11.0
Choose a head ref

Commits on Mar 28, 2025

  1. ref(browser/core): Move all log flushing logic into clients (#15831)

    I experimented with a bunch of different approaches to register log
    flushing implementations, but I found the cleanest and most performant
    solution was to have log flushing logic live in clients.
    
    This refactors the browser client to do that, and adds tests for all of
    our flushing logic everywhere.
    
    The bundle size increase is not ideal, but I recognize we have no
    choice.
    
    After this gets merged in, I'll add the console logging integration to
    core. I'll also add some quick integrations for pino and winston.
    AbhiPrasad authored Mar 28, 2025

    Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    64308ce View commit details
  2. Merge branch 'release/9.10.1'

    getsentry-bot committed Mar 28, 2025

    Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    a27d9ef View commit details
  3. Merge pull request #15914 from getsentry/master

    [Gitflow] Merge master into develop
    github-actions[bot] authored Mar 28, 2025
    Copy the full SHA
    f3b9067 View commit details

Commits on Mar 31, 2025

  1. Copy the full SHA
    5a6e018 View commit details
  2. ref: Bump es-compatibility to ES2022 for node-based packages (#15926)

    In preparation for OpenTelemetry v2, which targets ES2022, we bump the
    checks to ES2022 for node-based packages.
    andreiborza authored Mar 31, 2025
    Copy the full SHA
    8af26e5 View commit details
  3. fix(cjs): Use module instead of require for CJS check (#15927)

    As `require` is supported in ESM as well from [Node
    20.19.0](https://nodejs.org/en/blog/release/v20.19.0) onwards, the check
    does not work anymore. However, `module` is not available in ESM.
    
    Also mentioned in this comment:
    #14202 (comment)
    
    
    [Node: Compatibility with
    CommonJS](https://nodejs.org/docs/latest-v15.x/api/esm.html#esm_interoperability_with_commonjs)
    
    [Bun: Using require](https://bun.sh/docs/runtime/modules#using-require)
    s1gr1d authored Mar 31, 2025
    Copy the full SHA
    eda7a1e View commit details
  4. feat: Don't truncate error messages (#15818)

    Ref getsentry/projects#837 for for not
    truncating error messages and letting relay do that.
    
    Kinda undoes #8593
    
    Should be merged after
    #15819 because
    otherwise, we keep humongous strings in memory.
    lforst authored Mar 31, 2025
    Copy the full SHA
    147989b View commit details

Commits on Apr 1, 2025

  1. ref(core): Improve URL parsing utilities (#15882)

    The bottleneck of many of the tasks written down in our Node SDK
    performance improvement task
    #15861 is
    `parseUrl`, defined here:
    
    https://github.com/getsentry/sentry-javascript/blob/3d63621714b31c1ea4c2ab2d90d5684a36805a43/packages/core/src/utils-hoist/url.ts#L17
    
    We created #15767
    to track removal of `parseUrl`. See more details in the GH issue.
    
    While working on tasks for
    #15767, I initially
    PR'd #15768, which
    introduced a `parseStringToURL` method as a replacement for `parseUrl`.
    While trying to implement that method though I realized
    `parseStringToURL` has a lot of downsides.
    
    This PR removes `parseStringToURL` in favor of a new
    `parseStringToURLObject`. Given `parseStringToURL` was never exported by
    the core SDK, this is not a breaking change.
    
    To understand `parseStringToURLObject`, let's first look at it's method
    signature:
    
    ```ts
    function parseStringToURLObject(url: string, urlBase?: string | URL | undefined): URLObject | undefined
    ```
    
    `parseStringToURLObject` takes a string URL and turns it into a
    `URLObject`, that is typed like so:
    
    ```ts
    type RelativeURL = {
      isRelative: true;
      pathname: URL['pathname'];
      search: URL['search'];
      hash: URL['hash'];
    };
    
    type URLObject = RelativeURL | URL;
    ``` 
    
    the JavaScript URL built-in does not handle relative URLs, so we need to
    use a separate object to to track relative URLs. Luckily it's pretty
    small surface area, we only need to worry about `pathname`, `search`,
    and `hash`.
    
    For ease of usage of this function, I also introduced a
    `isURLObjectRelative` helper. This will make sure that users can handle
    both relative and absolute URLs with ease.
    
    Given `packages/core/src/fetch.ts` was using `parseStringToURL`, I
    refactored that file to use `parseStringToURLObject`. The change feels
    way better to me, much easier to read and understand what is going on.
    AbhiPrasad authored Apr 1, 2025
    Copy the full SHA
    f0fc41f View commit details
  2. build(profiling-node): Fix output directory & caching (#15945)

    This used to build into `/lib` which is not covered by nx (it was
    changed there but slightly incorrectly, covering `/build/lib` instead of
    `/lib`). But overall, the way to go here is to just use our standard
    structure, which is `build/`, then this should all just work :D
    mydea authored Apr 1, 2025
    Copy the full SHA
    06a31c4 View commit details

Commits on Apr 2, 2025

  1. Copy the full SHA
    298a23c View commit details
  2. Copy the full SHA
    9a1970b View commit details
  3. Copy the full SHA
    305df9f View commit details
  4. chore(tests): Fix coverage file exclusions (#15944)

    When running some unit tests locally, I noticed that the coverage
    summary contained files like `vite.config.ts` or `.eslintrc` as well as
    transpiled code in `build`. These files shouldn't be in the coverage
    reports and neither have an influence on the overall coverage score.
    Lms24 authored Apr 2, 2025
    Copy the full SHA
    71409c3 View commit details
  5. feat(browser): Add http.redirect_count attribute to `browser.redire…

    …ct` span (#15943)
    
    Adds an `http.redirect_count` attribute to `browser.redirect`
    spans. The count is taken from the `navigation` performance entry and it
    describes the number of times a redirect happened.
    
    Two caveats:
    - we can't detect more about redirects (e.g. the location the browser
    was redirected to)
    - this only works for same-origin redirects. [According to
    MDN](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceNavigationTiming/redirectCount#value),
    cross-origin redirects are not taken into account.
    Lms24 authored Apr 2, 2025
    Copy the full SHA
    3c1b3c9 View commit details
  6. ref(browser): Temporarily add sentry.previous_trace span attribute (#…

    …15957)
    
    Temporarily add a span attribute for the previous trace to get trace links working in the EAP-based trace view. This needs to be removed once EAP properly supports span links.
    Lms24 authored Apr 2, 2025
    Copy the full SHA
    4661f4d View commit details
  7. Copy the full SHA
    3863c29 View commit details

Commits on Apr 3, 2025

  1. feat(nuxt): Add nuxt release registry craft entry (#15962)

    Turns out we never added the release registry entry for nuxt. The
    corresponding [folder exists in the release registry
    repo](https://github.com/getsentry/sentry-release-registry/tree/master/packages/npm/%40sentry/nuxt).
    andreiborza authored Apr 3, 2025
    Copy the full SHA
    ad5c06c View commit details
  2. Copy the full SHA
    64b1d0d View commit details
  3. Copy the full SHA
    ee592ad View commit details
  4. Copy the full SHA
    9807efb View commit details
  5. feat(nuxt): Base decision on source maps upload only on Nuxt source m…

    …ap settings (#15859)
    
    There is a total of 6 settings in Nuxt where you can disable/enable your
    source maps. This is not only difficult to understand when writing and
    maintaining the logic for this. It may also be hard to debug stuff for
    users.
    
    
    ![image](https://github.com/user-attachments/assets/73ff315e-2000-4408-ba62-39bd10083378)
    
    There is this discussion around Nuxt source maps:
    #15028
    And this issue:
    #15160
    
    A problem with the current setup was not only the difficulty to
    understand all of this but also it sometimes just overwrote stuff you
    didn't want it to. Like in the default case of Nuxt, `sourcemap.server`
    is `true`, but as `nitro.rollupConfig.output.sourcemap` is always
    undefined, Sentry would overwrite this setting to `'hidden'`, even
    though the source maps were enabled already.
    
    ---
    
    The only two relevant options in Nuxt are the [root-level sourcemap
    options](https://nuxt.com/docs/guide/going-further/debugging#sourcemaps).
    Those settings will propagate to nitro, vite and rollup.
    
    As we overwrite the source maps setting if the setting is undefined,
    only the basic Nuxt source map settings (linked above) are taken into
    account for that from now on.
    s1gr1d authored Apr 3, 2025
    Copy the full SHA
    6501d52 View commit details
  6. feat(core): Add consoleLoggingIntegration for logs (#15955)

    Adds `consoleLoggingIntegration` integration that takes calls to
    `console.X` and flushes them as logs. For now this is an opt-in
    integration. We can evaluate it's default status at a later point.
    
    ```js
    import * as Sentry from '@sentry/browser'; // or any other supported sdk
    
    Sentry.init({
      // send console.log, console.error, and console.warn calls as logs to Sentry
      integrations: [Sentry.consoleLoggingIntegration({ levels: ['log', 'error', 'warn'] })],
    });
    ```
    
    ## Notes
    
    In general we have inconsistencies with console instrumentation across
    our different SDKs.
    
    - In browser we have console instrumentation as part of the
    `Breadcrumbs` integration.
    - In node we have console instrumentation that generates breadcrumbs in
    the `Console` integration
    - In core we have console instrumentation, which generates errors and
    messages via the `CaptureConsole` integration
    
    For now because logs are experimental, making it a standalone
    integration feels fine to me. As we get closer to GA status for logs
    (and there is a distinct path for breadcrumbs) we should evaluate how
    all of our console integrations are structured.
    AbhiPrasad authored Apr 3, 2025
    Copy the full SHA
    438e8be View commit details
  7. feat(react-router): Add sentryHandleRequest (#15787)

    Co-authored-by: Luca Forstner <luca.forstner@sentry.io>
    chargome and lforst authored Apr 3, 2025
    Copy the full SHA
    a6e9651 View commit details
  8. Copy the full SHA
    90ee178 View commit details
  9. Merge pull request #15967 from getsentry/prepare-release/9.11.0

    meta: Update CHANGELOG for 9.11.0
    Lms24 authored Apr 3, 2025
    Copy the full SHA
    1e407cb View commit details
  10. release: 9.11.0

    getsentry-bot committed Apr 3, 2025
    Copy the full SHA
    392c061 View commit details
Showing with 1,767 additions and 818 deletions.
  1. +6 −0 .craft.yml
  2. +1 −1 .github/workflows/auto-release.yml
  3. +1 −0 .github/workflows/build.yml
  4. +1 −1 .github/workflows/release.yml
  5. +3 −3 .size-limit.js
  6. +15 −0 CHANGELOG.md
  7. +2 −2 dev-packages/browser-integration-tests/package.json
  8. +10 −10 dev-packages/browser-integration-tests/suites/public-api/captureException/linkedErrors/subject.js
  9. +10 −8 dev-packages/browser-integration-tests/suites/public-api/captureException/linkedErrors/test.ts
  10. +0 −9 ...ation-tests/suites/public-api/instrumentation/onUnhandledRejection/thrown-string-large/subject.js
  11. +0 −22 ...egration-tests/suites/public-api/instrumentation/onUnhandledRejection/thrown-string-large/test.ts
  12. +11 −0 dev-packages/browser-integration-tests/suites/public-api/logger/integration/init.js
  13. +11 −0 dev-packages/browser-integration-tests/suites/public-api/logger/integration/subject.js
  14. +116 −0 dev-packages/browser-integration-tests/suites/public-api/logger/integration/test.ts
  15. 0 dev-packages/browser-integration-tests/suites/public-api/logger/{ → simple}/subject.js
  16. +2 −2 dev-packages/browser-integration-tests/suites/public-api/logger/{ → simple}/test.ts
  17. +8 −0 ...r-integration-tests/suites/tracing/browserTracingIntegration/previous-trace-links/default/test.ts
  18. +4 −0 ...on-tests/suites/tracing/browserTracingIntegration/previous-trace-links/negatively-sampled/test.ts
  19. +1 −1 dev-packages/bundle-analyzer-scenarios/package.json
  20. +1 −1 dev-packages/clear-cache-gh-action/package.json
  21. +1 −1 dev-packages/e2e-tests/package.json
  22. +1 −1 dev-packages/e2e-tests/test-applications/nextjs-13/tests/client/fetch.test.ts
  23. +1 −1 dev-packages/e2e-tests/test-applications/nextjs-turbo/next-env.d.ts
  24. +3 −0 dev-packages/e2e-tests/test-applications/nextjs-turbo/next.config.js
  25. +1 −1 dev-packages/e2e-tests/test-applications/nextjs-turbo/package.json
  26. +10 −0 ...ages/e2e-tests/test-applications/nextjs-turbo/tests/pages-router/client-trace-propagation.test.ts
  27. +3 −1 dev-packages/e2e-tests/test-applications/react-router-7-framework/app/entry.server.tsx
  28. +9 −0 dev-packages/e2e-tests/test-applications/react-router-7-framework/package.json
  29. +4 −8 ...e2e-tests/test-applications/react-router-7-framework/tests/performance/performance.server.test.ts
  30. +1 −1 dev-packages/external-contributor-gh-action/package.json
  31. +4 −4 dev-packages/node-integration-tests/package.json
  32. +1 −1 dev-packages/rollup-utils/package.json
  33. +1 −1 dev-packages/size-limit-gh-action/package.json
  34. +2 −2 dev-packages/test-utils/package.json
  35. +1 −1 lerna.json
  36. +1 −1 package.json
  37. +4 −3 packages/angular/package.json
  38. +5 −4 packages/astro/package.json
  39. +1 −0 packages/astro/src/index.server.ts
  40. +4 −3 packages/aws-serverless/package.json
  41. +1 −0 packages/aws-serverless/src/index.ts
  42. +3 −2 packages/browser-utils/package.json
  43. +6 −2 packages/browser-utils/src/metrics/browserMetrics.ts
  44. +183 −1 packages/browser-utils/test/browser/browserMetrics.test.ts
  45. +8 −7 packages/browser/package.json
  46. +31 −3 packages/browser/src/client.ts
  47. +1 −0 packages/browser/src/index.ts
  48. +0 −1 packages/browser/src/integrations/linkederrors.ts
  49. +3 −58 packages/browser/src/log.ts
  50. +17 −3 packages/browser/src/tracing/previousTrace.ts
  51. +120 −0 packages/browser/test/client.test.ts
  52. +56 −120 packages/browser/test/log.test.ts
  53. +4 −0 packages/browser/test/tracing/browserTracingIntegration.test.ts
  54. +19 −4 packages/browser/test/tracing/previousTrace.test.ts
  55. +5 −4 packages/bun/package.json
  56. +1 −0 packages/bun/src/index.ts
  57. +3 −2 packages/cloudflare/package.json
  58. +2 −1 packages/core/package.json
  59. +43 −33 packages/core/src/fetch.ts
  60. +2 −1 packages/core/src/index.ts
  61. +1 −9 packages/core/src/integrations/linkederrors.ts
  62. +82 −0 packages/core/src/logs/console-integration.ts
  63. +9 −2 packages/core/src/logs/{index.ts → exports.ts}
  64. +19 −16 packages/core/src/server-runtime-client.ts
  65. +1 −1 packages/core/src/types-hoist/log.ts
  66. +9 −28 packages/core/src/utils-hoist/aggregate-errors.ts
  67. +8 −1 packages/core/src/utils-hoist/index.ts
  68. +75 −2 packages/core/src/utils-hoist/url.ts
  69. +0 −9 packages/core/src/utils/prepareEvent.ts
  70. +1 −1 packages/core/test/lib/logs/{index.test.ts → exports.test.ts}
  71. +74 −0 packages/core/test/lib/server-runtime-client.test.ts
  72. +10 −59 packages/core/test/utils-hoist/aggregate-errors.test.ts
  73. +88 −7 packages/core/test/utils-hoist/url.test.ts
  74. +3 −2 packages/deno/package.json
  75. +3 −3 packages/ember/package.json
  76. +3 −3 packages/eslint-config-sdk/package.json
  77. +1 −1 packages/eslint-plugin-sdk/package.json
  78. +3 −2 packages/feedback/package.json
  79. +4 −3 packages/gatsby/package.json
  80. +4 −3 packages/google-cloud-serverless/package.json
  81. +1 −0 packages/google-cloud-serverless/src/index.ts
  82. +4 −3 packages/integration-shims/package.json
  83. +4 −3 packages/nestjs/package.json
  84. +8 −7 packages/nextjs/package.json
  85. +13 −0 packages/nextjs/src/client/index.ts
  86. +12 −5 packages/nextjs/src/config/withSentryConfig.ts
  87. +13 −0 packages/nextjs/src/edge/index.ts
  88. +12 −0 packages/nextjs/src/server/index.ts
  89. +4 −3 packages/node/package.json
  90. +1 −0 packages/node/src/index.ts
  91. +5 −1 packages/node/src/utils/commonjs.ts
  92. +7 −6 packages/nuxt/package.json
  93. +176 −81 packages/nuxt/src/vite/sourceMaps.ts
  94. +162 −118 packages/nuxt/test/vite/sourceMaps.test.ts
  95. +3 −2 packages/opentelemetry/package.json
  96. +1 −1 packages/profiling-node/.eslintignore
  97. +1 −1 packages/profiling-node/.eslintrc.js
  98. +1 −1 packages/profiling-node/.gitignore
  99. +18 −18 packages/profiling-node/package.json
  100. +1 −1 packages/profiling-node/rollup.npm.config.mjs
  101. +1 −1 packages/profiling-node/tsconfig.json
  102. +1 −1 packages/profiling-node/tsconfig.types.json
  103. +8 −4 packages/react-router/package.json
  104. +1 −0 packages/react-router/src/server/index.ts
  105. +5 −1 packages/react-router/src/server/sdk.ts
  106. +52 −0 packages/react-router/src/server/sentryHandleRequest.ts
  107. +4 −3 packages/react/package.json
  108. +0 −17 packages/remix/README.md
  109. +6 −5 packages/remix/package.json
  110. +5 −3 packages/remix/src/client/performance.tsx
  111. +1 −0 packages/remix/src/server/index.ts
  112. +4 −3 packages/replay-canvas/package.json
  113. +5 −4 packages/replay-internal/package.json
  114. +2 −1 packages/replay-worker/package.json
  115. +4 −3 packages/solid/package.json
  116. +6 −5 packages/solidstart/package.json
  117. +1 −0 packages/solidstart/src/server/index.ts
  118. +4 −3 packages/svelte/package.json
  119. +7 −6 packages/sveltekit/package.json
  120. +1 −0 packages/sveltekit/src/server/index.ts
  121. +7 −6 packages/tanstackstart-react/package.json
  122. +2 −1 packages/tanstackstart/package.json
  123. +3 −2 packages/types/package.json
  124. +1 −1 packages/typescript/package.json
  125. +4 −3 packages/vercel-edge/package.json
  126. +4 −3 packages/vue/package.json
  127. +4 −3 packages/wasm/package.json
  128. +10 −0 vite/vite.config.ts
6 changes: 6 additions & 0 deletions .craft.yml
Original file line number Diff line number Diff line change
@@ -193,8 +193,12 @@ targets:
onlyIfPresent: /^sentry-gatsby-\d.*\.tgz$/
'npm:@sentry/google-cloud-serverless':
onlyIfPresent: /^sentry-google-cloud-serverless-\d.*\.tgz$/
'npm:@sentry/nestjs':
onlyIfPresent: /^sentry-nestjs-\d.*\.tgz$/
'npm:@sentry/nextjs':
onlyIfPresent: /^sentry-nextjs-\d.*\.tgz$/
'npm:@sentry/nuxt':
onlyIfPresent: /^sentry-nuxt-\d.*\.tgz$/
'npm:@sentry/node':
onlyIfPresent: /^sentry-node-\d.*\.tgz$/
'npm:@sentry/react':
@@ -211,6 +215,8 @@ targets:
onlyIfPresent: /^sentry-svelte-\d.*\.tgz$/
'npm:@sentry/sveltekit':
onlyIfPresent: /^sentry-sveltekit-\d.*\.tgz$/
'npm:@sentry/tanstackstart-react':
onlyIfPresent: /^sentry-tanstackstart-react-\d.*\.tgz$/
'npm:@sentry/vercel-edge':
onlyIfPresent: /^sentry-vercel-edge-\d.*\.tgz$/
'npm:@sentry/vue':
2 changes: 1 addition & 1 deletion .github/workflows/auto-release.yml
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ jobs:
steps:
- name: Get auth token
id: token
uses: actions/create-github-app-token@0d564482f06ca65fa9e77e2510873638c82206f2 # v1.11.5
uses: actions/create-github-app-token@d72941d797fd3113feb6b93fd0dec494b13a2547 # v1.12.0
with:
app-id: ${{ vars.SENTRY_RELEASE_BOT_CLIENT_ID }}
private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }}
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -44,6 +44,7 @@ env:
CACHED_BUILD_PATHS: |
${{ github.workspace }}/dev-packages/*/build
${{ github.workspace }}/packages/*/build
${{ github.workspace }}/packages/*/lib
${{ github.workspace }}/packages/ember/*.d.ts
${{ github.workspace }}/packages/gatsby/*.d.ts
${{ github.workspace }}/packages/utils/cjs
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ jobs:
steps:
- name: Get auth token
id: token
uses: actions/create-github-app-token@0d564482f06ca65fa9e77e2510873638c82206f2 # v1.11.5
uses: actions/create-github-app-token@d72941d797fd3113feb6b93fd0dec494b13a2547 # v1.12.0
with:
app-id: ${{ vars.SENTRY_RELEASE_BOT_CLIENT_ID }}
private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }}
6 changes: 3 additions & 3 deletions .size-limit.js
Original file line number Diff line number Diff line change
@@ -79,7 +79,7 @@ module.exports = [
path: 'packages/browser/build/npm/esm/index.js',
import: createImport('init', 'browserTracingIntegration', 'replayIntegration', 'replayCanvasIntegration'),
gzip: true,
limit: '80.5 KB',
limit: '81 KB',
},
{
name: '@sentry/browser (incl. Tracing, Replay, Feedback)',
@@ -210,7 +210,7 @@ module.exports = [
import: createImport('init'),
ignore: ['next/router', 'next/constants'],
gzip: true,
limit: '41 KB',
limit: '42 KB',
},
// SvelteKit SDK (ESM)
{
@@ -219,7 +219,7 @@ module.exports = [
import: createImport('init'),
ignore: ['$app/stores'],
gzip: true,
limit: '38 KB',
limit: '38.5 KB',
},
// Node SDK (ESM)
{
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -10,6 +10,21 @@

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

## 9.11.0

- feat(browser): Add `http.redirect_count` attribute to `browser.redirect` span ([#15943](https://github.com/getsentry/sentry-javascript/pull/15943))
- feat(core): Add `consoleLoggingIntegration` for logs ([#15955](https://github.com/getsentry/sentry-javascript/pull/15955))
- feat(core): Don't truncate error messages ([#15818](https://github.com/getsentry/sentry-javascript/pull/15818))
- feat(nextjs): Add release injection in Turbopack ([#15958](https://github.com/getsentry/sentry-javascript/pull/15958))
- feat(nextjs): Record `turbopack` as tag ([#15928](https://github.com/getsentry/sentry-javascript/pull/15928))
- feat(nuxt): Base decision on source maps upload only on Nuxt source map settings ([#15859](https://github.com/getsentry/sentry-javascript/pull/15859))
- feat(react-router): Add `sentryHandleRequest` ([#15787](https://github.com/getsentry/sentry-javascript/pull/15787))
- fix(node): Use `module` instead of `require` for CJS check ([#15927](https://github.com/getsentry/sentry-javascript/pull/15927))
- fix(remix): Remove mentions of deprecated `ErrorBoundary` wrapper ([#15930](https://github.com/getsentry/sentry-javascript/pull/15930))
- ref(browser): Temporarily add `sentry.previous_trace` span attribute ([#15957](https://github.com/getsentry/sentry-javascript/pull/15957))
- ref(browser/core): Move all log flushing logic into clients ([#15831](https://github.com/getsentry/sentry-javascript/pull/15831))
- ref(core): Improve URL parsing utilities ([#15882](https://github.com/getsentry/sentry-javascript/pull/15882))

## 9.10.1

- fix: Correct @sentry-internal/feedback docs to match the code ([#15874](https://github.com/getsentry/sentry-javascript/pull/15874))
4 changes: 2 additions & 2 deletions dev-packages/browser-integration-tests/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry-internal/browser-integration-tests",
"version": "9.10.1",
"version": "9.11.0",
"main": "index.js",
"license": "MIT",
"engines": {
@@ -42,7 +42,7 @@
"@babel/preset-typescript": "^7.16.7",
"@playwright/test": "~1.50.0",
"@sentry-internal/rrweb": "2.34.0",
"@sentry/browser": "9.10.1",
"@sentry/browser": "9.11.0",
"axios": "1.8.2",
"babel-loader": "^8.2.2",
"fflate": "0.8.2",
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
const wat = new Error(`This is a very long message that should be truncated and will be,
this is a very long message that should be truncated and will be,
this is a very long message that should be truncated and will be,
this is a very long message that should be truncated and will be,
this is a very long message that should be truncated and will be`);
const wat = new Error(`This is a very long message that should not be truncated and won't be,
this is a very long message that should not be truncated and won't be,
this is a very long message that should not be truncated and won't be,
this is a very long message that should not be truncated and won't be,
this is a very long message that should not be truncated and won't be`);

wat.cause = new Error(`This is a very long message that should be truncated and hopefully will be,
this is a very long message that should be truncated and hopefully will be,
this is a very long message that should be truncated and hopefully will be,
this is a very long message that should be truncated and hopefully will be,
this is a very long message that should be truncated and hopefully will be,`);
wat.cause = new Error(`This is a very long message that should not be truncated and hopefully won't be,
this is a very long message that should not be truncated and hopefully won't be,
this is a very long message that should not be truncated and hopefully won't be,
this is a very long message that should not be truncated and hopefully won't be,
this is a very long message that should not be truncated and hopefully won't be`);

Sentry.captureException(wat);
Original file line number Diff line number Diff line change
@@ -12,10 +12,11 @@ sentryTest('should capture a linked error with messages', async ({ getLocalTestU
expect(eventData.exception?.values).toHaveLength(2);
expect(eventData.exception?.values?.[0]).toMatchObject({
type: 'Error',
value: `This is a very long message that should be truncated and hopefully will be,
this is a very long message that should be truncated and hopefully will be,
this is a very long message that should be truncated and hopefully will be,
this is a very long me...`,
value: `This is a very long message that should not be truncated and hopefully won't be,
this is a very long message that should not be truncated and hopefully won't be,
this is a very long message that should not be truncated and hopefully won't be,
this is a very long message that should not be truncated and hopefully won't be,
this is a very long message that should not be truncated and hopefully won't be`,
mechanism: {
type: 'chained',
handled: true,
@@ -26,10 +27,11 @@ this is a very long me...`,
});
expect(eventData.exception?.values?.[1]).toMatchObject({
type: 'Error',
value: `This is a very long message that should be truncated and will be,
this is a very long message that should be truncated and will be,
this is a very long message that should be truncated and will be,
this is a very long message that should be truncated...`,
value: `This is a very long message that should not be truncated and won't be,
this is a very long message that should not be truncated and won't be,
this is a very long message that should not be truncated and won't be,
this is a very long message that should not be truncated and won't be,
this is a very long message that should not be truncated and won't be`,
mechanism: {
type: 'generic',
handled: true,

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import * as Sentry from '@sentry/browser';

window.Sentry = Sentry;

Sentry.init({
dsn: 'https://public@dsn.ingest.sentry.io/1337',
_experiments: {
enableLogs: true,
},
integrations: [Sentry.consoleLoggingIntegration()],
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
console.trace('console.trace', 123, false);
console.debug('console.debug', 123, false);
console.log('console.log', 123, false);
console.info('console.info', 123, false);
console.warn('console.warn', 123, false);
console.error('console.error', 123, false);
console.assert(false, 'console.assert', 123, false);

console.log('');

Sentry.flush();
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
import { expect } from '@playwright/test';
import type { OtelLogEnvelope } from '@sentry/core';

import { sentryTest } from '../../../../utils/fixtures';
import { getFirstSentryEnvelopeRequest, properFullEnvelopeRequestParser } from '../../../../utils/helpers';

sentryTest('should capture console object calls', async ({ getLocalTestUrl, page }) => {
const bundle = process.env.PW_BUNDLE || '';
// Only run this for npm package exports
if (bundle.startsWith('bundle') || bundle.startsWith('loader')) {
sentryTest.skip();
}

const url = await getLocalTestUrl({ testDir: __dirname });

const event = await getFirstSentryEnvelopeRequest<OtelLogEnvelope>(page, url, properFullEnvelopeRequestParser);
const envelopeItems = event[1];

expect(envelopeItems[0]).toEqual([
{
type: 'otel_log',
},
{
severityText: 'trace',
body: { stringValue: 'console.trace 123 false' },
attributes: [],
timeUnixNano: expect.any(String),
traceId: expect.any(String),
severityNumber: 1,
},
]);

expect(envelopeItems[1]).toEqual([
{
type: 'otel_log',
},
{
severityText: 'debug',
body: { stringValue: 'console.debug 123 false' },
attributes: [],
timeUnixNano: expect.any(String),
traceId: expect.any(String),
severityNumber: 5,
},
]);

expect(envelopeItems[2]).toEqual([
{
type: 'otel_log',
},
{
severityText: 'info',
body: { stringValue: 'console.log 123 false' },
attributes: [],
timeUnixNano: expect.any(String),
traceId: expect.any(String),
severityNumber: 10,
},
]);

expect(envelopeItems[3]).toEqual([
{
type: 'otel_log',
},
{
severityText: 'info',
body: { stringValue: 'console.info 123 false' },
attributes: [],
timeUnixNano: expect.any(String),
traceId: expect.any(String),
severityNumber: 9,
},
]);

expect(envelopeItems[4]).toEqual([
{
type: 'otel_log',
},
{
severityText: 'warn',
body: { stringValue: 'console.warn 123 false' },
attributes: [],
timeUnixNano: expect.any(String),
traceId: expect.any(String),
severityNumber: 13,
},
]);

expect(envelopeItems[5]).toEqual([
{
type: 'otel_log',
},
{
severityText: 'error',
body: { stringValue: 'console.error 123 false' },
attributes: [],
timeUnixNano: expect.any(String),
traceId: expect.any(String),
severityNumber: 17,
},
]);

expect(envelopeItems[6]).toEqual([
{
type: 'otel_log',
},
{
severityText: 'error',
body: { stringValue: 'Assertion failed: console.assert 123 false' },
attributes: [],
timeUnixNano: expect.any(String),
traceId: expect.any(String),
severityNumber: 17,
},
]);
});
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { expect } from '@playwright/test';
import type { OtelLogEnvelope } from '@sentry/core';

import { sentryTest } from '../../../utils/fixtures';
import { getFirstSentryEnvelopeRequest, properFullEnvelopeRequestParser } from '../../../utils/helpers';
import { sentryTest } from '../../../../utils/fixtures';
import { getFirstSentryEnvelopeRequest, properFullEnvelopeRequestParser } from '../../../../utils/helpers';

sentryTest('should capture all logging methods', async ({ getLocalTestUrl, page }) => {
const bundle = process.env.PW_BUNDLE || '';
Original file line number Diff line number Diff line change
@@ -49,6 +49,10 @@ sentryTest("navigation spans link back to previous trace's root span", async ({
},
]);

expect(navigation1TraceContext?.data).toMatchObject({
'sentry.previous_trace': `${pageloadTraceId}-${pageloadTraceContext?.span_id}-1`,
});

expect(navigation2TraceContext?.links).toEqual([
{
trace_id: navigation1TraceId,
@@ -60,6 +64,10 @@ sentryTest("navigation spans link back to previous trace's root span", async ({
},
]);

expect(navigation2TraceContext?.data).toMatchObject({
'sentry.previous_trace': `${navigation1TraceId}-${navigation1TraceContext?.span_id}-1`,
});

expect(pageloadTraceId).not.toEqual(navigation1TraceId);
expect(navigation1TraceId).not.toEqual(navigation2TraceId);
expect(pageloadTraceId).not.toEqual(navigation2TraceId);
Original file line number Diff line number Diff line change
@@ -34,6 +34,10 @@ sentryTest('includes a span link to a previously negatively sampled span', async
},
]);

expect(navigationTraceContext?.data).toMatchObject({
'sentry.previous_trace': expect.stringMatching(/[a-f0-9]{32}-[a-f0-9]{16}-0/),
});

expect(navigationTraceContext?.trace_id).not.toEqual(navigationTraceContext?.links![0].trace_id);
});
});
2 changes: 1 addition & 1 deletion dev-packages/bundle-analyzer-scenarios/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry-internal/bundle-analyzer-scenarios",
"version": "9.10.1",
"version": "9.11.0",
"description": "Scenarios to test bundle analysis with",
"repository": "git://github.com/getsentry/sentry-javascript.git",
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/dev-packages/bundle-analyzer-scenarios",
Loading