Skip to content

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

Merged
andreiborza merged 5 commits intodevelopfrom
ab/solid-remove-router-hooks-passing
Jun 25, 2024
Merged

feat(solid): Remove need to pass router hooks to solid integration#12617
andreiborza merged 5 commits intodevelopfrom
ab/solid-remove-router-hooks-passing

Conversation

@andreiborza
Copy link
Copy Markdown
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".

Loading
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