-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
222b99c
commit 8dd1521
Showing
8 changed files
with
112 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
title: Solid | ||
sdk: sentry.javascript.browser | ||
sdk: sentry.javascript.solid | ||
categories: | ||
- browser |
34 changes: 34 additions & 0 deletions
34
docs/platforms/javascript/guides/solid/features/error-boundary.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
title: Solid Error Boundary | ||
description: "Learn how to wrap Solid error boundaries to automatically capture errors." | ||
--- | ||
|
||
The Solid SDK exports a function to wrap the native Solid error boundary component to automatically capture exceptions | ||
from inside a component tree and render a fallback component. | ||
|
||
Wrap the native Solid `ErrorBoundary` component with `Sentry.withSentryErrorBoundary`. | ||
|
||
<SignInNote /> | ||
|
||
```jsx | ||
import * as Sentry from "@sentry/solid"; | ||
import { ErrorBoundary } from "solid-js"; | ||
import App from "./app"; | ||
|
||
Sentry.init({ | ||
dsn: "__PUBLIC_DSN__", | ||
tracesSampleRate: 1.0, // Capture 100% of the transactions | ||
}); | ||
|
||
// Wrap Solid"s ErrorBoundary to automatically capture exceptions | ||
const SentryErrorBoundary = Sentry.withSentryErrorBoundary(ErrorBoundary); | ||
|
||
render( | ||
() => ( | ||
<SentryErrorBoundary fallback={err => <div>Error: {err.message}</div>}> | ||
<App /> | ||
</SentryErrorBoundary> | ||
), | ||
document.getElementById("root"), | ||
); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
title: Solid Features | ||
description: "Learn how Sentry's Solid SDK exposes features for first class integration with Solid." | ||
--- | ||
|
||
<Note> | ||
|
||
This SDK is considered **experimental and in an alpha state**. It may experience breaking changes. Please reach out on | ||
[GitHub](https://github.com/getsentry/sentry-javascript/issues/new/choose) if you have any feedback or concerns. This | ||
SDK currently only supports [Solid](https://www.solidjs.com/) and is not yet officially compatible with | ||
[Solid Start](https://start.solidjs.com/). | ||
|
||
</Note> | ||
|
||
The Sentry Solid SDK offers Solid-specific features for first class integration with the framework. | ||
|
||
<PageGrid /> |
49 changes: 49 additions & 0 deletions
49
docs/platforms/javascript/guides/solid/features/solid-router.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
--- | ||
title: Solid Router | ||
description: 'Learn about Sentry's Solid Router integration.' | ||
--- | ||
|
||
The Solid SDK provides a routing instrumentation for Solid Router to create navigation spans to ensure | ||
you collect meaningful performance data about the health of your page loads and associated requests. | ||
|
||
The routing instrumentation supports [Solid Router](https://docs.solidjs.com/solid-router) 0.13.0 and up. | ||
|
||
To get started, add `Sentry.solidRouterBrowserTracingIntegration` instead of the regular `Sentry.browserTracingIntegration` | ||
and provide the hooks it needs to enable performance tracing: | ||
|
||
`useBeforeLeave` from `@solidjs/router` | ||
`useLocation` from `@solidjs/router` | ||
|
||
Make sure `Sentry.solidRouterBrowserTracingIntegration` is initialized by your `Sentry.init` call, before you wrap | ||
`Router`. Otherwise, the routing instrumentation may not work properly. | ||
|
||
Wrap `Router`, `MemoryRouter` or `HashRouter` from `@solidjs/router` using `Sentry.withSentryRouterRouting`. This | ||
creates a higher order component, which will enable Sentry to reach your router context. | ||
|
||
<SignInNote /> | ||
|
||
```jsx | ||
import * as Sentry from "@sentry/solid"; | ||
import { Route, Router, useBeforeLeave, useLocation } from "@solidjs/router"; | ||
import { render } from "solid-js/web"; | ||
import App from "./app"; | ||
|
||
Sentry.init({ | ||
dsn: "__PUBLIC_DSN__", | ||
integrations: [Sentry.solidRouterBrowserTracingIntegration({ useBeforeLeave, useLocation })], | ||
tracesSampleRate: 1.0, // Capture 100% of the transactions | ||
}); | ||
|
||
// Wrap Solid Router to collect meaningful performance data on route changes | ||
const SentryRouter = Sentry.withSentryRouterRouting(Router); | ||
|
||
render( | ||
() => ( | ||
<SentryRouter> | ||
<Route path="/" component={App} /> | ||
... | ||
</SentryRouter> | ||
), | ||
document.getElementById("root"), | ||
); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
platform-includes/getting-started-install/javascript.solid.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
```bash {tabTitle:npm} | ||
npm install --save @sentry/browser | ||
npm install --save @sentry/solid | ||
``` | ||
|
||
```bash {tabTitle:Yarn} | ||
yarn add @sentry/browser | ||
yarn add @sentry/solid | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters