Replace deprecated `_INTERNAL_flushLogsBuffer` with `flushLogsBuffer`

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

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
55/100
Issue 类型
重构
描述清晰度
描述清楚
活跃度
活跃
技术栈
react-native, typescript
领域
backend

调研方向

Start in packages/core/src/js/client.ts and inspect the three spies in packages/core/test/client.test.ts. First confirm that the required @sentry/core release exports flushLogsBuffer; then replace the old name in those locations and verify the client tests. Done means the client and test spies use the new export and the JS SDK team is told the alias is no longer used by RN.

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

描述

Next Major React-Native Task

Context

@sentry/core is dropping its _INTERNAL_-prefixed exports (getsentry/sentry-javascript#26744). _INTERNAL_flushLogsBuffer is renamed to flushLogsBuffer. The old name stays as a deprecated alias for now because React Native still uses it. The alias can't be removed until we switch.

This is the only _INTERNAL_ export from @sentry/core that the RN SDK uses.

⚠️ This will be implemented in the next major.

Usages

  • packages/core/src/js/client.ts: called on the client's flush event and from the idle timer after afterCaptureLog, when enableLogs is on.
  • packages/core/test/client.test.ts: three tests use jest.spyOn(SentryCore, '_INTERNAL_flushLogsBuffer'). The export name is a string here, so the type checker won't catch it. Rename these by hand.

Tasks

  • Bump @sentry/core to a release that exports flushLogsBuffer (getsentry/sentry-javascript#26744 merged and released).
  • Replace _INTERNAL_flushLogsBuffer with flushLogsBuffer in client.ts and the test spies.
  • Tell the JS SDK team the alias is no longer used by RN, so it can be removed.

Notes

  • Users won't see any change, and no changelog entry is needed. We can make the switch as soon as the new name is released, before the next major if that's convenient. It is tracked for the next major because the JS SDK can only drop the alias after we switch.
  • Related: #6969
主要语言
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 摘要。