Mobile Development 13 min read

JAYE 2.0: An AST‑Based Dynamic Loading Framework for Flutter

This article describes how the JAYE 2.0 project at Beike leverages abstract syntax tree (AST) generation, a custom runtime interpreter, and Dart VM execution to achieve high‑performance, hot‑fixable dynamic updates for Flutter applications, addressing packaging, hot‑reload, and scalability challenges.

Beike Product & Technology
Beike Product & Technology
Beike Product & Technology
JAYE 2.0: An AST‑Based Dynamic Loading Framework for Flutter

Background: Many companies, including Beike, face mismatched iOS/Android development resources, prompting the adoption of Flutter for its performance, stability, and cross‑platform consistency. After a year of Flutter adoption, Beike encountered limitations such as inability to hot‑fix, large bundle sizes, and lack of dynamic updates.

Technical Options: Early research identified two mainstream dynamic solutions—JavaScript‑based bridges (used by Tencent) and source‑code lexical analysis to generate AST JSON (used by Meituan). Both have drawbacks, leading Beike to form its own Flutter dynamicization team.

Project Evolution: The initial JAYE prototype used JSCore for logic and Skia for rendering, requiring extensive JS‑Flutter bridges. JAYE 2.0 evolved to keep Flutter’s language and runtime intact, converting Dart source to AST JSON and executing it via a built‑in runtime that proxies commands to the Dart VM, achieving high performance without altering developer habits.

Dynamic Principle – Compile Time: Flutter pages are parsed into AST trees, producing an atomic description (AST JSON). The AST captures functions, components, imports, and binary expressions, enabling precise reconstruction of page logic at runtime.

Dynamic Principle – Runtime: The runtime parses AST JSON, maps it to executable instructions, and delegates widget rendering to a proxy layer. Instruction types include widget method mapping, basic syntax mapping, and custom method mapping. A lightweight VM context handles scopes, variable resolution, and method invocation.

Widget Rendering: Each widget is assigned a key‑value pair; the runtime builds widget instances from JSON parameters using a factory pattern, allowing seamless integration of native, third‑party, and custom widgets.

Testing: To reduce long debugging cycles, a granular test framework was created to test individual execution units, cutting down development overhead.

Practical Results: Deployed in the Juejin app, JAYE 2.0 achieved performance comparable to pure Flutter pages, with similar memory usage and frame rates, while enabling hot‑fixes for multiple online bugs.

Future Plans: The roadmap includes automated tooling for proxy generation, IDE syntax checking to surface unsupported constructs early, source‑code address mapping for rapid debugging, and a conversion pipeline to support H5 pages by generating compatible AST JSON.

Conclusion: JAYE 2.0 demonstrates that AST‑driven compilation and runtime interpretation can provide full‑page and fine‑grained dynamic updates in Flutter without compromising performance, paving the way for broader adoption across Beike’s product suite.

FlutterMobile DevelopmentASTruntimedynamic loadinghotfix
Beike Product & Technology
Written by

Beike Product & Technology

As Beike's official product and technology account, we are committed to building a platform for sharing Beike's product and technology insights, targeting internet/O2O developers and product professionals. We share high-quality original articles, tech salon events, and recruitment information weekly. Welcome to follow us.

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.