How JD Used Taro to Build High‑Performance HarmonyOS Native Apps
The article explains JD's technical solution for developing HarmonyOS native applications with the Taro cross‑platform framework, detailing the chosen architecture, CSS adaptations, performance optimizations, and future enhancement plans that resulted in significant rendering speed gains.
Background
In January 2024, JD launched HarmonyOS native app development, leveraging HarmonyOS NEXT's full‑scene, native intelligence, and native security features to create a smoother, smarter, and safer shopping experience. In June, a trial version was released on the Huawei AppGallery, with the full version planned for September.
Since 2020, JD and Huawei have signed a strategic cooperation agreement, continuously investing in technology to explore HarmonyOS innovations. As an early major partner in the Huawei Harmony ecosystem, JD has maintained close technical communication and co‑creation with Huawei, jointly tackling platform adaptation challenges and promoting a unified multi‑device development solution. Taro was the first in the industry to support native development for HarmonyOS ArkUI.
This article describes the technical solution, characteristics, performance results, and future optimization plans of JD's HarmonyOS native app, highlighting why Taro was chosen as the development framework and its advantages in web‑style development, rapid migration of existing projects, rendering performance, advanced features, and hybrid development modes.
Technical Solution
JD needed to complete the project efficiently within limited time while ensuring performance and user experience, making the choice of technology critical.
Two options exist for developing a HarmonyOS native app:
Develop with native ArkTS
Use a cross‑platform framework
Native ArkTS development faces long development cycles and high maintenance costs for multiple platforms. Given tight delivery schedules, JD decisively chose a cross‑platform framework.
Taro, an open‑source cross‑platform framework developed by JD’s Aotu Lab, allows a single codebase to run on H5, mini‑programs, and HarmonyOS.
With Taro’s compilation capability, developers can convert an entire Taro project into an independent HarmonyOS app without extra work.
Taro also supports packaging selected pages as native modules, which JD used for this app.
The core infrastructure such as routing, location, and permissions is provided by JD Retail mpass team, while Taro handles native page rendering and bridges to these capabilities. Developers simply execute a command to package the Taro project into a native module, which is then rendered as native pages within the app.
Technical Characteristics
Taro offers several advantages for HarmonyOS native development:
Web‑style development for HarmonyOS
Taro enables developers to use familiar web paradigms, adapting most CSS features, including flex, pseudo‑classes/elements, positioning, selectors, media queries, units (vh, vw, calc), variables, and safe‑area definitions.
The compilation process uses Rust‑based LightningCSS, dramatically speeding up CSS parsing.
Runtime processing follows WebKit‑like handling, upgrading CSS rule matching and dirty‑checking, which greatly improves CSS application performance.
Rapid migration of existing Taro projects
Taro enables low‑cost, high‑fidelity migration of existing projects to HarmonyOS while maintaining performance.
Rendering performance comparable to native
Instead of recursive ArkTS component rendering, Taro shifts most runtime logic—components, animations, layout—to the C++ layer, boosting rendering speed.
Taro also restructured CSS handling and introduced the Yoga layout engine, moving measurement and layout to the Taro side, creating an efficient rendering pipeline that rivals native ArkTS performance.
Support for virtual lists and node reuse
For long lists (e.g., product, order, message lists), Taro provides optimized WaterFlow & List components with lazy loading, preloading, and node reuse, preventing performance degradation with large data sets.
Hybrid native development support
Taro’s components and APIs are designed for mini‑programs; when native components are missing, Taro allows mixing native pages/components with Taro components in the same view.
Performance Results
JD HarmonyOS native app metrics
After multiple optimizations, the home page rendering time is 1062 ms, a 23.9% improvement over the previous ArkTS version; the product detail page renders in 560 ms, a 74.2% improvement.
The significant gain on the detail page is due to CSS parsing and property application optimizations in the CAPI version.
Pages built with Taro passed Huawei Performance Factory’s acceptance tests with excellent scores, confirming high performance on HarmonyOS.
Summary and Future Outlook
Taro has become a full‑business‑domain cross‑platform solution, unifying web‑style (mini‑programs, hybrid) and native (iOS, Android, HarmonyOS) development. Its high‑performance HarmonyOS adaptation enables rapid expansion into the emerging HarmonyOS ecosystem, meeting the demand for consolidated development.
Future Plans
Separate JavaScript business logic from the UI rendering thread by launching a dedicated JS thread, preventing main‑thread blockage and reducing jank.
Flatten view nodes that do not affect layout to reduce the number of components drawn on screen, improving rendering performance.
Implement native‑level dynamic update capabilities, allowing developers to update pages and features without recompiling or republishing the app.
Conclusion
JD’s HarmonyOS native app demonstrates the feasibility of using Taro for high‑performance, multi‑platform development, marking a breakthrough in unified cross‑platform solutions and offering enterprises and developers an efficient way to build performant HarmonyOS applications.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
JD Cloud Developers
JD Cloud Developers (Developer of JD Technology) is a JD Technology Group platform offering technical sharing and communication for AI, cloud computing, IoT and related developers. It publishes JD product technical information, industry content, and tech event news. Embrace technology and partner with developers to envision the future.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
