Skip to content

Commit

Permalink
Merge pull request #9052 from getsentry/prepare-release/7.70.0
Browse files Browse the repository at this point in the history
meta(changelog): Update changelog for 7.70.0
  • Loading branch information
Lms24 authored Sep 20, 2023
2 parents ca7fc38 + bc2df49 commit a2fdbab
Show file tree
Hide file tree
Showing 126 changed files with 3,760 additions and 1,070 deletions.
22 changes: 15 additions & 7 deletions .craft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,23 @@ targets:
id: '@sentry/integrations'
includeNames: /^sentry-integrations-\d.*\.tgz$/

## 4. Node-based Packages
## 4. WinterCG Packages
- name: npm
id: '@sentry/vercel-edge'
includeNames: /^sentry-vercel-edge-\d.*\.tgz$/

## 5. Node-based Packages
- name: npm
id: '@sentry/serverless'
includeNames: /^sentry-serverless-\d.*\.tgz$/
- name: npm
id: '@sentry/opentelemetry-node'
includeNames: /^sentry-opentelemetry-node-\d.*\.tgz$/
- name: npm
id: '@sentry/bun'
includeNames: /^sentry-bun-\d.*\.tgz$/

## 5. Fullstack/Meta Frameworks (depending on Node and Browser or Framework SDKs)
## 6. Fullstack/Meta Frameworks (depending on Node and Browser or Framework SDKs)
- name: npm
id: '@sentry/nextjs'
includeNames: /^sentry-nextjs-\d.*\.tgz$/
Expand All @@ -81,28 +89,28 @@ targets:
id: '@sentry/gatsby'
includeNames: /^sentry-gatsby-\d.*\.tgz$/

## 6. Other Packages
## 6.1
## 7. Other Packages
## 7.1
- name: npm
id: '@sentry-internal/typescript'
includeNames: /^sentry-internal-typescript-\d.*\.tgz$/
- name: npm
id: '@sentry-internal/eslint-plugin-sdk'
includeNames: /^sentry-internal-eslint-plugin-sdk-\d.*\.tgz$/
## 6.2
## 7.2
- name: npm
id: '@sentry-internal/eslint-config-sdk'
includeNames: /^sentry-internal-eslint-config-sdk-\d.*\.tgz$/

## 7. Deprecated packages we still release (but no packages depend on them anymore)
## 8. Deprecated packages we still release (but no packages depend on them anymore)
- name: npm
id: '@sentry/hub'
includeNames: /^sentry-hub-\d.*\.tgz$/
- name: npm
id: '@sentry/tracing'
includeNames: /^sentry-tracing-\d.*\.tgz$/

## 8. Experimental packages
## 9. Experimental packages
- name: npm
id: '@sentry/node-experimental'
includeNames: /^sentry-node-experimental-\d.*\.tgz$/
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ body:
- '@sentry/browser'
- '@sentry/angular'
- '@sentry/angular-ivy'
- '@sentry/bun'
- '@sentry/ember'
- '@sentry/gatsby'
- '@sentry/nextjs'
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,34 @@ jobs:
- name: Compute test coverage
uses: codecov/codecov-action@v3

job_bun_unit_tests:
name: Bun Unit Tests
needs: [job_get_metadata, job_build]
timeout-minutes: 10
runs-on: ubuntu-20.04
strategy:
fail-fast: false
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v3
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: Set up Bun
uses: oven-sh/setup-bun@v1
- name: Restore caches
uses: ./.github/actions/restore-cache
env:
DEPENDENCY_CACHE_KEY: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run tests
run: |
yarn test-ci-bun
- name: Compute test coverage
uses: codecov/codecov-action@v3

job_node_unit_tests:
name: Node (${{ matrix.node }}) Unit Tests
needs: [job_get_metadata, job_build]
Expand Down Expand Up @@ -787,6 +815,7 @@ jobs:
'create-react-app',
'create-next-app',
'create-remix-app',
'create-remix-app-v2',
'nextjs-app-dir',
'react-create-hash-router',
'react-router-6-use-routes',
Expand Down Expand Up @@ -864,6 +893,7 @@ jobs:
job_build,
job_browser_build_tests,
job_browser_unit_tests,
job_bun_unit_tests,
job_node_unit_tests,
job_nextjs_integration_test,
job_node_integration_tests,
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/issue-package-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ jobs:
"@sentry.angular-ivy": {
"label": "Package: Angular"
},
"@sentry.bun": {
"label": "Package: Bun"
},
"@sentry.ember": {
"label": "Package: ember"
},
Expand Down
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,36 @@

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

## 7.70.0

### Important Changes

- **feat: Add Bun SDK (#9029)**

This release contains the beta version of `@sentry/bun`, our SDK for the [Bun JavaScript runtime](https://bun.sh/)! For details on how to use it, please see the [README](./packages/bun/README.md). Any feedback/bug reports are greatly appreciated, please [reach out on GitHub](https://github.com/getsentry/sentry-javascript/discussions/7979).

Note that as of now the Bun runtime does not support global error handlers. This is being actively worked on, see [the tracking issue in Bun's GitHub repo](https://github.com/oven-sh/bun/issues/5091).

- **feat(remix): Add Remix 2.x release support. (#8940)**

The Sentry Remix SDK now officially supports Remix v2! See [our Remix docs for more details](https://docs.sentry.io/platforms/javascript/guides/remix/).

### Other Changes

- chore(node): Upgrade cookie to ^0.5.0 (#9013)
- feat(core): Introduce `processEvent` hook on `Integration` (#9017)
- feat(node): Improve non-error messages (#9026)
- feat(vercel-edge): Add Vercel Edge Runtime package (#9041)
- fix(remix): Use `React.ComponentType` instead of `React.FC` as `withSentry`'s generic type. (#9043)
- fix(replay): Ensure replay events go through `preprocessEvent` hook (#9034)
- fix(replay): Fix typo in Replay types (#9028)
- fix(sveltekit): Adjust `handleErrorWithSentry` type (#9054)
- fix(utils): Try-catch monkeypatching to handle frozen objects/functions (#9031)

Work in this release contributed by @Dima-Dim, @krist7599555 and @lifeiscontent. Thank you for your contributions!

Special thanks for @isaacharrisholt for helping us implement a Vercel Edge Runtime SDK which we use under the hood for our Next.js SDK.

## 7.69.0

### Important Changes
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@
"postpublish": "lerna run --stream --concurrency 1 postpublish",
"test": "lerna run --ignore \"@sentry-internal/{browser-integration-tests,e2e-tests,integration-shims,node-integration-tests,overhead-metrics}\" test",
"test:unit": "lerna run --ignore \"@sentry-internal/{browser-integration-tests,e2e-tests,integration-shims,node-integration-tests,overhead-metrics}\" test:unit",
"test-ci-browser": "lerna run test --ignore \"@sentry/{node,node-experimental,opentelemetry-node,serverless,nextjs,remix,gatsby,sveltekit}\" --ignore \"@sentry-internal/{browser-integration-tests,e2e-tests,integration-shims,node-integration-tests,overhead-metrics}\"",
"test-ci-browser": "lerna run test --ignore \"@sentry/{bun,node,node-experimental,opentelemetry-node,serverless,nextjs,remix,gatsby,sveltekit,vercel-edge}\" --ignore \"@sentry-internal/{browser-integration-tests,e2e-tests,integration-shims,node-integration-tests,overhead-metrics}\"",
"test-ci-node": "ts-node ./scripts/node-unit-tests.ts",
"test-ci-bun": "lerna run test --scope @sentry/bun",
"test:update-snapshots": "lerna run test:update-snapshots",
"yalc:publish": "lerna run yalc:publish"
},
Expand All @@ -41,6 +42,7 @@
"packages/angular-ivy",
"packages/browser",
"packages/browser-integration-tests",
"packages/bun",
"packages/core",
"packages/e2e-tests",
"packages/ember",
Expand Down Expand Up @@ -68,6 +70,7 @@
"packages/types",
"packages/typescript",
"packages/utils",
"packages/vercel-edge",
"packages/vue",
"packages/wasm"
],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
function callback() {
throw new Error('setTimeout_error');
}

setTimeout(callback, 0);
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { expect } from '@playwright/test';
import type { Event } from '@sentry/types';

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

sentryTest('Instrumentation should capture errors in setTimeout', async ({ getLocalTestPath, page }) => {
const url = await getLocalTestPath({ testDir: __dirname });

const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);

expect(eventData.exception?.values).toHaveLength(1);
expect(eventData.exception?.values?.[0]).toMatchObject({
type: 'Error',
value: 'setTimeout_error',
mechanism: {
type: 'instrument',
handled: false,
},
stacktrace: {
frames: expect.any(Array),
},
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import * as Sentry from '@sentry/browser';

window.Sentry = Sentry;

Sentry.init({
dsn: 'https://[email protected]/1337',
debug: true,
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
function callback() {
throw new Error('setTimeout_error');
}

setTimeout(Object.freeze(callback), 0);
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { expect } from '@playwright/test';
import type { Event } from '@sentry/types';

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

sentryTest(
'Instrumentation does not fail when using frozen callback for setTimeout',
async ({ getLocalTestPath, page }) => {
const bundleKey = process.env.PW_BUNDLE || '';
const hasDebug = !bundleKey.includes('_min');

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

const logMessages: string[] = [];

page.on('console', msg => {
logMessages.push(msg.text());
});

const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);

// It still captures the error
expect(eventData.exception?.values).toHaveLength(1);
expect(eventData.exception?.values?.[0]).toMatchObject({
type: 'Error',
value: 'setTimeout_error',
mechanism: {
type: 'instrument',
handled: false,
},
stacktrace: {
frames: expect.any(Array),
},
});

// We only care about the message when debug is enabled
if (hasDebug) {
expect(logMessages).toEqual(
expect.arrayContaining([
expect.stringContaining(
'Sentry Logger [log]: Failed to add non-enumerable property "__sentry_wrapped__" to object function callback()',
),
]),
);
}
},
);
11 changes: 11 additions & 0 deletions packages/browser/test/unit/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { getReportDialogEndpoint, SDK_VERSION } from '@sentry/core';
import type { WrappedFunction } from '@sentry/types';
import * as utils from '@sentry/utils';

import type { Event } from '../../src';
Expand Down Expand Up @@ -391,4 +392,14 @@ describe('wrap()', () => {

expect(result2).toBe(42);
});

it('should ignore frozen functions', () => {
const func = Object.freeze(() => 42);

// eslint-disable-next-line deprecation/deprecation
wrap(func);

expect(func()).toBe(42);
expect((func as WrappedFunction).__sentry_wrapped__).toBeUndefined();
});
});
12 changes: 12 additions & 0 deletions packages/bun/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
env: {
node: true,
},
extends: ['../../.eslintrc.js'],
rules: {
'@sentry-internal/sdk/no-optional-chaining': 'off',
'@sentry-internal/sdk/no-nullish-coalescing': 'off',
'@sentry-internal/sdk/no-unsupported-es6-methods': 'off',
'@sentry-internal/sdk/no-class-field-initializers': 'off',
},
};
14 changes: 14 additions & 0 deletions packages/bun/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Copyright (c) 2023 Sentry (https://sentry.io) and individual contributors. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Loading

0 comments on commit a2fdbab

Please sign in to comment.