Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

meta(changelog): Update changelog for 8.12.0 #12637

Merged
merged 14 commits into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 22 additions & 16 deletions .craft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,28 +160,34 @@ targets:
# Sentry Release Registry Target
- name: registry
sdks:
'npm:@sentry/angular':
onlyIfPresent: /^sentry-angular-\d.*\.tgz$/
'npm:@sentry/astro':
onlyIfPresent: /^sentry-astro-\d.*\.tgz$/
'npm:@sentry/aws-serverless':
onlyIfPresent: /^sentry-aws-serverless-\d.*\.tgz$/
'npm:@sentry/browser':
onlyIfPresent: /^sentry-browser-\d.*\.tgz$/
includeNames: /\.js$/
checksums:
- algorithm: sha384
format: base64
'npm:@sentry/node':
onlyIfPresent: /^sentry-node-\d.*\.tgz$/
'npm:@sentry/react':
onlyIfPresent: /^sentry-react-\d.*\.tgz$/
'npm:@sentry/vue':
onlyIfPresent: /^sentry-vue-\d.*\.tgz$/
'npm:@sentry/bun':
onlyIfPresent: /^sentry-bun-\d.*\.tgz$/
'npm:@sentry/deno':
onlyIfPresent: /^sentry-deno-\d.*\.tgz$/
'npm:@sentry/ember':
onlyIfPresent: /^sentry-ember-\d.*\.tgz$/
'npm:@sentry/gatsby':
onlyIfPresent: /^sentry-gatsby-\d.*\.tgz$/
'npm:@sentry/angular':
onlyIfPresent: /^sentry-angular-\d.*\.tgz$/
'npm:@sentry/astro':
onlyIfPresent: /^sentry-astro-\d.*\.tgz$/
'npm:@sentry/wasm':
onlyIfPresent: /^sentry-wasm-\d.*\.tgz$/
'npm:@sentry/google-cloud-serverless':
onlyIfPresent: /^sentry-google-cloud-serverless-\d.*\.tgz$/
'npm:@sentry/nextjs':
onlyIfPresent: /^sentry-nextjs-\d.*\.tgz$/
'npm:@sentry/node':
onlyIfPresent: /^sentry-node-\d.*\.tgz$/
'npm:@sentry/react':
onlyIfPresent: /^sentry-react-\d.*\.tgz$/
'npm:@sentry/remix':
onlyIfPresent: /^sentry-remix-\d.*\.tgz$/
'npm:@sentry/solid':
Expand All @@ -190,9 +196,9 @@ targets:
onlyIfPresent: /^sentry-svelte-\d.*\.tgz$/
'npm:@sentry/sveltekit':
onlyIfPresent: /^sentry-sveltekit-\d.*\.tgz$/
'npm:@sentry/bun':
onlyIfPresent: /^sentry-bun-\d.*\.tgz$/
'npm:@sentry/vercel-edge':
onlyIfPresent: /^sentry-vercel-edge-\d.*\.tgz$/
'npm:@sentry/ember':
onlyIfPresent: /^sentry-ember-\d.*\.tgz$/
'npm:@sentry/vue':
onlyIfPresent: /^sentry-vue-\d.*\.tgz$/
'npm:@sentry/wasm':
onlyIfPresent: /^sentry-wasm-\d.*\.tgz$/
16 changes: 8 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1477,33 +1477,33 @@ jobs:
node: 22

# macos x64
- os: macos-11
- os: macos-13
node: 16
arch: x64
- os: macos-11
- os: macos-13
node: 18
arch: x64
- os: macos-11
- os: macos-13
node: 20
arch: x64
- os: macos-11
- os: macos-13
node: 22
arch: x64

# macos arm64
- os: macos-12
- os: macos-13
arch: arm64
node: 16
target_platform: darwin
- os: macos-12
- os: macos-13
arch: arm64
node: 18
target_platform: darwin
- os: macos-12
- os: macos-13
arch: arm64
node: 20
target_platform: darwin
- os: macos-12
- os: macos-13
arch: arm64
node: 22
target_platform: darwin
Expand Down
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,28 @@

### Important Changes

- **feat(solid): Remove need to pass router hooks to solid integration** (breaking)

This release introduces breaking changes to the `@sentry/solid` package (which is currently out in alpha).

We've made it easier to get started with the solid router integration by removing the need to pass **use\*** hooks
explicitly to `solidRouterBrowserTracingIntegration`. Import `solidRouterBrowserTracingIntegration` from
`@sentry/solid/solidrouter` and add it to `Sentry.init`

```js
import * as Sentry from '@sentry/solid';
import { solidRouterBrowserTracingIntegration, withSentryRouterRouting } from '@sentry/solid/solidrouter';
import { Router } from '@solidjs/router';

Sentry.init({
dsn: '__PUBLIC_DSN__',
integrations: [solidRouterBrowserTracingIntegration()],
tracesSampleRate: 1.0, // Capture 100% of the transactions
});

const SentryRouter = withSentryRouterRouting(Router);
```

- **feat(core): Return client from init method (#12585)**

`Sentry.init()` now returns a client directly, so you don't need to explicitly call `getClient()` anymore:
Expand All @@ -28,10 +50,22 @@ module.exports = withSentryConfig(nextConfig, {
});
```

- **feat(node): Allow to configure `maxSpanWaitDuration` (#12610)**

Adds configuration option for the max. duration in seconds that the SDK will wait for parent spans to be finished before
discarding a span. The SDK will automatically clean up spans that have no finished parent after this duration. This is
necessary to prevent memory leaks in case of parent spans that are never finished or otherwise dropped/missing. However,
if you have very long-running spans in your application, a shorter duration might cause spans to be discarded too early.
In this case, you can increase this duration to a value that fits your expected data.

### Other Changes

- feat(feedback): Extra check for iPad in screenshot support (#12593)
- fix(build) upgrade deprecated runners (#12624)
chargome marked this conversation as resolved.
Show resolved Hide resolved
- fix(bundle): Ensure CDN bundles do not overwrite `window.Sentry` (#12580)
- fix(feedback): Inject preact from feedbackModal into feedbackScreenshot integration (#12535)
- fix(node): Re-throw errors from koa middleware (#12609)
- fix(remix): Mark `isRemixV2` as optional in exposed types. (#12614)
- ref(node): Add error message to NodeFetch log (#12612)

Work in this release was contributed by @n4bb12. Thank you for your contribution!
Expand Down
6 changes: 6 additions & 0 deletions dev-packages/e2e-tests/test-applications/node-koa/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ router1.get('/test-outgoing-http-external-disallowed', async ctx => {
ctx.body = data;
});

router1.get('/test-assert/:condition', async ctx => {
ctx.body = 200;
const condition = ctx.params.condition !== 'false';
ctx.assert(condition, 400, 'ctx.assert failed');
});

app1.use(router1.routes()).use(router1.allowedMethods());

app1.listen(port1);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { expect, test } from '@playwright/test';
import { waitForError } from '@sentry-internal/test-utils';

test('Returns 400 from failed assert', async ({ baseURL }) => {
const errorEventPromise = waitForError('node-koa', event => {
return !event.type && event.exception?.values?.[0]?.value === 'ctx.assert failed';
});

const res = await fetch(`${baseURL}/test-assert/false`);
expect(res.status).toBe(400);

const errorEvent = await errorEventPromise;

expect(errorEvent.exception?.values).toHaveLength(1);
expect(errorEvent.exception?.values?.[0]?.value).toBe('ctx.assert failed');

expect(errorEvent.request).toEqual({
method: 'GET',
cookies: {},
headers: expect.any(Object),
url: 'http://localhost:3030/test-assert/false',
});

expect(errorEvent.transaction).toEqual('GET /test-assert/:condition');

expect(errorEvent.contexts?.trace).toEqual({
trace_id: expect.any(String),
span_id: expect.any(String),
});
});

test('Returns 200 from successful assert', async ({ baseURL }) => {
const res = await fetch(`${baseURL}/test-assert/true`);
expect(res.status).toBe(200);
});
7 changes: 4 additions & 3 deletions dev-packages/e2e-tests/test-applications/solid/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* @refresh reload */
import * as Sentry from '@sentry/solid';
import { Router, useBeforeLeave, useLocation } from '@solidjs/router';
import { solidRouterBrowserTracingIntegration, withSentryRouterRouting } from '@sentry/solid/solidrouter';
import { Router } from '@solidjs/router';
import { render } from 'solid-js/web';
import './index.css';
import PageRoot from './pageroot';
Expand All @@ -10,12 +11,12 @@ Sentry.init({
dsn: import.meta.env.PUBLIC_E2E_TEST_DSN,
debug: true,
environment: 'qa', // dynamic sampling bias to keep transactions
integrations: [Sentry.solidRouterBrowserTracingIntegration({ useBeforeLeave, useLocation })],
integrations: [solidRouterBrowserTracingIntegration()],
release: 'e2e-test',
tunnel: 'http://localhost:3031/', // proxy server
tracesSampleRate: 1.0,
});

const SentryRouter = Sentry.withSentryRouterRouting(Router);
const SentryRouter = withSentryRouterRouting(Router);

render(() => <SentryRouter root={PageRoot}>{routes}</SentryRouter>, document.getElementById('root'));
18 changes: 9 additions & 9 deletions docs/migration/feedback.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ Below you can find a list of relevant feedback changes and issues that have been
We have streamlined the interface for interacting with the Feedback widget. Below is a list of public functions that
existed in 7.x and a description of how they have changed in v8.

| Method Name | Replacement | Notes |
| ------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Sentry.getClient<BrowserClient>()?.getIntegration(Feedback)` | `const feedback = Sentry.getFeedback()` | Get a type-safe reference to the configured feedbackIntegration instance. |
| `feedback.getWidget()` | `const widget = feedback.createWidget(); widget.appendToDom()` | The SDK no longer maintains a stack of form instances. If you call `createWidget()` a new widget will be inserted into the DOM and an `ActorComponent` returned allows you control over the lifecycle of the widget. |
| `feedback.openDialog()` | `widget.open()` | Make the form inside the widget visible. |
| `feedback.closeDialog()` | `widget.close()` | Make the form inside the widget hidden in the page. Success/Error messages will still be rendered and will hide themselves if the form was recently submitted. |
| `feedback.removeWidget()` | `widget.removeFromDom()` | Remove the form and widget instance from the page. After calling this `widget.el.parentNode` will be set to null. |
| `feedback.attachTo()` | `const unsubscribe = feedback.attachTo(myButtonElem)` | The `attachTo()` method will create an onClick event listener to your html element that calls `appendToDom()` and `open()`. It returns a callback to remove the event listener. |
| - | `const form = await feedback.createForm()` | A new method `createForm()`, used internally by `createWidget()` and `attachTo()`, returns a `Promise<FeedbackDialog>` so you can control showing and hiding of the feedback form directly. |
| Method Name | Replacement | Notes |
| ------------------------------------------------------------- | -------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Sentry.getClient<BrowserClient>()?.getIntegration(Feedback)` | `const feedback = Sentry.getFeedback()` | Get a type-safe reference to the configured feedbackIntegration instance. |
| `feedback.getWidget()` | `const widget = feedback.createWidget(); widget.appendToDom()` | The SDK no longer maintains a stack of form instances. If you call `createWidget()` a new widget will be inserted into the DOM and an `ActorComponent` returned allows you control over the lifecycle of the widget. |
| `feedback.openDialog()` | `widget.open()` | Make the form inside the widget visible. |
| `feedback.closeDialog()` | `widget.close()` | Make the form inside the widget hidden in the page. Success/Error messages will still be rendered and will hide themselves if the form was recently submitted. |
| `feedback.removeWidget()` | `widget.removeFromDom()` | Remove the form and widget instance from the page. After calling this `widget.el.parentNode` will be set to null. |
| `feedback.attachTo()` | `const unsubscribe = feedback.attachTo(myButtonElem)` | The `attachTo()` method will create an onClick event listener to your html element that calls `appendToDom()` and `open()`. It returns a callback to remove the event listener. |
| - | `const form = await feedback.createForm()` | A new method `createForm()`, used internally by `createWidget()` and `attachTo()`, returns a `Promise<ReturnType<FeedbackModalIntegration['createDialog']>>` so you can control showing and hiding of the feedback form directly. |

### API Examples

Expand Down
2 changes: 1 addition & 1 deletion docs/publishing-a-release.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ _These steps are only relevant to Sentry employees when preparing and publishing
4. Open a PR with the title `meta(changelog): Update changelog for VERSION` against `master` branch.
5. **Be cautious!** The PR against `master` should be merged via "Merge Commit"
6. When the PR is merged, it will automatically trigger the
[Prepare Release](https://github.com/getsentry/sentry-javascript/actions/workflows/release.yml) on master.
[Auto Prepare Release](https://github.com/getsentry/sentry-javascript/actions/workflows/auto-release.yml) on master.
7. A new issue should appear in https://github.com/getsentry/publish/issues.
8. Wait until the CI check runs have finished successfully (there is a link to them in the issue).
9. Once CI passes successfully, ask a member of the
Expand Down
Loading
Loading