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

feat(solid): Remove need to pass router hooks to solid integration #12617

Merged
merged 5 commits into from
Jun 25, 2024

Conversation

andreiborza
Copy link
Member

⚠️ This PR introduces breaking changes to @sentry/solid⚠️

Previously, we had to pass useBeforeLeave and useLocation to solidRouterBrowserTracingIntegration. This has now been removed in favor of importing the router hooks directly within the sdk as needed.

Import solidRouterBrowserTracingIntegration from @sentry/solid/solidrouter and add it to Sentry.init:

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);

As a result, the SDK has an optional peer dependency on @solidjs/router v0.13.4+ when using solidRouterBrowserTracingIntegration.

Note to maintainers
This package outputs types at the build root instead of build/types to better support projects that don't use moduleResolution: "bundler".

@andreiborza andreiborza force-pushed the ab/solid-remove-router-hooks-passing branch from 1dd6a6d to f2e8773 Compare June 24, 2024 13:43
Copy link
Contributor

github-actions bot commented Jun 24, 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.76 KB (0%)
@sentry/browser (incl. Tracing, Replay, Feedback, metrics) 87.62 KB (0%)
@sentry/browser (incl. metrics) 26.5 KB (0%)
@sentry/browser (incl. Feedback) 38.87 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.27 KB (-0.01% 🔽)
@sentry/node - without tracing 90.65 KB (+0.01% 🔺)
@sentry/aws-serverless 99.74 KB (0%)

CHANGELOG.md Outdated Show resolved Hide resolved
Co-authored-by: Francesco Novy <francesco.novy@sentry.io>
@andreiborza andreiborza marked this pull request as ready for review June 25, 2024 07:12
@andreiborza andreiborza requested a review from lforst June 25, 2024 07:12
"exports": {
"./package.json": "./package.json",
".": {
"import": {
"types": "./build/types/index.d.ts",
"default": "./build/esm/index.js"
"default": "./build/esm/index.js",
Copy link
Member

Choose a reason for hiding this comment

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

This has to be the other way around, see #12404 - is there a reason you reordered this? types should always come first!

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated, thanks!

Copy link
Member

@lforst lforst left a comment

Choose a reason for hiding this comment

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

Very nice!

CHANGELOG.md Outdated Show resolved Hide resolved
andreiborza and others added 2 commits June 25, 2024 09:17
Co-authored-by: Luca Forstner <luca.forstner@sentry.io>
@andreiborza andreiborza requested a review from mydea June 25, 2024 07:22
Copy link
Member

@mydea mydea left a comment

Choose a reason for hiding this comment

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

great work! much better DX! ❤️

@andreiborza andreiborza merged commit dd4a7d7 into develop Jun 25, 2024
113 checks passed
@andreiborza andreiborza deleted the ab/solid-remove-router-hooks-passing branch June 25, 2024 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants