← 返回
数据分析 中文

OpenHarmony React Native Performance

OpenHarmony React Native performance static checks and optimization. Based on ohos_react_native performance doc. Use when writing or reviewing React Native for OpenHarmony code, bundle-harmony, lifecycle, or TurboModule. Applies to RNAbility, Hermes bytecode, React render optimization.
OpenHarmony React Native 性能静态检查与优化。基于 ohos_react_native 性能文档,适用于编写或审查 OpenHarmony React Native 代码,涵盖 bundle‑harmony、生命周期、TurboModule、RNAbility、Hermes 字节码及 React 渲染优化。
code-sunbo
数据分析 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 1,199
下载
💾 63
安装
1
版本
#latest

概述

OpenHarmony React Native Performance Static Check Skills

Static-check rules and config for React Native for OpenHarmony, from the official performance-optimization doc. This skill is English-only to reduce token usage; Chinese content is available via links below.

When to Apply

Use this skill when:

  • Writing or reviewing React Native for OpenHarmony (RNOH) application code or OpenHarmony project configuration
  • Optimizing React Native page rendering, setState, or list performance
  • Configuring bundle-harmony build, Hermes bytecode, or Release build
  • Integrating or reviewing RNAbility lifecycle (onForeground/onBackground)
  • Designing or implementing TurboModule (main vs worker thread)
  • Preparing for performance analysis with Trace, React Marker, FCP, etc.

Rule Categories by Priority

| Priority | Category | Impact | Prefix |

| -------- | ------------------- | -------- | ------------------------- |

| 1 | Render optimization | CRITICAL | rnoh-render- |

| 2 | Bundle & native | HIGH | rnoh-bundle-, rnoh-native- |

| 3 | Lifecycle & monitor | HIGH | rnoh-lifecycle- |

| 4 | TurboModule | MEDIUM | rnoh-turbo- |

| 5 | List & key | MEDIUM | rnoh-list- |

Quick Reference

1. Render optimization (CRITICAL)

  • rnoh-render-avoid-same-state — Avoid setState when state unchanged to prevent extra renders
  • rnoh-render-pure-memo — Use PureComponent or React.memo to avoid unnecessary re-renders
  • rnoh-render-props-once — Create callbacks/prop objects once (constructor or outside component)
  • rnoh-render-split-child — Split independent UI into child components
  • rnoh-render-merge-setstate — Merge setState to avoid multiple commits and renders
  • rnoh-render-state-not-mutate — Use new objects in setState; do not mutate existing state
  • rnoh-render-batching — Keep React 18 Automatic Batching enabled (RNOH default concurrentRoot: true)

2. Bundle & native config (HIGH)

  • rnoh-bundle-release — Use --dev=false --minify=true for performance/production bundle
  • rnoh-bundle-hbc — Prefer Hermes bytecode (hermesc) for production
  • rnoh-native-release — Use Release build on native side; lower LOG_VERBOSITY_LEVEL when appropriate
  • rnoh-native-bisheng — Optionally use BiSheng compiler (buildOption.nativeCompiler: "BiSheng")

3. Lifecycle & monitoring (HIGH)

  • rnoh-lifecycle-foreground-background — Call onForeground/onBackground in onPageShow/onPageHide or onShown/onHidden
  • rnoh-lifecycle-fcp — First-frame monitoring: use mount event or root onLayout to report FCP

4. TurboModule (MEDIUM)

  • rnoh-turbo-worker — Run heavy TurboModules (JSON, crypto, image, network, I/O) on worker thread; avoid ImageLoader on worker

5. List & key (MEDIUM)

  • rnoh-list-key — Provide stable keys for list items; avoid using index as key

How to Use

  • Static checks: Apply the rules above in code review or scripts (JS/TS and config).
  • Details and examples: See the corresponding rule files under rules/ (e.g. rules/rnoh-render-pure-memo.md).
  • Full doc: Performance optimization (en).

Relation to general React Native skills

  • This skill focuses on OpenHarmony-specific React Native performance (RNAbility, bundle-harmony, HBC, TurboModule worker, Trace/React Marker).
  • It complements vercel-react-native-skills and react-native-best-practices: list virtualization (FlashList), Pressable, expo-image, StyleSheet, etc. still apply; this skill adds OpenHarmony-side config and render-optimization details.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-29 02:44 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

data-analysis

Excel / XLSX

ivangdavila
创建、检查和编辑 Microsoft Excel 工作簿及 XLSX 文件,支持可靠的公式、日期、类型、格式、重算及模板保留功能。
★ 366 📥 139,959
data-analysis

A股量化 AkShare

mbpz
A股量化数据分析工具,基于AkShare库获取A股行情、财务数据、板块信息等。用于回答关于A股股票查询、行情数据、财务分析、选股等问题。
★ 162 📥 59,672
data-analysis

Data Analysis

ivangdavila
{"answer":"数据分析与可视化。查询数据库、生成报告、自动化电子表格,将原始数据转化为清晰可行的见解。适用于:(1) 您……"}
★ 198 📥 64,855