计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
mobile-rn-performance【效率与协作】Fix React Native / Expo performance, build, and upgrade issues: jank, slow startup, large bundles, memory leaks, Hermes, FlashList, Reanimated, Turbo Modules, 16KB alignment, SDK upgrades.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
name: mobile-rn-performance description: > Fix React Native / Expo performance, build, and upgrade issues: jank, slow startup, large bundles, memory leaks, Hermes, FlashList, Reanimated, Turbo Modules, 16KB alignment, SDK upgrades. license: MIT paths:
Degree of freedom: MIXED. Which category and fix [HIGH freedom]; measure
before/after, 16KB alignment, and upgrade-helper diffs
[LOW freedom — run exactly].
The performance, bundling, and upgrade layer for React Native / Expo.
mobile-rn-screenhandles screen layout and native feel; this skill handles speed, size, and version moves.Distilled from Callstack's React Native best-practices skill (MIT) and the Ultimate Guide to RN Optimization.
Measure: feed scroll drops to 38fps; React profiler shows every row re-rendering. Category: FPS & re-renders — not "add memo everywhere". Fix:
FlashList+ stablekeyExtractor; animation stays on Reanimated shared values. Re-measure: 56fps on a low-end Android; no new storm on the changed screen.
mobile-rn-screen; on-device walk → mobile-emulator-test; hybrid axes → enhance-capacitor-uiNever optimize blind. Identify the symptom, then apply the matching category. Measure before/after.
| Symptom | Category | Impact |
|---|---|---|
| Janky scroll/animation, dropped frames | FPS & re-renders | CRITICAL |
| Large download / install size | Bundle size | CRITICAL |
| Slow cold start (high TTI) | TTI / startup | HIGH |
| Slow native operations | Native performance | HIGH |
| Memory grows over time / crashes | Memory management | MED-HIGH |
| Choppy gestures/transitions | Animations | MEDIUM |
React.memo, useMemo, useCallback — but only where a profile shows wasted renders (over-memoization adds its own cost).FlatList is fine (stable keyExtractor, memoized renderItem, getItemLayout for fixed heights). Beyond that, or with images or blank cells on fling, use @shopify/flash-list v2: New Architecture only, no estimatedItemSize, getItemType for mixed rows, and drop removeClippedSubviews/windowSize. On the old architecture stay on FlashList v1 with estimatedItemSize. @legendapp/list is the Fabric-only option for chat and media feeds (recycleItems, maintainScrollAtEnd). A FlatList re-render storm is the #1 RN list perf bug.react-native-reanimated on the UI thread (useSharedValue / useAnimatedStyle / worklets). Never drive continuous animation through setState — it re-renders the tree every frame and collapses FPS.react-native-worklets (peer dependency; import runOnUI/runOnJS from it) and adds CSS-style transitionProperty / animationName on Animated.View; shared-value code from 3.x keeps working. Gesture-linked motion stays in react-native-gesture-handler worklets.Animated when staying on the core API.android/, ios/, Podfile, Gradle) deliberately — these are where upgrades break.expo install --fix; align all expo-* and third-party native deps to the SDK's supported ranges.watchman watch-del, Metro cache, Pods, Gradle), rebuild, and smoke-test on both platforms via mobile-emulator-test.enhance-mobile-native-feel — app-wide chrome, lists, motion, haptics when the UI itself is web-shaped.mobile-rn-screen — layout, safe-area, touch-target, native feel.mobile-emulator-start / mobile-emulator-test — boot + on-device verification.workflow-spec-tdd — spec + test the perf fix so it doesn't regress.enhance-capacitor-ui — if the app is hybrid rather than bare RN, the axis architecture differs.