-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(remix): Wrap root with ErrorBoundary
.
#5365
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
Conversation
@@ -135,5 +137,5 @@ export function withSentryRouteTracing<P extends Record<string, unknown>, R exte | |||
|
|||
// @ts-ignore Setting more specific React Component typing for `R` generic above | |||
// will break advanced type inference done by react router params | |||
return SentryRoot; | |||
return withErrorBoundary(SentryRoot); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We’ll need to make sure users can supply errorboundary options, so things like fallback can be configured. We can pass it in as an option?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing to note is what we do if someone doesn’t want an error boundary here.
packages/remix/README.md
Outdated
@@ -71,24 +71,22 @@ import { | |||
ScrollRestoration, | |||
} from "@remix-run/react"; | |||
|
|||
import { ErrorBoundary, withSentryRouteTracing } from "@sentry/remix"; | |||
import { withSentryRouteTracing } from "@sentry/remix"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can keep withSentryRouteTracing
export, deprecate it, and then export withSentry
@AbhiPrasad, updated with the options and a toggle. It requires #5371 to work. |
packages/remix/README.md
Outdated
); | ||
} | ||
|
||
export default withSentryRouteTracing(App); | ||
export default withSentryRouteTracing(App, { | ||
wrapWithErrorBoundary: false // default: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrapWithErrorBoundary: false // default: true |
We shouldn't have the docs saying that it's disabled. We can just leave a note that they can use the wrapWithErrorBoundary
to disable if needed.
3e05280
to
5704702
Compare
Let's rename to |
341cd65
to
0a59239
Compare
@onurtemizkan, as we are moving to We don't have to worry about backwards compatibility here yet. We are in alpha versions and breaking changes are expected. |
Ref: #4894
Wraps the Remix root with
ErrorBoundary
while wrapping it with the router instrumentation.withSentryRouteTracing
can be renamed to something likewithSentry
from this point, but it is a breaking change, so I left it out.