upgrading-react-native

编排React Native版本升级,包含模板差异、依赖解析和原生平台迁移。应用规范的rn-diff-purge模板差异,使原生iOS和Android配置与目标React Native版本对齐。处理package.json依赖更新、CocoaPods和Gradle变更,以及跨主次版本升级的破坏性API迁移。包含托管Expo项目的Expo SDK升级层和升级后验证清单。提供...

npx skills add https://github.com/callstackincubator/agent-skills --skill upgrading-react-native

Upgrading React Native

Overview

Covers the full React Native upgrade workflow: template diffs via Upgrade Helper, dependency updates, Expo SDK steps, and common pitfalls.

Typical Upgrade Sequence

  1. Route: Choose the right upgrade path via upgrading-react-native.md
  2. Diff: Fetch the canonical template diff using Upgrade Helper via upgrade-helper-core.md
  3. Dependencies: Assess and update third-party packages via upgrading-dependencies.md
  4. React: Align React version if upgraded via react.md
  5. Expo (if applicable): Apply Expo SDK layer via expo-sdk-upgrade.md
  6. Verify: Run post-upgrade checks via upgrade-verification.md
# Quick start: detect current version and fetch diff
npm pkg get dependencies.react-native --prefix "$APP_DIR"
npm view react-native dist-tags.latest

# Example: upgrading from 0.76.9 to 0.78.2
# 1. Fetch the template diff
curl -L -f -o /tmp/rn-diff.diff \
  "https://raw.githubusercontent.com/react-native-community/rn-diff-purge/diffs/diffs/0.76.9..0.78.2.diff" \
  && echo "Diff downloaded OK" || echo "ERROR: diff not found, check versions"
# 2. Review changed files
grep -n "^diff --git" /tmp/rn-diff.diff
# 3. Update package.json, apply native changes, then install + rebuild
npm install --prefix "$APP_DIR"
cd "$APP_DIR/ios" && pod install
# 4. Validate: both platforms must build successfully
npx react-native build-android --mode debug --no-packager
xcodebuild -workspace "$APP_DIR/ios/App.xcworkspace" -scheme App -sdk iphonesimulator build

When to Apply

Reference these guidelines when:

  • Moving a React Native app to a newer version
  • Reconciling native config changes from Upgrade Helper
  • Validating release notes for breaking changes

Quick Reference

FileDescription
upgrading-react-native.mdRouter: choose the right upgrade path
upgrade-helper-core.mdCore Upgrade Helper workflow and reliability gates
upgrading-dependencies.mdDependency compatibility checks and migration planning
react.mdReact and React 19 upgrade alignment rules
expo-sdk-upgrade.mdExpo SDK-specific upgrade layer (conditional)
upgrade-verification.mdPost-upgrade verification checklist, including agent-device-assisted checks
monorepo-singlerepo-targeting.mdMonorepo and single-repo app targeting and command scoping

Problem → Skill Mapping

ProblemStart With
Need to upgrade React Nativeupgrade-helper-core.md
Need dependency risk triage and migration optionsupgrading-dependencies.md
Need React/React 19 package alignmentreact.md
Need workflow routing firstupgrading-react-native.md
Need Expo SDK-specific stepsexpo-sdk-upgrade.md
Need manual or agent-assisted regression validationupgrade-verification.md
Need repo/app command scopingmonorepo-singlerepo-targeting.md

来自 callstackincubator 的更多技能

agent-device
callstackincubator
通过基于快照的界面发现和选择器驱动的回放,自动化iOS和Android应用交互。支持iOS模拟器/设备和Android模拟器/设备,具备会话绑定自动化、多租户远程守护进程模式以及面向QA工作流的设备级隔离。核心命令包括:用于UI发现及元素引用的snapshot、用于交互操作的press/fill/scroll、用于应用生命周期管理的open/close、以及用于二进制部署的install/reinstall。附带日志记录、网络检查等实用工具……
official
dogfood
callstackincubator
系统性地在iOS/Android上使用agent-device探索和测试移动应用,以发现漏洞、用户体验问题及其他问题。在需要内部测试、质量保证等场景下使用。
official
react-devtools
callstackincubator
从agent-device检查和剖析React Native组件树。用于React Native性能、分析、属性、状态、钩子、渲染原因、缓慢…
official
react-devtools
callstackincubator
React DevTools CLI,供AI代理使用。当用户要求你在运行时调试React或React Native应用、检查组件属性/状态/钩子、诊断……时使用。
official
github
callstackincubator
通过gh CLI实现GitHub工作流自动化,涵盖拉取请求、堆叠式PR及仓库管理。提供堆叠式PR合并工作流:对首个PR进行压缩合并,随后对链中每个后续PR执行变基并更新基础分支。包含冲突检测与手动解决提示,防止多PR合并期间出现静默失败。覆盖gh CLI核心操作:PR创建、状态检查、压缩/变基合并及分支管理。通过依赖gh CLI优化低上下文使用场景...
official
github-actions
callstackincubator
适用于React Native iOS模拟器和Android模拟器云端构建的GitHub Actions工作流模式,支持可下载的构建产物。用于配置CI构建…
official
react-native-best-practices
callstackincubator
面向React Native应用的结构化性能优化参考,涵盖FPS、包体积、TTI和内存。包含9份JavaScript/React指南(性能分析、列表、动画、内存)、9份原生优化指南(Turbo Modules、线程、性能分析)和9份打包指南(摇树优化、代码拆分、体积分析)。每份参考采用混合格式,包含快速模式/命令、影响评级(关键/高/中)以及深度解析说明(含前置条件和常见...)
official
react-native-brownfield-migration
callstackincubator
提供一种增量采用策略,用于将原生 iOS 或 Android 应用迁移到 React Native 或 Expo,并使用 @callstack/react-native-brownfield 进行初始…
official