-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
feat(nuxt): Add piniaIntegration
#14138
Conversation
6c631ca
to
7ace30b
Compare
7ace30b
to
3cd9bcc
Compare
piniaIntegration
CHANGELOG.md
Outdated
@@ -10,6 +10,73 @@ | |||
|
|||
- "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott | |||
|
|||
- **feat(nuxt): Add Sentry Pinia plugin ([#14138](https://github.com/getsentry/sentry-javascript/pull/14138))** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
m: the PR description here doesn't match the actual PR
consoleSandbox(() => { | ||
// eslint-disable-next-line no-console | ||
console.warn( | ||
'[Sentry] You added the Pinia integration, but the passed parameter `pinia` has the wrong value. Make sure to enable Pinia by adding `"@pinia/nuxt"` to your Nuxt modules array and pass pinia to Sentry with `piniaIntegration(usePinia())`. Current value of `pinia`: ', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ultra-l: I'd change the prose and remove the you/your
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passive language: "The pinia integration was configured/added, ..."
consoleSandbox(() => { | ||
// eslint-disable-next-line no-console | ||
console.warn( | ||
'[Sentry] You added the Pinia integration, but the passed parameter `pinia` has the wrong value. Make sure to enable Pinia by adding `"@pinia/nuxt"` to your Nuxt modules array and pass pinia to Sentry with `piniaIntegration(usePinia())`. Current value of `pinia`: ', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
l: You don't need the extra space after :
, a space is rendered by default between arguments passed to console logs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, I'm just confused about the changelog
CHANGELOG.md
Outdated
Sentry.init({ | ||
integrations: [ | ||
Sentry.piniaIntegration(usePinia(), { | ||
/* optinal Pinia plugin options */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/* optinal Pinia plugin options */ | |
/* optional Pinia plugin options */ |
❌ 1 Tests Failed:
View the top 1 failed tests by shortest run time
To view individual test run time comparison to the main branch, go to the Test Analytics Dashboard |
expect(actionBreadcrumb?.message).toBe('Transformed: addItem'); | ||
expect(actionBreadcrumb?.level).toBe('info'); | ||
|
||
const stateContext = error.contexts?.state?.state; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
q (probably no action required): Are the double state
keys on purpose?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is on purpose: https://develop.sentry.dev/sdk/data-model/event-payloads/contexts/#state-context
After reverting #14134, this is a more bundle-size friendly way of adding monitoring for Pinia in Nuxt.
The Nuxt SDK now allows you to track Pinia state for captured errors. To enable the Pinia plugin, add the
piniaIntegration
to your client config: