zereight-react-native-optimizer
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesezereight-react-native-optimizer
zereight-react-native-optimizer
Focused on performance correctness during code review.
The goal is not to teach optimization — it is to catch regressions before they ship.
专注于代码审查过程中的性能正确性。
其目标不是讲授优化方法,而是在问题上线前捕获性能回归。
When to use
适用场景
Use alongside when:
zereight-review- Reviewing React Native or Expo PRs
- Auditing list, animation, or native module changes
- Checking screen transitions or gesture interactions
Not a replacement for or — those explain how to optimize. This skill detects what went wrong in a diff.
react-native-best-practicesvercel-react-native-skills与搭配使用,适用于以下场景:
zereight-review- 审查React Native或Expo PR
- 审计列表、动画或原生模块改动
- 检查页面转场或手势交互
它并非或的替代品——后者会讲解如何优化,本工具则用于检测代码diff中存在的问题。
react-native-best-practicesvercel-react-native-skillsPrerequisites
前置依赖
The following skills provide the full optimization context this skill references:
- (callstackincubator)
react-native-best-practices - (vercel-labs)
vercel-react-native-skills - (pluginagentmarketplace)
react-native-animations - (callstackincubator)
react-native-best-practices - (callstackincubator)
agent-device
以下skill提供了本工具引用的完整优化上下文:
- (callstackincubator)
react-native-best-practices - (vercel-labs)
vercel-react-native-skills - (pluginagentmarketplace)
react-native-animations - (callstackincubator)
react-native-best-practices - (callstackincubator)
agent-device
Priority order
优先级排序
- Animation on JS thread (causes visible jank — always 🟠 Major or higher)
- List rendering with FlatList instead of FlashList for large datasets
- Unnecessary re-renders in hot paths (list items, animated components)
- Memory leaks (listeners, subscriptions not cleaned up)
- Bridge overuse (synchronous calls, large payloads)
- Bundle size regressions
- Image loading / caching issues
- JS线程上运行的动画(会导致可见卡顿——始终标记为🟠严重或更高等级)
- 大数据集下使用FlatList而非FlashList做列表渲染
- 热点路径(列表项、动画组件)存在不必要重渲染
- 内存泄漏(监听器、订阅未清理)
- Bridge过度使用(同步调用、大载荷传输)
- 包体积回归
- 图片加载/缓存问题
Rendering checks
渲染检查
Run on every component change. See for detail.
references/rendering.md| Pattern | Severity |
|---|---|
| FlatList used for list with 50+ items | 🛠️ 🟠 Major |
| ⚠️ 🟡 Minor |
| Inline function/object passed as prop to memoized child | 🛠️ 🟡 Minor |
| ⚠️ 🟡 Minor |
| Context provider too high — causes full subtree re-render | ⚠️ 🟠 Major |
| 🛠️ 🔵 Trivial |
Missing | 🛠️ 🔵 Trivial |
| 🛠️ 🟡 Minor |
每次组件改动时运行,详情可查看。
references/rendering.md| 问题模式 | 严重等级 |
|---|---|
| 包含50+条数据的列表使用FlatList实现 | 🛠️ 🟠 严重 |
| ⚠️ 🟡 次要 |
| 向被memo包裹的子组件传递内联函数/对象作为属性 | 🛠️ 🟡 次要 |
| ⚠️ 🟡 次要 |
| Context provider层级过高——导致整个子树重渲染 | ⚠️ 🟠 严重 |
| 🛠️ 🔵 轻微 |
传递给子组件的事件处理器缺少 | 🛠️ 🔵 轻微 |
| 🛠️ 🟡 次要 |
Animation checks
动画检查
Run when animation, gesture, or transition code is changed. See for detail.
references/animation.md| Pattern | Severity |
|---|---|
| 🛠️ 🟠 Major |
Animation drives style via | ⚠️ 🟠 Major |
Worklet function accesses JS-side state directly (no | ⚠️ 🟠 Major |
| ⚠️ 🟡 Minor |
Touch handled with | 🛠️ 🟡 Minor |
| 🛠️ 🔵 Trivial |
| Animation not cancelled on unmount | ⚠️ 🟡 Minor |
当动画、手势或转场代码改动时运行,详情可查看。
references/animation.md| 问题模式 | 严重等级 |
|---|---|
使用旧版API | 🛠️ 🟠 严重 |
动画通过 | ⚠️ 🟠 严重 |
Worklet函数直接访问JS侧状态(未使用 | ⚠️ 🟠 严重 |
| ⚠️ 🟡 次要 |
动画场景下使用 | 🛠️ 🟡 次要 |
使用 | 🛠️ 🔵 轻微 |
| 组件卸载时未取消动画 | ⚠️ 🟡 次要 |
Native / bridge checks
原生/Bridge检查
Run when native modules, images, or bundle changes are involved. See for detail.
references/native.md| Pattern | Severity |
|---|---|
| Event listener / subscription not removed in cleanup | ⚠️ 🟠 Major |
| ⚠️ 🟠 Major |
| Large object passed over bridge (>10KB) | ⚠️ 🟡 Minor |
Image loaded without | 🛠️ 🟡 Minor |
| Image source is remote URL without caching strategy | 🛠️ 🟡 Minor |
| New dependency added without checking bundle size impact | ⚪ Info |
| 🧹 🔵 Trivial |
当涉及原生模块、图片或包改动时运行,详情可查看。
references/native.md| 问题模式 | 严重等级 |
|---|---|
| 事件监听器/订阅未在清理阶段移除 | ⚠️ 🟠 严重 |
在渲染路径中同步调用 | ⚠️ 🟠 严重 |
| 通过Bridge传输大于10KB的大型对象 | ⚠️ 🟡 次要 |
图片加载未设置 | 🛠️ 🟡 次要 |
| 远程URL图片未配置缓存策略 | 🛠️ 🟡 次要 |
| 新增依赖未检查包体积影响 | ⚪ 提示 |
生产环境代码路径中残留 | 🧹 🔵 轻微 |
Findings format
结果输出格式
Use the same format as :
zereight-reviewundefined使用和一致的格式:
zereight-reviewundefined[type] [severity] Title
[type] [severity] Title
Condition: <what triggers this>
Impact: <FPS drop / memory leak / jank / crash>
Evidence: — short snippet
Minimal fix: <smallest safe change>
file:lineundefinedCondition: <what triggers this>
Impact: <FPS drop / memory leak / jank / crash>
Evidence: — short snippet
Minimal fix: <smallest safe change>
file:lineundefinedOutput template
输出模板
When running as standalone review:
- (2-3 lines: what changed, overall signal)
Performance Summary - (ordered 🟠→🟡→🔵)
⚠️ Performance Findings - (
🎯 Verdict|No regressions|Minor regressions)Block — performance regression
When integrated with , append findings to the existing section under a subheader.
zereight-review⚠️ Findings--- Performance ---作为独立审查工具运行时:
- (2-3行:改动内容、整体结论)
性能总结 - (按🟠→🟡→🔵优先级排序)
⚠️ 性能问题 - (
🎯 结论|无回归|轻微回归)阻塞——存在性能回归
与集成时,将结果追加到现有板块下的子标题中。
zereight-review⚠️ Findings--- Performance ---Quick heuristics
快速判断规则
- If it touches a list → check FlashList, keyExtractor, and item memoization
- If it touches animation → verify UI thread execution (Reanimated, not setState)
- If it mounts/unmounts → verify all listeners/subscriptions have cleanup
- If it adds a native module call → verify async, not in render, not in hot loop
- If it adds a new package → note bundle size concern as ⚪ Info
- 如果改动涉及列表 → 检查FlashList、keyExtractor和列表项memoization
- 如果改动涉及动画 → 确认在UI线程执行(使用Reanimated,而非setState)
- 如果改动涉及组件挂载/卸载 → 确认所有监听器/订阅都有清理逻辑
- 如果新增原生模块调用 → 确认是异步调用、未在渲染过程中调用、未在热点循环中调用
- 如果新增第三方包 → 将包体积风险标记为⚪ 提示