Frontend Development 12 min read

Ctrip's Taro Cross‑Platform Mini‑Program Solution: Design, Architecture, and Implementation

This article presents Ctrip's Taro cross‑platform solution for mini‑programs, detailing the motivation behind multi‑platform development, the technical selection of Taro 3, the modular plugin architecture, repository management with git submodules, CI/CD pipelines, and the overall benefits for code reuse and development efficiency.

Ctrip Technology
Ctrip Technology
Ctrip Technology
Ctrip's Taro Cross‑Platform Mini‑Program Solution: Design, Architecture, and Implementation

With the rapid increase of Ctrip's mini‑program platforms, the front‑end team faced rising development and maintenance costs for multiple native DSLs, prompting the need for a single codebase that can run across various mini‑program environments.

The team evaluated existing cross‑platform frameworks and selected Taro 3 for its stability, extensive platform support, React‑style syntax, and ability to mix native development, forming the core of the Ctrip Taro solution.

The solution introduces a layered architecture where Taro modules are developed independently, compiled, and then integrated into a shared Taro shell that runs within the native mini‑program container, enabling flexible composition of business modules.

To avoid code conflicts in multi‑team collaborations, the project adopts a plugin‑based design that isolates each business line into separate sub‑packages, enforces a "non‑essential code not in main bundle" principle, and provides common module handling for third‑party dependencies.

Each Taro module resides in its own Git repository; the main project uses git submodule to include these repositories, allowing independent versioning and easy aggregation of modules for different product lines.

The build process leverages a custom miniTools CLI to generate project scaffolds, compile Taro modules, dynamically generate splitChunks based on sub‑package paths, and merge the compiled output with the native shell, producing a complete mini‑program package.

Automation is achieved through webhooks and CI/CD pipelines that fetch updated module code, resolve version mappings, and trigger Docker‑based builds, culminating in a streamlined release workflow.

In summary, the Ctrip Taro cross‑platform solution now supports five major mini‑program ecosystems (WeChat, Alipay, ByteDance, Baidu, Kuaishou), offering high flexibility, code reuse, and accelerated development and release cycles.

frontendCross-PlatformArchitectureMini ProgramTaroCtrip
Ctrip Technology
Written by

Ctrip Technology

Official Ctrip Technology account, sharing and discussing growth.

0 followers
Reader feedback

How this landed with the community

login 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.