Skip to content

Commit 6451095

Browse files
committed
Streamline Remix Getting Started Page
1 parent df9bc80 commit 6451095

File tree

3 files changed

+39
-47
lines changed

3 files changed

+39
-47
lines changed

src/platform-includes/getting-started-config/javascript.remix.mdx

Lines changed: 27 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -55,52 +55,16 @@ Sentry.init({
5555
});
5656
```
5757

58-
Initialize Sentry in your entry point for the server to capture exceptions and get performance metrics for your [`action`](https://remix.run/docs/en/v1/api/conventions#action) and [`loader`](https://remix.run/docs/en/v1/api/conventions#loader) functions. You can also initialize Sentry's database integrations, such as Prisma, to get spans for your database calls.
58+
Initialize Sentry in your entry point for the server to capture exceptions and get performance metrics for your [`action`](https://remix.run/docs/en/v1/api/conventions#action) and [`loader`](https://remix.run/docs/en/v1/api/conventions#loader) functions. You can also initialize Sentry's database integrations, such as <Link to="/platforms/node/performance/database/opt-in/#prisma-orm-integration">Prisma</Link>, to get spans for your database calls.
5959

60-
<SignInNote />
61-
62-
```typescript {filename: entry.server.tsx}
63-
import { prisma } from "~/db.server";
64-
65-
import * as Sentry from "@sentry/remix";
66-
67-
Sentry.init({
68-
dsn: "___PUBLIC_DSN___",
69-
tracesSampleRate: 1,
70-
integrations: [new Sentry.Integrations.Prisma({ client: prisma })],
71-
// ...
72-
});
73-
```
74-
75-
<Note>
76-
77-
Learn more about <Link to="/platforms/node/performance/database/opt-in/#prisma-orm-integration">Sentry's Prisma integration </Link>.
78-
79-
</Note>
60+
Also, wrap your Remix root with `withSentry` to catch React component errors (Remix v1) and routing transactions.
8061

81-
If you use a custom Express server in your Remix application, you should wrap your [`createRequestHandler` function](https://remix.run/docs/en/v1/other-api/adapter#createrequesthandler) manually with `wrapExpressCreateRequestHandler`. This is not required if you use the built-in Remix App Server.
62+
<Alert>
8263

83-
<Alert level="info">
84-
85-
`wrapExpressCreateRequestHandler` is available starting with version 7.11.0.
64+
If you use the Remix `v2_errorBoundary` future flag, you need to configure a [v2 ErrorBoundary](#v2-errorboundary) in addition.
8665

8766
</Alert>
8867

89-
```typescript {filename: server/index.ts}
90-
import { wrapExpressCreateRequestHandler } from "@sentry/remix";
91-
import { createRequestHandler } from "@remix-run/express";
92-
93-
// ...
94-
95-
const createSentryRequestHandler =
96-
wrapExpressCreateRequestHandler(createRequestHandler);
97-
98-
// Use createSentryRequestHandler like you would with createRequestHandler
99-
app.all("*", createSentryRequestHandler(/* ... */));
100-
```
101-
102-
Also, wrap your Remix root with `withSentry` to catch React component errors (Remix v1) and routing transactions. If you use the Remix `v2_errorBoundary` future flag, you need to configure a [v2 ErrorBoundary](#v2-errorboundary) in addition.
103-
10468
```typescript {filename: root.tsx}
10569
import {
10670
Links,
@@ -149,6 +113,29 @@ withSentry(App, {
149113
});
150114
```
151115

116+
## Custom Express Server
117+
118+
If you use a custom Express server in your Remix application, you should wrap your [`createRequestHandler` function](https://remix.run/docs/en/v1/other-api/adapter#createrequesthandler) manually with `wrapExpressCreateRequestHandler`. This is not required if you use the built-in Remix App Server.
119+
120+
<Alert level="info">
121+
122+
`wrapExpressCreateRequestHandler` is available starting with version 7.11.0.
123+
124+
</Alert>
125+
126+
```typescript {filename: server/index.ts}
127+
import { wrapExpressCreateRequestHandler } from "@sentry/remix";
128+
import { createRequestHandler } from "@remix-run/express";
129+
130+
// ...
131+
132+
const createSentryRequestHandler =
133+
wrapExpressCreateRequestHandler(createRequestHandler);
134+
135+
// Use createSentryRequestHandler like you would with createRequestHandler
136+
app.all("*", createSentryRequestHandler(/* ... */));
137+
```
138+
152139
## Remix v2 features
153140

154141
_Available from SDK version 7.59.0_

src/platform-includes/getting-started-primer/javascript.remix.mdx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@ Sentry's Remix SDK enables automatic reporting of errors and exceptions, as well
44

55
</Note>
66

7-
## Features Overview
7+
Under the hood, Remix SDK relies on our [React SDK](/platforms/javascript/guides/react/) on the frontend and [Node SDK](/platforms/node) on the backend, which makes all features available in those SDKs also available in this SDK.
88

9-
- [Error Tracking](/product/issues/) with source maps for both JavaScript and TypeScript
10-
- Events [enriched](/platforms/javascript/guides/remix/enriching-events/context/) with device data
11-
- [Breadcrumbs](/platforms/javascript/guides/remix/enriching-events/breadcrumbs/) created for outgoing HTTP request with XHR and Fetch, and console logs
12-
- [Release health](/product/releases/health/) for tracking crash-free users and sessions
13-
- [Performance Monitoring](/product/performance/) for both the client and server
9+
<Alert title='Non-Node Support' level='warning'>
1410

15-
Under the hood, Remix SDK relies on our [React SDK](/platforms/javascript/guides/react/) on the frontend and [Node SDK](/platforms/node) on the backend, which makes all features available in those SDKs also available in this SDK.
11+
Sentry's Remix SDK does not officially support adapters that use non-Node runtimes, such as Cloudflare Workers.
12+
13+
</Alert>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
## Add Readable Stack Traces to Errors
2+
3+
The Remix SDK provides a script that automatically creates a release and uploads sourcemaps. To generate sourcemaps with Remix, you need to call remix build with the `--sourcemap` option.
4+
5+
On release, call `sentry-upload-sourcemaps` to upload source maps and create a release. To see more details on how to use the command, call `sentry-upload-sourcemaps --help`.
6+
7+
For more advanced configuration, you can use [`sentry-cli`](https://github.com/getsentry/sentry-cli) directly to upload sourcemaps.

0 commit comments

Comments
 (0)