Introducing uni‑app x: A Next‑Generation Cross‑Platform Framework Compiling to Native Kotlin and Swift
uni‑app x is a new DCloud product that uses the UTS language (a TypeScript‑based superset) to compile Vue‑style code into native Kotlin for Android and Swift for iOS, promising native‑level performance while retaining familiar cross‑platform development workflows.
uni‑app x is presented as the next generation of the popular uni‑app framework, allowing developers to write applications with Vue syntax, uni components, and the UTS language, which then compiles directly to native Kotlin (Android) or Swift (iOS) instead of using a JavaScript engine or WebView.
Principle Overview
Unlike the original uni‑app that relied on JavaScript for cross‑platform compatibility, uni‑app x replaces JavaScript with UTS, a language introduced by DCloud in 2022. UTS is built on TypeScript, adding static typing and integrating features from Kotlin and Swift to become a truly cross‑platform compiled language.
UTS compiles to different targets:
Web → JavaScript
iOS → Swift
Android → Kotlin
DCloud also created the uvue UI engine, which lets developers use Vue syntax together with uni components and APIs, producing the final uni‑app x application.
Case Studies
Several early adopters have released products based on uni‑app x, and the HBuilderX IDE now offers the 3.98 milestone version capable of supporting commercial applications.
KuaiYi Mall
A complete cloud‑based e‑commerce solution covering client, server, and management back‑end.
t‑uvue‑ui
A rich UI component library that helps developers, even those less experienced with UI design, accelerate development.
uXui
An open‑source component library authored by the creator of graceui (see https://ext.dcloud.net.cn/plugin?id=15726#detail).
Quick Experience
Developers can try uni‑app x by writing familiar Vue‑style code that compiles to a native Android APK. Example:
<template>
<view class="content">
<button @click="buttonClick">{{title}}</button>
</view>
</template>
<script> // Note: this is UTS, a TypeScript variant
export default {
data() {
return { title: "Hello world" }
},
onLoad() { console.log('onLoad') },
methods: {
buttonClick() {
uni.showModal({ "showCancel": false, "content": "Button clicked" })
}
}
}
</script>
<style>
.content { width: 750rpx; background-color: white; }
</style>The compiled APK can be downloaded from https://uniappx.m3w.cn/ or via the QR code provided.
Quality Assurance
uni‑app x emphasizes product quality from the start, supporting automated testing out of the first release, with dozens of test projects and hundreds of thousands of test lines. Continuous nightly testing monitors functionality, startup speed, package size, and memory usage.
Plugin Competition and Ecosystem
Because UTS compiles to Kotlin, any Android SDK or third‑party library can be used directly. Example of calling a native Android API:
<script>
import Build from 'android.os.Build';
export default {
onLoad() {
console.log(Build.MODEL); // native Android API
console.log(uni.getSystemInfoSync().deviceModel); // uni API, same result
}
}
</script>Both uni‑app x’s own APIs (implemented in UTS) and native Android APIs are accessible, and the framework can also integrate other native SDKs such as Flutter, React Native, Cocos, and Unity.
Several official plugins (App Upgrade Center, uni‑id‑pages‑x) and third‑party projects (KuaiYi Mall, exam template, short‑video template) are already available, along with UI libraries like t‑uvue‑ui and easyX e‑commerce components.
Roadmap
UTS supports both iOS and Android, but the uvue engine for iOS is still under development, so currently uni‑app x only supports Android. The web version is in testing, and the iOS version is planned before the end of the plugin competition.
Adaptation for HarmonyOS (which uses arkTS) is being discussed, as both languages are TypeScript variants.
Invitation
Developers are encouraged to explore uni‑app x, read the official documentation at https://uniapp.dcloud.net.cn/uni-app-x/, and participate in the plugin competition for a chance to win rewards.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Rare Earth Juejin Tech Community
Juejin, a tech community that helps developers grow.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
