Skip to content

v10.58.1

Choose a tag to compare

@sunnylqm sunnylqm released this 26 Sep 08:48
· 51 commits to master since this release
d599ec2

English

TypeScript fix for React Native 0.87

  • Fixed TypeScript errors in projects on React Native 0.87. The package ships its TypeScript source, so tsc in the app also checks this library, and skipLibCheck does not skip it. 10.58.0 failed there in three places:
    • client.ts:980 (AbortSignal in the update check): failed when the project also loads DOM-style fetch types, such as @types/bun.
    • setTimeout(resolve) in client.ts: RN 0.87 types the timer callback as taking no arguments.
    • global in core.ts: RN 0.87's typings no longer declare it.
  • Checked with tsc on React Native 0.87.1, react-native-tvos 0.87.1-1 and an Expo SDK 58 preview project (the template tsconfig, with types set to ["bun"] or ["jest", "node"], and with the DOM lib).
  • No runtime behavior changes. Upgrading the JS package is enough; no native rebuild is needed.

Full changelog

中文

React Native 0.87 的 TypeScript 修复

  • 修复在 React Native 0.87 工程中出现的 TypeScript 报错。本库以 TypeScript 源码发布,所以应用里运行 tsc 时也会检查本库,skipLibCheck 不会跳过它。10.58.0 在三处会报错:
    • client.ts:980(检查更新时的 AbortSignal):工程同时加载了 DOM 风格的 fetch 类型(例如 @types/bun)时报错。
    • client.ts 里的 setTimeout(resolve):RN 0.87 把定时器回调声明为不带参数。
    • core.ts 里的 global:RN 0.87 的类型声明里已经没有它了。
  • 已用 tsc 在 React Native 0.87.1、react-native-tvos 0.87.1-1 和 Expo SDK 58 预览版工程中验证(模板 tsconfig、types 设为 ["bun"] 或 ["jest", "node"]、使用 DOM lib)。
  • 没有运行时行为变化。只需升级 JS 包,不需要重新编译原生应用。

完整变更记录