Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(remix): Add wrapHandleErrorWithSentry #10370

Merged
merged 9 commits into from
Apr 26, 2024

Conversation

onurtemizkan
Copy link
Collaborator

Closes: #10212

  • Exports a new wrapper Sentry.wrapHandleErrorWithSentry for custom handleError implementations.
  • This runs the original handleError implementation, then runs the Sentry's capture logic.
  • This PR also renames wrapRemixHandleError to sentryHandleError, to avoid confusion. We're still exporting wrapRemixHandleError as alias.

Copy link
Contributor

github-actions bot commented Jan 26, 2024

size-limit report 📦

Path Size
@sentry/browser 21.64 KB (0%)
@sentry/browser (incl. Tracing) 32.68 KB (0%)
@sentry/browser (incl. Tracing, Replay) 68.03 KB (0%)
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 61.43 KB (0%)
@sentry/browser (incl. Tracing, Replay with Canvas) 72.07 KB (0%)
@sentry/browser (incl. Tracing, Replay, Feedback) 84.28 KB (0%)
@sentry/browser (incl. Feedback) 37.78 KB (0%)
@sentry/browser (incl. sendFeedback) 26.43 KB (0%)
@sentry/browser (incl. FeedbackAsync) 30.93 KB (0%)
@sentry/react 24.33 KB (0%)
@sentry/react (incl. Tracing) 35.64 KB (0%)
@sentry/vue 25.47 KB (0%)
@sentry/vue (incl. Tracing) 34.47 KB (0%)
@sentry/svelte 21.77 KB (0%)
CDN Bundle 23.95 KB (0%)
CDN Bundle (incl. Tracing) 33.98 KB (0%)
CDN Bundle (incl. Tracing, Replay) 67.67 KB (0%)
CDN Bundle (incl. Tracing, Replay, Feedback) 83.55 KB (0%)
CDN Bundle - uncompressed 70.58 KB (0%)
CDN Bundle (incl. Tracing) - uncompressed 100.94 KB (0%)
CDN Bundle (incl. Tracing, Replay) - uncompressed 210.55 KB (0%)
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 256.94 KB (0%)
@sentry/nextjs (client) 34.86 KB (0%)
@sentry/sveltekit (client) 33.24 KB (0%)
@sentry/node 138.47 KB (0%)

@onurtemizkan onurtemizkan marked this pull request as ready for review January 26, 2024 16:42
@@ -105,6 +105,26 @@ export function wrapRemixHandleError(err: unknown, { request }: DataFunctionArgs
});
}

// To be deprecated in favor of `sentryHandleError`
export const wrapRemixHandleError = sentryHandleError;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add a deprecated js doc to this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also realized if we are deprecating we need to add to MIGRATION.md

MIGRATION.md Outdated Show resolved Hide resolved
MIGRATION.md Outdated
This release deprecates `wrapRemixHandleError` in favor of using `sentryHandleError` from `@sentry/remix`. It can be
used as below:

````typescript
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
````typescript
```typescript

MIGRATION.md Outdated
@@ -324,7 +337,7 @@ typescript:

```ts
const replay = getClient().getIntegrationByName<Replay>('Replay');
```
````
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GitHub doesn't allow me to auto suggest this, but this should be ``` instead of ```` (3 instead of 4)

@onurtemizkan onurtemizkan force-pushed the onur/wrapHandleErrorWithSentry branch 4 times, most recently from 022dae4 to e7149f2 Compare February 22, 2024 11:00
@onurtemizkan onurtemizkan force-pushed the onur/wrapHandleErrorWithSentry branch from e7149f2 to b32c098 Compare March 12, 2024 16:45
@onurtemizkan onurtemizkan force-pushed the onur/wrapHandleErrorWithSentry branch from b32c098 to 818d411 Compare March 21, 2024 13:51
@onurtemizkan onurtemizkan force-pushed the onur/wrapHandleErrorWithSentry branch from 818d411 to 96d0f36 Compare April 1, 2024 15:59
Copy link

codecov bot commented Apr 1, 2024

Bundle Report

Changes will decrease total bundle size by 3.42MB ⬇️

Bundle name Size Change
@sentry/remix-cjs 54.41kB 789 bytes ⬆️
@sentry/remix-esm 48.86kB 627 bytes ⬆️
@sentry-internal/integration-shims-cjs (removed) 3.65kB ⬇️
@sentry/types-cjs (removed) 35 bytes ⬇️
@sentry/core-esm (removed) 236.82kB ⬇️
@sentry/utils-cjs (removed) 178.75kB ⬇️
@sentry/node-esm (removed) 333.56kB ⬇️
@sentry/types-esm (removed) 35 bytes ⬇️
@sentry-internal/replay-esm (removed) 306.46kB ⬇️
@sentry-internal/tracing-esm (removed) 107.26kB ⬇️
@sentry-internal/replay-canvas-cjs (removed) 29.51kB ⬇️
@sentry/vercel-edge-cjs (removed) 18.23kB ⬇️
@sentry/utils-esm (removed) 174.17kB ⬇️
@sentry/google-cloud-serverless-esm (removed) 19.16kB ⬇️
@sentry-internal/replay-cjs (removed) 306.35kB ⬇️
@sentry/core-cjs (removed) 240.44kB ⬇️
@sentry/node-cjs (removed) 336.97kB ⬇️
@sentry/aws-serverless-cjs (removed) 14.62kB ⬇️
@sentry-internal/integration-shims-esm (removed) 2.99kB ⬇️
@sentry/svelte-cjs (removed) 13.84kB ⬇️
@sentry/astro-cjs (removed) 27.13kB ⬇️
@sentry/vue-cjs (removed) 20.19kB ⬇️
@sentry/wasm-esm (removed) 4.85kB ⬇️
@sentry-internal/replay-canvas-esm (removed) 29.43kB ⬇️
@sentry-internal/node-integration-tests-cjs (removed) 1.04kB ⬇️
@sentry/svelte-esm (removed) 12.72kB ⬇️
@sentry-internal/node-integration-tests-esm (removed) 888 bytes ⬇️
@sentry-internal/feedback-cjs (removed) 65.81kB ⬇️
@sentry/browser-cjs (removed) 107.36kB ⬇️
@sentry/vercel-edge-esm (removed) 16.13kB ⬇️
@sentry/bun-cjs (removed) 13.5kB ⬇️
@sentry/opentelemetry-cjs (removed) 68.45kB ⬇️
@sentry/sveltekit-esm (removed) 61.08kB ⬇️
@sentry/react-esm (removed) 41.18kB ⬇️
@sentry/nextjs-cjs (removed) 20.52kB ⬇️
@sentry/nextjs-esm (removed) 20.02kB ⬇️
@sentry/bun-esm (removed) 10.05kB ⬇️
@sentry-internal/tracing-cjs (removed) 108.01kB ⬇️
@sentry-internal/feedback-esm (removed) 65.5kB ⬇️
@sentry/opentelemetry-esm (removed) 67.4kB ⬇️
@sentry/profiling-node-cjs (removed) 25.5kB ⬇️
@sentry/browser-esm (removed) 104.53kB ⬇️
@sentry/astro-esm (removed) 23.39kB ⬇️
@sentry/vue-esm (removed) 18.85kB ⬇️
@sentry/profiling-node-esm (removed) 25.52kB ⬇️
@sentry/google-cloud-serverless-cjs (removed) 23.0kB ⬇️
@sentry/wasm-cjs (removed) 5.2kB ⬇️
@sentry/react-cjs (removed) 45.04kB ⬇️
@sentry/sveltekit-cjs (removed) 69.31kB ⬇️
@sentry/gatsby-cjs (removed) 905 bytes ⬇️
@sentry/gatsby-esm (removed) 385 bytes ⬇️

@onurtemizkan onurtemizkan force-pushed the onur/wrapHandleErrorWithSentry branch from 96d0f36 to 58cd216 Compare April 5, 2024 10:11
@onurtemizkan onurtemizkan force-pushed the onur/wrapHandleErrorWithSentry branch from 58cd216 to 96ceab7 Compare April 23, 2024 14:48
@onurtemizkan onurtemizkan force-pushed the onur/wrapHandleErrorWithSentry branch from 96ceab7 to 34f57f5 Compare April 25, 2024 10:40
@AbhiPrasad AbhiPrasad enabled auto-merge (squash) April 26, 2024 15:06
@AbhiPrasad AbhiPrasad enabled auto-merge (squash) April 26, 2024 15:07
@AbhiPrasad AbhiPrasad merged commit 101c31b into develop Apr 26, 2024
70 checks passed
@AbhiPrasad AbhiPrasad deleted the onur/wrapHandleErrorWithSentry branch April 26, 2024 15:29
This pull request was closed.
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.

@sentry/remix: Incompatible type in wrapRemixHandleError
2 participants