MCPcopy Index your code
hub / github.com/didi/dimina

github.com/didi/dimina @v1.3.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.3.1 ↗ · + Follow
2,902 symbols 8,670 edges 739 files 541 documented · 19%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

中文版

dimina

Dimina is released under the Apache 2.0 license. Platform PRs welcome!

Dimina - Didi's Open Source Cross-Platform Mini Program Framework

Dimina is pronounced /diːminə/, short for didi miniprogram. It aims to build a flexible and lightweight cross-platform mini program development framework.

IntroductionShowcaseGetting StartedContributingStar TrendLicense

Introduction

Dimina is a lightweight cross-platform mini program framework independently developed by Didi. It can be understood as an open-source version of mini program solutions, committed to providing developers with a high-performance, cross-platform, and low-barrier development experience.

Currently, Dimina supports four major platforms: Android, iOS, Harmony, and Web. Developers can use Dimina as a mobile cross-platform development framework to integrate existing mini program logic into current apps, or develop directly with mini program syntax and compile it into resource bundles that Dimina containers can load on each platform.

🔧 Technical Features

  • Offline Resource Caching: Resources are cached locally to reduce network requests
  • Logic-View Separation: Independent JS engine prevents main thread blocking
  • Native Capability Encapsulation: Unified API for native functionality
  • Page Preloading: WebView preheating for better performance

🚀 Cross-Platform Support

  • Android: QuickJS + Android WebView
  • iOS: JavaScriptCore + WKWebView
  • Harmony: QuickJS + Harmony WebView
  • Web: Web Worker + Browser

Showcase

Live Demo: https://didi.github.io/dimina/

Android iOS Harmony
Android iOS Harmony

Getting Started

graph TD
    A[Create Mini Program Project] --> B[Develop Mini Program Pages]
    B --> C[Write Logic Using Mini Program Syntax]
    C --> D[Compile with DMCC]
    D --> E[Generate Dimina Package]
    E --> F{Target Platform}
    F -->|Android| G[Integrate Android SDK]
    F -->|iOS| H[Integrate iOS SDK]
    F -->|Harmony| I[Integrate Harmony SDK]
    F -->|Web| M[Preview in Web Container]
    G --> J[Run on Android Device]
    H --> K[Run on iOS Device]
    I --> L[Run on Harmony Device]

Step-by-Step Guide

  1. Create Mini Program Project
  2. Use mini program development tools to create project
  3. Configure app.json and page routing

  4. Develop Mini Program Pages

  5. Write WXML templates
  6. Add WXSS styles
  7. Use JavaScript to write page logic

  8. Compile and Package

  9. Enter the frontend workspace, install dependencies, and run the compiler
  10. Use DMCC Compiler to compile mini program code into Dimina runtime resources
  11. Run pnpm generate:app to generate mini program bundles into shared/jsapp
  12. Run pnpm generate:sdk to generate the JSSDK bundle into shared/jssdk

  13. Platform Integration

  14. Android Integration Guide
  15. iOS Integration Guide
  16. Harmony Integration Guide
  17. For Web, run pnpm dev in fe/ for local preview

  18. Debugging and Publishing

  19. Android, iOS, and Harmony sample projects sync resources from shared/ into platform resource directories
  20. Debug on real devices and verify API, component, and lifecycle behavior
  21. Package and publish through each platform's release process

Contributing

Dimina is designed in accordance with the Mini App Standard White Paper and has currently aligned with the main functionalities of WeChat Mini Program.

For currently supported capabilities, see the Dimina Capability Reference Guide.

Thanks to the high similarity between Vue3 and mini program syntax, Dimina's underlying view rendering framework is built on Vue. Dimina uses DMCC to transpile mini program syntax into Vue syntax, and builds a mini program standard component system on top of it. Client-side mini program containers then provide native capabilities while flexibly loading and displaying view pages.

For more information about the underlying implementation principles of the framework, please refer to the detailed documentation.

Since various mini program solutions in the industry have been iterating for many years, Dimina has not yet fully covered all mini program APIs/components/features. We welcome everyone to actively contribute code and suggestions to improve Dimina together.

WeChat Group

WeChat

Star Trend

If you find Dimina helpful, please click the ⭐Star button in the upper right to support us and help more people discover this project.

License

Dimina is distributed and used under the Apache-2.0 license. For more details, please see the LICENSE file.

Extension points exported contracts — how you extend this code

ApiHandler (Interface)
* Base interface for all API handlers * Author: Doslin */
android/dimina/src/main/kotlin/com/didi/dimina/api/ApiHandler.kt
Option (Interface)
(no doc)
fe/example/vant/miniprogram_npm/@vant/weapp/dropdown-item/shared.d.ts
ExtModuleHandler (Interface)
* 第三方扩展 bridge 模块的处理器接口。 * * 宿主通过 [com.didi.dimina.Dimina.registerExtModule] 注册实现, * 框架在收到 extBridge / extOnBridge 调用
android/dimina/src/main/kotlin/com/didi/dimina/api/ext/ExtModuleHandler.kt
VantComponentInstance (Interface)
(no doc)
fe/example/vant/miniprogram_npm/@vant/weapp/definitions/index.d.ts
ExtCallback (Interface)
* 回调接口,用于将 native 结果传回 JS 层。 */
android/dimina/src/main/kotlin/com/didi/dimina/api/ext/ExtModuleHandler.kt
Day (Interface)
(no doc)
fe/example/vant/miniprogram_npm/@vant/weapp/calendar/components/month/index.d.ts
NativeComponent (Interface)
(no doc)
android/dimina/src/main/kotlin/com/didi/dimina/ui/view/NativeComponentHost.kt
WxWorkSystemInfo (Interface)
(no doc)
fe/example/vant/miniprogram_npm/@vant/weapp/common/version.d.ts

Core symbols most depended-on inside this repo

setData
called by 414
fe/packages/service/src/instance/page/page.js
push
called by 312
fe/packages/service/src/core/router.js
writeFileSync
called by 249
fe/packages/service/src/api/core/file/index.js
d
called by 229
android/dimina/src/main/kotlin/com/didi/dimina/common/LogUtils.kt
invokeAPI
called by 222
fe/packages/service/src/api/common/index.js
call
called by 210
fe/packages/service/src/api/core/ui/canvas/canvas-node.js
mkdirSync
called by 136
fe/packages/service/src/api/core/file/index.js
n
called by 91
fe/example/taro-todo/vendors.js

Shape

Function 1,560
Method 1,122
Class 202
Interface 16
Enum 2

Languages

TypeScript77%
Kotlin19%
C++4%
C1%

Modules by API surface

fe/example/taro-todo/vendors.js283 symbols
fe/example/taro-todo/taro.js141 symbols
fe/packages/container/src/pages/miniApp/miniApp.js97 symbols
android/dimina/src/main/kotlin/com/didi/dimina/ui/container/DiminaActivity.kt85 symbols
android/dimina/src/main/kotlin/com/didi/dimina/ui/view/NativeComponentHost.kt68 symbols
fe/packages/render/src/core/runtime.js59 symbols
fe/packages/common/src/core/utils.js53 symbols
fe/packages/service/src/instance/component/component.js52 symbols
fe/packages/compiler/src/core/view-compiler.js52 symbols
fe/packages/service/src/api/core/file/index.js48 symbols
android/engine_qjs/src/main/cpp/qjs.cpp45 symbols
fe/packages/service/src/api/core/ui/canvas/canvas-node.js44 symbols

For agents

$ claude mcp add dimina \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact