What’s New in Taro 3? Cross‑Framework and Cross‑Platform Features Unveiled
Taro 3 introduces full cross‑framework support for React, Nerv, Vue 2/3 and jQuery‑like APIs, expands to major mini‑program platforms and H5, adds an open plugin system, prerendering, faster builds, CSS‑in‑JS via linaria, virtual list components and a seamless WeChat‑to‑React/Vue conversion tool.
Cross‑Framework Support: React, Nerv, Vue 2, Vue 3, jQuery‑like API
Taro 3 quantifies the mini‑program lifecycle as an interface and lets each framework implement its own class that implements that interface, enabling the same component/API/route specifications to run on different front‑end frameworks without syntax restrictions. Developers create a project with taro init and write idiomatic code that matches the chosen framework’s lifecycle.
Cross‑Platform Targets: H5, WeChat, Alipay, Baidu, ByteDance, QQ, etc.
Like previous versions, Taro 3 compiles to all major mini‑program platforms. The H5 side has been completely rewritten using Web Components and a framework‑agnostic router, so React, Vue or Nerv code runs on both mini‑programs and browsers.
Open Plugin System
Compilation now uses a Tapable‑based plugin system, allowing developers to extend Taro’s capabilities or add custom business logic via plugins. At runtime, inspiration from the React Reconciler provides an API for modifying runtime behavior without touching Taro’s source code. Future minor releases (e.g., v3.1.0) will decouple compilation and runtime from specific platforms, enabling a single plugin to add new targets or frameworks.
Open‑Source Governance
Taro adopts an Issue Helper tool (inspired by Vue.js and Ant Design) and an RFC process (borrowed from Rust and React) to manage major feature updates, along with a Milestone mechanism for transparent versioning. Documentation has been reorganized into progressive guides that introduce core concepts and optimization techniques step‑by‑step.
WeChat Mini‑Program to React/Vue Conversion
Since Taro 1.2, the taro convert command can transform a WeChat mini‑program project into a multi‑target application with React or Vue output. Running the command in the project root launches an interactive prompt to select the target framework.
$ taro convertHTML String Rendering
API aligns with web standards; use React’s dangerouslySetInnerHTML or Vue’s v-html.
Styling can be controlled directly via CSS.
Rendered HTML elements can bind events.
Hook functions are provided for custom rendering logic.
See the “Render HTML” documentation for details.
CSS‑in‑JS via Linaria
Provides an API similar to styled-components.
Full TypeScript support.
Zero runtime overhead, crucial for bundle‑size‑sensitive mini‑programs.
Refer to the “CSS‑in‑JS” guide for usage.
Virtual List (VirtualList) Component
To avoid performance issues when rendering massive lists, Taro 3 includes a Virtual List component that only renders the visible viewport and lazily renders off‑screen items. The component works across React, Vue, mini‑programs and H5.
import VirtualList from '@tarojs/components/virtual-list'Documentation for long‑list rendering is available.
Prerender for Faster Startup
Inspired by server‑side rendering, Taro CLI now prerenders page state into static WXML before any framework or business logic runs, eliminating the extra setData overhead and matching or exceeding native mini‑program startup speed.
Faster Build and Source‑Map Support
By removing AST transformations on developer code, Taro 3 dramatically speeds up compilation. The removal also enables native source‑map generation, improving debugging experience.
In summary, Taro 3 delivers a unified, extensible, and high‑performance framework for building cross‑framework, cross‑platform applications, positioning itself as a core infrastructure for mini‑program and multi‑end development.
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.
Aotu Lab
Aotu Lab, founded in October 2015, is a front-end engineering team serving multi-platform products. The articles in this public account are intended to share and discuss technology, reflecting only the personal views of Aotu Lab members and not the official stance of JD.com Technology.
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.
