autoWrapExpoRouterErrorBoundary is opt-in but could be the default

未关闭
#6,738 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
45/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
react-native, typescript

调研方向

Start in packages/core/src/js/tools/metroconfig.ts and trace autoWrapExpoRouterErrorBoundary through withSentryConfig and getSentryExpoConfig. Validate the Babel rewrite against the supported Expo Router versions and route layouts, including aliased exports and existing imports. Done means a decided default for the next major version, with an escape hatch if needed, plus coverage for the validated structures.

由索引模型根据 Issue 内容生成。

描述

Breaking Change Next Major React-Native

autoWrapExpoRouterErrorBoundary (in withSentryConfig/getSentryExpoConfig, packages/core/src/js/tools/metroconfig.ts) auto-wraps Expo Router's per-route ErrorBoundary re-exports with Sentry.wrapExpoRouterErrorBoundary at build time, so render-phase errors that hit the fallback get captured without the user touching their route files.

It currently defaults to false (getsentry/sentry-react-native#6347), so Expo Router users only get this error capture if they know the option exists and opt in explicitly:

module.exports = getSentryExpoConfig(__dirname, {
  autoWrapExpoRouterErrorBoundary: true,
});

Since the whole point is capturing errors users wouldn't otherwise think to instrument, most Expo Router apps are silently missing this coverage. Worth considering flipping the default to true in the next major version.

Needs scoping before landing:

  • Confirm the babel rewrite (detecting export { ErrorBoundary } from 'expo-router' and aliased variants) is safe to apply unconditionally across the range of Expo Router versions/route layouts we support - it already skips files that already import wrapExpoRouterErrorBoundary, but should be validated against a wider set of real app structures.
  • Decide whether this should ship default-on directly in 9.0, or default-on with an escape hatch (autoWrapExpoRouterErrorBoundary: false) for a deprecation cycle.
主要语言
TypeScript
星标
1.8k
派生
371
平均合并
22 小时 3 分钟
30 天内合并 PR
106

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

getsentry/sentry-react-native 的其他 Issue

查看 getsentry/sentry-react-native 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。