Skip to content

Commit 78c3aee

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

File tree

3 files changed

+39
-46
lines changed

3 files changed

+39
-46
lines changed

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

Lines changed: 27 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -55,52 +55,17 @@ 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-
```
7460

75-
<Note>
61+
Also, wrap your Remix root with `withSentry` to catch React component errors (Remix v1) and routing transactions.
7662

77-
Learn more about <Link to="/platforms/node/performance/database/opt-in/#prisma-orm-integration">Sentry's Prisma integration </Link>.
63+
<Alert>
7864

79-
</Note>
80-
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.
82-
83-
<Alert level="info">
84-
85-
`wrapExpressCreateRequestHandler` is available starting with version 7.11.0.
65+
If you use the Remix `v2_errorBoundary` future flag, you need to configure a [v2 ErrorBoundary](#v2-errorboundary) in addition.
8666

8767
</Alert>
8868

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-
10469
```typescript {filename: root.tsx}
10570
import {
10671
Links,
@@ -149,6 +114,29 @@ withSentry(App, {
149114
});
150115
```
151116

117+
## Custom Express Server
118+
119+
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.
120+
121+
<Alert level="info">
122+
123+
`wrapExpressCreateRequestHandler` is available starting with version 7.11.0.
124+
125+
</Alert>
126+
127+
```typescript {filename: server/index.ts}
128+
import { wrapExpressCreateRequestHandler } from "@sentry/remix";
129+
import { createRequestHandler } from "@remix-run/express";
130+
131+
// ...
132+
133+
const createSentryRequestHandler =
134+
wrapExpressCreateRequestHandler(createRequestHandler);
135+
136+
// Use createSentryRequestHandler like you would with createRequestHandler
137+
app.all("*", createSentryRequestHandler(/* ... */));
138+
```
139+
152140
## Remix v2 features
153141

154142
_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)