How Taro’s Open‑Source HarmonyOS Version Boosts Cross‑Platform Mobile Development

This article details the open‑source Taro on HarmonyOS framework, covering its evolution, technical architecture, performance optimizations, and cross‑platform development benefits that enable developers to write once and deploy across HarmonyOS, web, and mini‑program ecosystems.

JD Tech Talk
JD Tech Talk
JD Tech Talk
How Taro’s Open‑Source HarmonyOS Version Boosts Cross‑Platform Mobile Development
In June 2025, at the Huawei Developer Conference 2025 Scenario Technology Co‑Creation Forum, the author presented the topic "JD Taro Framework HarmonyOS Version Officially Open‑Source, Empowering Third‑Party HarmonyOS App Development," outlining the implementation, core optimizations, and main features of the open‑source release. This article introduces Taro on HarmonyOS's technical architecture, performance optimization practices, and open‑source progress, sharing challenges and solutions encountered in cross‑platform development.

Background

Since its open‑source launch in June 2018, Taro has grown from a simple mini‑program solution to a mature, open‑source cross‑platform framework supported by thousands of contributors. It now supports multiple front‑end frameworks and UI libraries, offering a rich toolchain including Webpack, Vite, and ESBuild for customizable development workflows. Over 36,000 stars and nearly 5,000 forks on GitHub reflect strong community adoption.

Technical Architecture Evolution

Starting in 2022, Taro began adapting to HarmonyOS. Initial support was provided by the JSUI plugin, followed by the ETS plugin in 2023, which significantly improved development experience and performance. The latest 4.1 release introduces the C‑API plugin, marking a major breakthrough in HarmonyOS support.

Multi‑End Development

Traditional multi‑platform development faces challenges such as inconsistent syntax, divergent component APIs, and complex environments. Taro unifies development through a common DSL and standardized component/API libraries, adhering to W3C standards, allowing developers to write a single codebase that runs on HarmonyOS, web, mini‑programs, iOS, and Android with consistent UI rendering.

Using the JD HarmonyOS app as an example, the Taro solution achieves a balance between development efficiency and application performance, delivering industry‑leading stability and speed.

Technical Architecture

Taro maintains consistent adaptation logic across platforms. Developers use a unified DSL and standardized component and API libraries, fully compliant with W3C specifications.

During compilation, Taro leverages Webpack, Vite, or Metro to transform source code into platform‑specific executables. At runtime, it integrates syntax adapters, DOM, and BOM simulations, ensuring stable execution on HarmonyOS and other platforms.

Rendering Layer Adaptation

The code conversion flow starts from developer‑written React code, which is processed by the React Reconciler to build a virtual node tree. The runtime then maps this to a simulated DOM and BOM API, achieving precise mapping between React nodes and Taro’s internal node tree.

Platform adaptation converts the abstract node structure into native HarmonyOS ArkUI components, constructing the final rendering tree displayed to users.

Architecture Iteration

Both the ETS and C‑API solutions share a three‑layer node architecture: the application layer’s React node tree, an intermediate Taro node tree, and the bottom‑layer ArkUI node tree. The transition from ETS to C‑API focuses on performance, moving critical modules to C++ to reduce bridge overhead and improve execution speed.

Performance Enhancements with C‑API

The C‑API implementation shifts high‑frequency operations such as DOM tree manipulation, event handling, and style calculation to the C++ layer, dramatically improving runtime efficiency and reducing JavaScript‑native communication costs. Memory management is optimized, minimizing fragmentation and enhancing stability for complex scenarios.

Core functionalities—including style processing, layout calculation, and event management—are migrated to native C++, providing substantial performance gains.

Cross‑Platform Development Standards

Building on HarmonyOS support, Taro defines a comprehensive cross‑platform development standard. Using React as the UI foundation, the standard covers 26 common components (e.g., View, Text) and 88 APIs (network, image, etc.), along with 93 W3C‑based style rules. Ongoing extensions add new components, APIs, and style specifications.

The C++ style processing architecture integrates the Yoga layout engine, ensuring visual consistency across platforms. A Rust‑based lightingCSS plugin pre‑processes standard styles into HarmonyOS‑compatible formats, reducing runtime computation.

Feature Highlights

R&D Efficiency : By aligning with the React ecosystem and W3C standards, developers can leverage mature front‑end tools for rapid iteration, achieving true "write once, run everywhere" across HarmonyOS, mini‑programs, and web.

Ecosystem Expansion : Flexible component and API extension mechanisms enable teams to customize runtime environments. The native‑mixed calling scheme allows C++ modules and ArkTS native modules to interoperate, reducing duplicate work and boosting overall productivity.

Performance Experience

Runtime Performance Optimization : Critical modules are fully offloaded to C++, minimizing JS‑native bridge traffic and improving memory management.

Advanced Component Capabilities : High‑performance virtual lists and waterfall flows are built on native HarmonyOS components, offering seamless data loading and smart caching.

Image Processing : A dedicated image subsystem provides multi‑level caching, compression, format conversion, and adaptive loading strategies to lower memory and bandwidth usage.

Text and Drawing Support : PixelMap delivers rich typography features, while the Canvas API supports path drawing, transformations, and filters for complex visualizations.

Video Playback : Re‑engineered Video component using AVPlayer at the C‑API layer offers precise control, multi‑format support, and synchronized audio‑video playback.

Summary and Outlook

Taro’s deep integration with HarmonyOS opens new technical pathways for full‑scenario application development, providing a robust capability set for diverse business needs and fostering innovation within the HarmonyOS ecosystem.

In practice, the JD HarmonyOS app—built with Taro—has achieved top rankings in the Huawei AppGallery’s shopping category, demonstrating the commercial value of the solution.

Future plans include open‑sourcing additional core features such as multithreading, expanding cross‑platform standards, migrating more modules to C++, and continuing community collaboration to advance cross‑platform development.

PerformanceHarmonyOSCross‑PlatformTaro
JD Tech Talk
Written by

JD Tech Talk

Official JD Tech public account delivering best practices and technology innovation.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.