GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(nuxt): Inject sentry config with Nuxt `addPluginTemplate` by s1gr1d · Pull Request #12760 · getsentry/sentry-javascript

Conversation

@s1gr1d

@s1gr1d s1gr1d commented Jul 4, 2024

Copy link
Copy Markdown
Member

Adding the import snippet with addPluginTemplate (docs) instead of modifying the root component code.

closes #12759

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
s1gr1d and others added 2 commits July 4, 2024 14:16
@s1gr1d
feat(nuxt): Add sentry config with plugin template
69dc0df
@s1gr1d
Merge branch 'develop' into sig/nuxt-plugin-template
d802cb0
@s1gr1d
s1gr1d requested review from lforst and mydea July 4, 2024 12:21
@s1gr1d s1gr1d changed the title feat(nuxt): Add sentry config with plugin template feat(nuxt): Inject sentry config with Nuxt addPluginTemplate Jul 4, 2024
@s1gr1d s1gr1d added the Package: nuxt label Jul 4, 2024
@github-actions

github-actions Bot commented Jul 4, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
@sentry/browser 22.28 KB (0%)
@sentry/browser (incl. Tracing) 33.43 KB (0%)
@sentry/browser (incl. Tracing, Replay) 69.18 KB (0%)
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 62.51 KB (0%)
@sentry/browser (incl. Tracing, Replay with Canvas) 73.24 KB (0%)
@sentry/browser (incl. Tracing, Replay, Feedback) 85.87 KB (0%)
@sentry/browser (incl. Tracing, Replay, Feedback, metrics) 87.73 KB (0%)
@sentry/browser (incl. metrics) 26.57 KB (0%)
@sentry/browser (incl. Feedback) 38.93 KB (0%)
@sentry/browser (incl. sendFeedback) 26.9 KB (0%)
@sentry/browser (incl. FeedbackAsync) 31.52 KB (0%)
@sentry/react 25.02 KB (0%)
@sentry/react (incl. Tracing) 36.46 KB (0%)
@sentry/vue 26.39 KB (0%)
@sentry/vue (incl. Tracing) 35.29 KB (0%)
@sentry/svelte 22.41 KB (0%)
CDN Bundle 23.5 KB (0%)
CDN Bundle (incl. Tracing) 35.19 KB (0%)
CDN Bundle (incl. Tracing, Replay) 69.29 KB (0%)
CDN Bundle (incl. Tracing, Replay, Feedback) 74.48 KB (0%)
CDN Bundle - uncompressed 68.97 KB (0%)
CDN Bundle (incl. Tracing) - uncompressed 103.98 KB (0%)
CDN Bundle (incl. Tracing, Replay) - uncompressed 214.38 KB (0%)
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 227.09 KB (0%)
@sentry/nextjs (client) 36.35 KB (0%)
@sentry/sveltekit (client) 34.07 KB (0%)
@sentry/node 130.84 KB (+0.01% 🔺)
@sentry/node - without tracing 91.86 KB (+0.01% 🔺)
@sentry/aws-serverless 117.03 KB (+0.01% 🔺)
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

lforst
lforst reviewed Jul 4, 2024
View reviewed changes
Comment thread packages/nuxt/package.json
"nuxt": "3.x"
},
"dependencies": {
"@nuxt/kit": "^3.12.2",

@lforst lforst Jul 4, 2024

Copy link
Copy Markdown
Contributor

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.

Do you know, is it normal for plugins like sentry to directly depend on nuxt kit or is it more like a peer dep thing?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@s1gr1d s1gr1d Jul 4, 2024

Copy link
Copy Markdown
Member Author

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.

I saw it as a dependency in other Nuxt modules and therefore added it there too

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

lforst reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread packages/nuxt/src/common/utils.ts Outdated

@lforst lforst Jul 4, 2024

Copy link
Copy Markdown
Contributor

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: I find it odd to place this file into a common folder. The common folder usually denotes things that may run in any runtime. The code in this file is only allowed to run during the build right? Same goes for the other build code.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread packages/nuxt/src/module.ts Outdated
const serverConfigFile = findDefaultSdkInitFile('server');

if (serverConfigFile) {
nuxt.options.alias['#sentry-server-config'] = buildDirResolver.resolve(`/${serverConfigFile}`);

@lforst lforst Jul 4, 2024

Copy link
Copy Markdown
Contributor

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: Maybe there's a way to get rid of this alias indirection by rendering buildDirResolver.resolve(/${clientConfigFile}) directly into the template.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

s1gr1d reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread packages/nuxt/src/module.ts Outdated
if (clientConfigFile) {
nuxt.options.alias['#sentry-client-config'] = buildDirResolver.resolve(`/${clientConfigFile}`);

injectSentryConfigImport('#sentry-client-config');

@lforst lforst Jul 4, 2024

Copy link
Copy Markdown
Contributor

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: I have a feeling we're including both templates for client and server in both bundles, since we are not setting the mode option.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

s1gr1d reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread packages/nuxt/README.md Outdated
Comment on lines +86 to +90
if (import.meta.env.SSR) {
Sentry.init({
dsn: env.DSN,
});
}

@lforst lforst Jul 4, 2024

Copy link
Copy Markdown
Contributor

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.

h: I think if we set a mode in addPluginTemplate we can get rid of the if statements around sentry.init.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

s1gr1d reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@s1gr1d
review changes
ef1c2c4
@s1gr1d
s1gr1d requested a review from lforst July 4, 2024 13:17
AbhiPrasad
AbhiPrasad approved these changes Jul 4, 2024
View reviewed changes
s1gr1d added 4 commits July 4, 2024 16:16
@s1gr1d
Merge branch 'develop' into sig/nuxt-plugin-template
1cc6e02
@s1gr1d
Merge branch 'develop' into sig/nuxt-plugin-template
da48eac
@s1gr1d
Merge branch 'develop' into sig/nuxt-plugin-template
09e5255
@s1gr1d
Merge branch 'develop' into sig/nuxt-plugin-template
306a2d2
@s1gr1d s1gr1d mentioned this pull request Jul 5, 2024
feat(nuxt): Inject sentry client config with Nuxt addPluginTemplate #12783
Closed
@s1gr1d
revert package versions
0d4a77a
@s1gr1d
s1gr1d merged commit ecc95e7 into develop Jul 5, 2024
@s1gr1d
s1gr1d deleted the sig/nuxt-plugin-template branch July 5, 2024 17:32
This was referenced Jul 30, 2024
[Snyk] Upgrade @sentry/react from 7.16.0 to 8.16.0 https-quantumblockchainai-atlassian-net/ossinsight#787
Open
[Snyk] Upgrade @sentry/react from 7.16.0 to 8.17.0 https-quantumblockchainai-atlassian-net/ossinsight#791
Open
@amykapernick amykapernick mentioned this pull request Aug 1, 2024
[Snyk] Upgrade @sentry/nextjs from 8.14.0 to 8.17.0 amykapernick/wedding#12
Open
@wkylin wkylin mentioned this pull request Aug 1, 2024
[Snyk] Upgrade @sentry/react from 8.15.0 to 8.17.0 wkylin/pro-react-admin#370
Closed
@q1blue q1blue mentioned this pull request Aug 6, 2024
[Snyk] Upgrade @sentry/react from 7.16.0 to 8.18.0 https-quantumblockchainai-atlassian-net/ossinsight#799
Open
@wkylin wkylin mentioned this pull request Aug 7, 2024
[Snyk] Upgrade @sentry/react from 8.15.0 to 8.18.0 wkylin/pro-react-admin#371
Merged
This was referenced Aug 9, 2024
[Snyk] Upgrade @sentry/react from 7.118.0 to 8.19.0 Stanislav1975/win11React#4
Open
[Snyk] Upgrade @sentry/node from 6.17.4 to 8.19.0 Stanislav1975/shields#596
Open
@q1blue q1blue mentioned this pull request Aug 9, 2024
[Snyk] Upgrade @sentry/react from 7.16.0 to 8.19.0 https-quantumblockchainai-atlassian-net/ossinsight#802
Open
@FengShangWuQi FengShangWuQi mentioned this pull request Aug 11, 2024
[Snyk] Upgrade @sentry/gatsby from 7.20.0 to 8.19.0 FengShangWuQi/fengshangwuqi.github.io#1914
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@mydea mydea Awaiting requested review from mydea
@lforst lforst Awaiting requested review from lforst
1 more reviewer
@AbhiPrasad AbhiPrasad AbhiPrasad approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Add side effect import of sentry config to Nuxt app

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@s1gr1d @lforst @AbhiPrasad
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.