Mobile Development 14 min read

How Alibaba Scales Flutter: Real‑World Practices, Build Pipelines, and Performance Insights

This article examines Alibaba's practical use of Flutter, covering application adoption, infrastructure setup, SDK maturity, hybrid stack routing, iOS packaging scripts, monitoring, performance tuning, upgrade strategies, and a brief look at Flutter for Web, providing actionable insights for mobile developers.

Alibaba International Technology
Alibaba International Technology
Alibaba International Technology
How Alibaba Scales Flutter: Real‑World Practices, Build Pipelines, and Performance Insights

1. Application Status

Based on Alibaba's internal use, multiple apps have launched with Flutter, mostly as a secondary technology alongside native code. Hybrid stacks are now mature, removing major obstacles for Flutter integration.

2. Infrastructure

Focus on iOS; Android is similar.

2.1 SDK Maturity

Since the official 1.0 release in November 2018, Flutter has been commercially mature, with many pure‑Flutter apps overseas and hybrid solutions domestically. New apps benefit greatly from Flutter, while large apps can adopt hybrid approaches without insurmountable difficulties.

2.2 Integration

Beyond the official steps, iOS requires the project name to be "Runner". Developers can either modify the SDK to support arbitrary names or rename the project to "Runner". Renaming the project usually incurs lower maintenance cost.

/// static const String _hostAppBundleName = 'Runner';
/// search the path and find the project name
String get _hostAppBundleName {
  String projectName;
  _editableDirectory.listSync().forEach((FileSystemEntity entity) {
    if (entity.basename.endsWith('xcodeproj')) {
      projectName = entity.basename.substring(0, entity.basename.length - 10);
    }
  });
  return projectName;
}

The above changes the hard‑coded logic to dynamic retrieval; other minor customizations are also applied. In principle, fewer modifications are better because each SDK upgrade requires re‑work.

2.3 Hybrid Stack

Since June 2018, the hybrid stack mechanism has been refined. The following diagram shows the routing mechanism where H5, Weex, Native, and Flutter share a unified router, with emphasis on Flutter.

Business‑layer interfaces are provided by the static library ASCFlutterInterface, enabling runtime loading of Flutter and reducing startup impact. ASCFlutterViewController acts as a container managing the view controller and Flutter view, supporting push, present, overlay, and basic embedding, with the constraint that a screen can host only one Flutter view.

2.4 Development & Debugging

Follow official guidelines; if the project name is not "Runner", some custom steps are required, but overall issues are minor.

2.5 Automated Testing

Official support exists but is limited to simple self‑tests; more extensive testing would require a custom OCR‑based framework, which is currently on hold.

2.6 Packaging

iOS packaging uses xcode_backend.sh from the Flutter SDK. For large projects, custom packaging scripts are necessary. The example below shows the packaging workflow on Alibaba’s "摩天轮" build platform, including environment preparation, SDK selection, building AOT artifacts for armv7, arm64, and x86_64, merging them with lipo, and uploading the final product.

export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
# ... (rest of the script omitted for brevity) ...

Additional steps include removing debug artifacts from release packages to save space.

2.7 Monitoring & Operations

Flutter engine stability (crash rate ~0.01%).

Flutter business code exceptions.

Flutter performance (startup time, FPS).

These areas are relatively low‑effort; as coverage expands, demand will increase.

2.8 Startup Performance

Dynamic libraries affect launch speed; first‑time Flutter page load can be improved via on‑demand loading and pre‑loading.

2.9 Package Size

Avoid including debug artifacts in release packages; for larger apps, slimming techniques can be applied.

2.10 Dynamic Features

Dynamic UI and FFW have been explored; UI dynamic loading is mature, while FFW remains less stable.

2.11 Upgrade Strategy

Flutter upgrades consider SDK version, custom engine version, packaging script changes, and internal mechanism shifts. Alibaba upgrades roughly every two to three months to balance stability and new features.

2.12 Flutter for Web

Brief reference to an external article on Alibaba’s exploration of Flutter for Web.

Alibaba.com Flutter Exploration: Flutter For Web Pre‑Research

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

performanceCI/CDHybrid StackiOS Build
Alibaba International Technology
Written by

Alibaba International Technology

Founded in 1999, Alibaba International is a leading global cross‑border B2B e‑commerce platform serving millions of professional buyers and suppliers. Together with Alibaba Group’s other businesses, it advances the mission of “making it easy to do business anywhere.”

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.