Skip to content

feat(nuxt): Add base boilerplate for nuxt #12573

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

Merged
merged 22 commits into from
Jun 21, 2024
Merged

feat(nuxt): Add base boilerplate for nuxt #12573

merged 22 commits into from
Jun 21, 2024

Conversation

s1gr1d
Copy link
Member

@s1gr1d s1gr1d commented Jun 20, 2024

Boilerplate which adds a basic wrapper around the vue SDK. Still a lot WIP.

closes #12572

@@ -24,7 +24,6 @@ const INTEGRATION_NAME = 'Vue';
const _vueIntegration = ((integrationOptions: Partial<VueOptions> = {}) => {
return {
name: INTEGRATION_NAME,
// TODO v8: Remove this
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can remove this comment, right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup we can remove!

Copy link
Contributor

github-actions bot commented Jun 20, 2024

size-limit report 📦

Path Size
@sentry/browser 22.22 KB (0%)
@sentry/browser (incl. Tracing) 33.31 KB (0%)
@sentry/browser (incl. Tracing, Replay) 69.09 KB (0%)
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 62.42 KB (0%)
@sentry/browser (incl. Tracing, Replay with Canvas) 73.15 KB (0%)
@sentry/browser (incl. Tracing, Replay, Feedback) 85.34 KB (0%)
@sentry/browser (incl. Tracing, Replay, Feedback, metrics) 87.21 KB (0%)
@sentry/browser (incl. metrics) 26.5 KB (0%)
@sentry/browser (incl. Feedback) 38.45 KB (0%)
@sentry/browser (incl. sendFeedback) 26.85 KB (0%)
@sentry/browser (incl. FeedbackAsync) 31.45 KB (0%)
@sentry/react 24.97 KB (0%)
@sentry/react (incl. Tracing) 36.36 KB (0%)
@sentry/vue 26.33 KB (0%)
@sentry/vue (incl. Tracing) 35.17 KB (0%)
@sentry/svelte 22.36 KB (0%)
CDN Bundle 23.42 KB (0%)
CDN Bundle (incl. Tracing) 35.05 KB (0%)
CDN Bundle (incl. Tracing, Replay) 69.18 KB (0%)
CDN Bundle (incl. Tracing, Replay, Feedback) 74.38 KB (0%)
CDN Bundle - uncompressed 68.8 KB (0%)
CDN Bundle (incl. Tracing) - uncompressed 103.66 KB (0%)
CDN Bundle (incl. Tracing, Replay) - uncompressed 214.13 KB (0%)
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 226.79 KB (0%)
@sentry/nextjs (client) 36.24 KB (0%)
@sentry/sveltekit (client) 33.95 KB (0%)
@sentry/node 113.24 KB (+0.23% 🔺)
@sentry/node - without tracing 90.61 KB (+0.25% 🔺)
@sentry/aws-serverless 99.71 KB (+0.23% 🔺)

"@babel/types": "7.20.7",
"@nuxt/module-builder": "0.8.0",
"nuxt": "^3.12.2",
"vite": "^5.0.10"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you don't need this in here, handled by the workspace already afaik

@andreiborza
Copy link
Member

Could we already add some basic unit tests for the sdk init?

@s1gr1d s1gr1d added the Package: nuxt Issues related to the Sentry Nuxt SDK label Jun 20, 2024
@s1gr1d s1gr1d self-assigned this Jun 20, 2024
@@ -26,5 +27,7 @@ export function init(
...config,
};

applySdkMetadata(config, 'nuxt', ['nuxt', 'vue']);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does not look right, probably a leftover? :)

Copy link
Member

@andreiborza andreiborza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

setup(_moduleOptions, _nuxt) {
// Ignore because of `import.meta.url`
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

m: We should use @ts-expect-error, we can remove the eslint disable then.

Why is import.meta.url causing issues? We should change the tsconfig in this repo to make sure this works.

const config = useRuntimeConfig();

// eslint-disable-next-line no-console
console.log('Plugin initialized');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

m: Let's avoid using a console.log here.

Also we should only log after we call init. Perhaps we use debug logger?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this log for testing reasons as long as this sdk is in development. But I'll remove it now to make sure I do not forget to remove it later 👍🏻

public: {
sentry: {
dsn: env.DSN,
// Additional config
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does options like beforeSend or adding custom integrations similar work here? If not, we need a solution for that.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now it looks like this works

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we'll need to also test that this works with importing stuff (e.g. import { httpClientIntegration } from '@sentry/nuxt'), but we can look at that in follow ups too! (just before we fully launch this)

@s1gr1d s1gr1d force-pushed the sig/nuxt-boilerplate branch from 7ba1162 to b65ba5d Compare June 20, 2024 13:46
@s1gr1d s1gr1d requested a review from chargome June 21, 2024 11:00
@s1gr1d s1gr1d merged commit 079a46b into develop Jun 21, 2024
113 checks passed
@s1gr1d s1gr1d deleted the sig/nuxt-boilerplate branch June 21, 2024 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: nuxt Issues related to the Sentry Nuxt SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Nuxt SDK package boilerplate
5 participants