uni-app Framework

repository·uni-app-x·Indexed 12 days ago

https://github.com/dcloudio/uni-app

A cross-platform development framework based on Vue.js for building applications for iOS, Android, HarmonyOS, web, and various mini-program ecosystems from a single codebase. Includes uni-app (x), uniCloud, and uni-agent, an AI agent engineer optimized for autonomous coding, debugging, and testing within the ecosystem.

Tokens
674.2K
Snippets
1.6K
Records
2.7K
Agent score
95%

What's inside uni-app

  1. Introduction to uni-ui x

    uni-app-x

    uni-ui x is an extended component library specifically designed for uni-app x. It is a complete redesign and differs from the original uni-ui used for standard uni-app.

    Key Features

    • Performance Optimized: Designed to leverage the best practices of uni-app x's 'Steam Mode' (蒸汽模式), utilizing template and style pre-compilation.
    • High Customizability: Unlike libraries that encapsulate styles into component props, uni-ui x uses a CSS-first approach. All styles can be customized via class and CSS variables, ensuring flexibility without modifying source code.
    • AI-Friendly: Prioritizes code over binary files. It uses CSS/View configurations for icons (like arrows) and SVG for complex shapes (like Bezier curves) instead of images or icon fonts, making it easier for AI to understand, generate, and modify UI code.
    • Neutral Design: Provides a neutral aesthetic similar to built-in platform components, allowing developers to define their own brand style easily.
    • Internationalization & Theming: No hardcoded text or colors, supporting seamless localization and custom themes via CSS variables.
  2. Overview of uni-app x Native SDK for Hybrid Development

    uni-app-x

    The uni-app x Native SDK is a development kit designed for iOS, Android, and harmonyOS native engineers to facilitate hybrid application development. Unlike frameworks like React Native or Flutter that act primarily as rendering engines, uni-app x provides a complete application environment including page management, components, and APIs, making its integration similar to integrating a Mini Program SDK.

    Key Capabilities:

    • Progressive Integration: Embed specific pages developed with uni-app x into existing native projects.
    • Native Build Workflow: Use your own native engineering environment for packaging and releasing.
    • Seamless Interoperability: Because uts code compiles directly into native languages, interaction between native code and uni-app x code occurs via direct function calls rather than a bridge, allowing for seamless debugging (e.g., stepping from uts into Kotlin or Swift code).
    • High Efficiency: Reduces the need for platform-specific API development due to rich built-in cross-platform components and APIs.
  3. Overview of uni-app and uni-app x

    uni-app-x

    uni-app

    A framework for developing frontend applications using Vue.js. It allows developers to write a single codebase that can be deployed to multiple platforms, including:

    • Mobile Apps: iOS, Android, and HarmonyOS.
    • Web: Responsive web applications.
    • Mini-programs: WeChat, Alipay, Baidu, Douyin, Feishu, QQ, Kuaishou, DingTalk, Taobao, Jingdong, Xiaohongshu, etc.
    • Quick Apps: Supports vivo, OPPO, and Huawei.
    • HarmonyOS Service: HarmonyOS Next.

    Technical Architecture: Based on web technologies. The logic layer uses JavaScript, and the rendering layer uses a web-view.

    uni-app x

    A next-generation version of uni-app designed for high performance.

    Technical Architecture: Based on the uts language and the uvue native rendering engine.

    uts (uni-type script): A cross-platform language similar to TypeScript. It compiles to native languages depending on the target platform:

    • Android: Compiles to Kotlin.
    • iOS: Compiles to Swift.
    • HarmonyOS Next: Compiles to ArkTS.
    • Web & Mini-programs: Compiles to JavaScript.
  4. Overview of uniCloud for uni-app x

    uni-app-x

    uniCloud is a serverless cloud development service designed to reduce development and maintenance costs.

    Current Limitations in uni-app x:

    • schema2code is not currently supported.
    • uts plugins cannot call uniCloud when compiled to swift or arkts.

    Compatibility Requirements:

    • Aliyun: Requires HBuilderX 3.9+.
    • Tencent Cloud: Requires HBuilderX 3.91+.
    • Alipay Mini Program Cloud: Requires HBuilderX 3.98+.
    • clientDB: Requires HBuilderX 3.91+.
    • uniIdRouter (in pages.json): Requires HBuilderX 3.99+.
    • Secure Network: Requires HBuilderX 4.71+.
  5. Overview of uni-agent

    uni-app-x

    What is uni-agent?

    uni-agent is an AI Agent designed for the AI Coding era, moving beyond simple code completion or chat functions. It is positioned as an "agent engineer" capable of writing, debugging, testing, and publishing code autonomously.

    Unlike general-purpose AI coding tools (like Claude Code or Codex), uni-agent is specifically optimized for the uni-app (x) and uniCloud ecosystems. It is designed to facilitate "vibe Coding," where the AI performs the bulk of the implementation and the human acts as a reviewer.

    Key Features

    • Domain Expertise: Specialized in writing and managing uni-app (x) and uniCloud projects.
    • Automation: Integrated with tools that allow the agent to perform end-to-end tasks: writing code, debugging, running tests, and handling deployments.
    • Mobile Support: Supports mobile operations, allowing users to command the agent remotely.
    • Intelligent Model Switching: To optimize cost and performance, uni-agent automatically switches between models. It assigns simple tasks (like knowledge retrieval) to cost-effective models and complex tasks (like core code generation) to professional-grade models.
  6. What is uni-app x?

    uni-app-x

    uni-app x is a next-generation cross-platform application development engine. It is a large-scale engineering project composed of the uts language, the uvue rendering engine, uni components and APIs, and an extension mechanism.

    Key characteristics:

    • Native Performance: On Android, the project is compiled into Kotlin code. On iOS and HarmonyOS, it uses the Vapor mode rendering engine to achieve performance that can exceed native rendering speeds.
    • Platform Compilation:
      • Android: Compiles to Kotlin.
      • iOS: Compiles to Swift.
      • HarmonyOS Next: Compiles to ArkTS.
      • Web/Mini-programs: Compiles to JavaScript.
    • No JS Engine Requirement: Unlike the standard uni-app JS version, the Android version of uni-app x does not include a JS engine, meaning you must use uts instead of JavaScript for logic.
  7. Overview of uni-app(x) Automated Testing

    uni-app-x

    uni-app(x) provides a set of APIs to control applications for automated testing. These APIs allow you to run applications, navigate between pages, trigger clicks, retrieve page element states, and take screenshots. The testing framework is built upon Jest.

    Supported Platforms

    PlatformSupport Status
    App (Android/iOS)Supported (iOS requires Simulator)
    H5Supported
    WeChat Mini ProgramSupported
    Alipay Mini ProgramNot Supported
    Baidu Mini ProgramNot Supported
    Douyin/Feishu Mini ProgramNot Supported
    QQ Mini ProgramNot Supported
    Quick AppNot Supported
    Kuaishou Mini ProgramNot Supported
    JD Mini ProgramNot Supported
  8. Overview of uni-push

    uni-app-x

    uni-push is a unified push service co-developed by DCloud and GeTui. It allows servers to push messages to clients, supporting both online and offline push. It aggregates multiple manufacturer channels including Apple, Huawei, Xiaomi, OPPO, VIVO, Meizu, Honor (3.99+), and Google.

    Key usage scenarios:

    • Server-to-Client Push: Sending messages from your server to user devices.
    • Local Notifications: Creating local messages in the mobile notification bar without a server-side trigger.

    Important Setup Notes:

    • Android Offline Push: Requires configuring manufacturer channels in UniPush 2.0.
    • iOS Configuration: When configuring certificates, ensure push capabilities are enabled, otherwise cloud packaging will fail. You can also configure notification permission descriptions via info.plist.
  9. Overview of uni-push service

    uni-app-x

    uni-push is an integrated unified push service developed by DCloud in collaboration with Getui. It is the recommended push service for all uni-app developers. It provides a single development interface to access system-level push channels from major mobile manufacturers (Apple, Huawei, Xiaomi, OPPO, VIVO, Meizu, Google FCM) and third-party channels like Getui.

    Key Concepts

    • Push Service: A technology where the server actively sends messages to the client without requiring the client to poll the server, saving battery and reducing server load.
    • Online Push: Occurs when the app is running in the foreground via the Getui channel.
    • Offline Push: Occurs when the app is in the background, locked, or the process is closed. This relies on manufacturer-specific channels (e.g., Huawei, Xiaomi) to ensure delivery.
    • Notification Message (通知消息): Messages with a title and content that the SDK automatically displays in the system notification bar, potentially triggering ringtones or vibrations.
    • Passthrough Message (透传消息): Custom messages where the developer defines the format (e.g., JSON, plain text). The SDK only delivers the data; the client must handle the logic (e.g., showing a custom popup or notification).