Skip to content

Commit e9d3272

Browse files
inventarSarahchargomeonurtemizkan
authored
docs(js): Update Remix on Cloudflare quick start guide (#14873)
<!-- Use this checklist to make sure your PR is ready for merge. You may delete any sections you don't need. --> ## DESCRIBE YOUR PR Updated the Remix on Cloudflare quick start guide to follow our template. The main Remix quick start guide (manual setup) page and the Remix on Cloudflare quick start guide page share the same file/content. We did this for Nuxt/SvelteKit on Cloudflare too -> you can read more about it #14679 Closes: #14845 ## IS YOUR CHANGE URGENT? Help us prioritize incoming PRs by letting us know when the change needs to go live. - [ ] Urgent deadline (GA date, etc.): <!-- ENTER DATE HERE --> - [ ] Other deadline: <!-- ENTER DATE HERE --> - [x] None: Not urgent, can wait up to 1 week+ ## SLA - Teamwork makes the dream work, so please add a reviewer to your PRs. - Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it. Thanks in advance for your help! ## PRE-MERGE CHECKLIST *Make sure you've checked the following before merging your changes:* - [ ] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs) ## EXTRA RESOURCES - [Sentry Docs contributor guide](https://docs.sentry.io/contributing/) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Unifies Remix and Remix on Cloudflare docs by introducing a shared getting-started include and updating both pages to reference it. > > - **Docs structure (Remix/Cloudflare)**: > - **New shared include**: Add `platform-includes/getting-started-complete/javascript.remix.mdx` with full setup (client, server, Cloudflare middleware, source maps, verification, next steps). > - **Remix manual setup**: Replace detailed content in `docs/platforms/javascript/guides/remix/manual-setup.mdx` with `getting-started-complete` include. > - **Remix on Cloudflare**: Replace bespoke instructions in `docs/platforms/javascript/guides/cloudflare/frameworks/remix.mdx` with the same include and update description. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit eed0186. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Charly Gomez <[email protected]> Co-authored-by: Onur Temizkan <[email protected]>
1 parent 044f7a3 commit e9d3272

File tree

5 files changed

+460
-416
lines changed

5 files changed

+460
-416
lines changed

docs/platforms/javascript/guides/cloudflare/frameworks/hydrogen-remix.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ export default Sentry.withSentry(App, useEffect, useLocation, useMatches);
9999
Finally, update your `entry.client.tsx` file to initialize Sentry SDK on the client:
100100

101101
```tsx {filename:app/entry.client.tsx}
102-
import * as Sentry from "@sentry/remix";
102+
import * as Sentry from "@sentry/remix/cloudflare";
103+
import { useEffect } from "react";
104+
import { useLocation, useMatches } from "@remix-run/react";
103105

104106
Sentry.init({
105107
dsn: "___PUBLIC_DSN___",

docs/platforms/javascript/guides/cloudflare/frameworks/nuxt.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Nuxt on Cloudflare
3-
description: "Learn how to instrument your Nuxt app on Cloudflare Workers and Pages and capture your first errors with Sentry. "
3+
description: "Learn how to instrument your Nuxt app on Cloudflare Workers and Pages and capture your first errors with Sentry."
44
---
55

66
This guide will show you how to set up the SDK with Nitro's `cloudflare_module` (or their deprecated `cloudflare-pages`) deployment preset.
Lines changed: 5 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,9 @@
11
---
22
title: Remix on Cloudflare
3-
description: "Learn how to add Cloudflare instrumentation to your Remix app."
3+
description: "Learn how to instrument your Remix app on Cloudflare Workers and Pages and capture your first errors with Sentry."
44
---
55

6-
If you're running your Remix app on Cloudflare Pages, you can use the Sentry Remix SDK in combination with the Sentry Cloudflare SDK to add Sentry instrumentation.
7-
8-
## Install
9-
10-
First, install the Sentry Remix SDK in your application. We recommend using the Sentry wizard to automatically install the SDK:
11-
12-
```bash
13-
npx @sentry/wizard@latest -i remix
14-
```
15-
16-
If the setup through the wizard doesn't work for you, you can also [set up the Remix SDK manually](/platforms/javascript/guides/remix/manual-setup/).
17-
18-
After installing the Sentry Remix SDK, delete the newly generated `instrumentation.server.mjs` file. This instrumentation is not needed when using the Cloudflare SDK.
19-
20-
Now you can install the Sentry Cloudflare SDK. First, install the SDK with your package manager:
21-
22-
<PlatformContent includePath="getting-started-install" />
23-
24-
## Setup
25-
26-
The main Sentry configuration should happen as early as possible in your app's lifecycle.
27-
28-
<PlatformContent includePath="getting-started-config" />
29-
30-
Then create a `_middleware.js` file in your `functions` directory and add the following code:
31-
32-
```javascript {filename:functions/_middleware.js}
33-
import * as Sentry from "@sentry/cloudflare";
34-
35-
export const onRequest = [
36-
// Make sure Sentry is the first middleware
37-
Sentry.sentryPagesPlugin((context) => ({
38-
dsn: "___PUBLIC_DSN___",
39-
// Set tracesSampleRate to 1.0 to capture 100% of spans for tracing.
40-
tracesSampleRate: 1.0,
41-
})),
42-
// Add more middlewares here
43-
];
44-
```
6+
<PlatformContent
7+
includePath="getting-started-complete"
8+
platform="javascript.remix"
9+
/>

0 commit comments

Comments
 (0)