What’s New in Taro 3.2: Faster Builds, Source‑Map Support, and Full React Native Integration
Taro 3.2 introduces a revamped compilation pipeline that eliminates intermediate code, adds native source‑map support, supports React Native 0.64 with Hermes, expands APIs and components, enables on‑demand imports, and provides clear migration steps for both new and existing projects, while outlining future roadmap and community resources.
Background
Taro is an open‑source cross‑platform framework that lets developers use React, Vue, Nerv and other libraries to build applications for WeChat, JD, Baidu, Alipay, ByteDance, QQ mini‑programs, H5, and React Native. Since the release of Taro 3, the community has been eager for official React Native support.
Collaboration and Release
Partnering with the 58.com team, Taro 3’s React Native support was developed and, after extensive testing across nine canary and four beta releases, the stable 3.2 version was launched.
Key Improvements
1. Faster Compilation
Previous versions performed heavy AST transformations to generate intermediate code before Metro bundled it. Taro 3.2 now bypasses the intermediate step and lets Metro directly bundle the source, resulting in significantly faster builds thanks to multi‑level caching and hasteFS.
2. Source‑Map Support
By eliminating intermediate code, the new pipeline naturally produces source‑maps, giving developers a debugging experience identical to native React Native projects.
3. Support for Multiple React Native Versions (up to 0.64)
The framework now respects the React Native version declared in the project’s dependencies, supporting any version ≥ 0.60, including the latest 0.64 with Hermes, inline requires, and React 17 compatibility.
New‑project defaults : React 17, TypeScript 4, and React Native 0.64 are installed automatically.
Upgrade existing projects (from v2.x): follow the migration guide [4]. For Taro 3 projects, update dependencies manually:
react: ^17.0.0
react‑dom: ^17.0.0
typescript: ^4.1.0
@typescript-eslint/parser: ^4.15.1
@typescript-eslint/eslint-plugin: ^4.15.1
react‑native: ^0.64.0
ESLint configuration example:
// .eslintrc
module.exports = {
"extends": ["taro/react"],
"rules": {
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off"
}
}4. Richer API and Component Set
Taro 3.2 adds 45 new APIs and 8 new components, including multimedia (Video, Camera), scanning, VirtualList, and more, narrowing the gap between mini‑programs, H5, and native apps.
scanCode – QR code scanning
show/hideTabBar – tab bar control
createCameraContext – camera operations
Video – video playback
Camera – camera capture
VirtualList – high‑performance long list
5. On‑Demand API/Component Import
To reduce bundle size, Taro now supports tree‑shaking imports. Only used APIs are bundled:
import Taro from '@tarojs/taro'
Taro.scanCode(options)
// After build becomes:
import { scanCode } from '@tarojs/taro-rn/dist/lib/scanCode'This approach keeps unused components and dependencies out of the final bundle, improving first‑load performance.
6. Seamless Integration with Existing React Native Apps
By providing a custom Metro transformer and runtime adapters, Taro 3 can be merged into an existing React Native project without altering business code. Developers only need to add the generated Metro config and wrap the app with Taro’s runtime methods.
// metro.config.js example
const Supporter = require('@tarojs/rn-supporter')
const supporter = new Supporter()
const taroMetroConfig = supporter.getMetroConfig()
const busConfig = { resetCache: true }7. When Cross‑Platform Is Not Required
Even if a team only targets React Native or mini‑programs, Taro is still recommended for its easy future expansion, unified component/API set, and simpler styling compared to pure React Native.
Upgrade Guide
For v3.x users, install the latest CLI, clean node_modules, and update Taro dependencies to ^3.2.0: npm i -g @tarojs/cli Then reinstall project dependencies.
Note: Taro 3 currently supports only React‑based projects on the React Native side.
Future Roadmap
The team plans to further improve API/component coverage, reduce differences with H5/mini‑programs, add beginner tutorials, and provide more real‑world examples to lower the entry barrier.
Community support is available via a dedicated WeChat group.
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.
