This is an article I came across unintentionally titled "Tencent and DCloud recently made big moves to grab territory, Donut and uni-app x who do you choose?", and I found it interesting. In the future, the podcast may invite DCloud's Brother Bao as a guest to share. Here is an introduction.
Most of it is my own feelings, and some of it is from the original article, which I will mark.
The original article mentioned that currently, using a set of code for cross-platform development is an economical and practical choice. The current solutions include React Native, Flutter, uni-app, and taro, among others. Currently, uni-app, which has advantages in developing mini-programs in China, has been developed by Tencent as a multi-platform framework called Donut, and uni-app has developed uni-app x.
I thought they were all new things, but it turns out they're not. Here's my own introduction.
Dount#
This is something Tencent has developed.
A quick look shows that WeChat mini-programs can be converted to apps with one click, which should be easy to understand. It maps the APIs, so the capabilities that WeChat mini-programs can achieve are also available to apps, and the capabilities that WeChat mini-programs cannot achieve are also not available to apps.
For developers, they need to open the relevant permissions on the platform first. The WeChat mini-program developer tool will have an additional function, allowing local compilation to generate installation packages, so local debugging can be done, which is quite simple.
Here are a few points worth mentioning:
- It integrates well with WeChat, allowing for WeChat login, phone login, Apple login, etc. The documentation indicates that it only requires adjusting parameters to achieve this.
- Dount emphasizes the developer space, which can be compared to the developer binding of official accounts.
- In order to reduce the size, some specific platform functions are separated into SDKs, such as ws, Bluetooth, lbs modules, etc.
- The privacy agreement is also specifically introduced, as mini-programs have become more popular.
- CICD builds can support cloud builds, which consume build times.
- Message push is also built-in, using Tencent Cloud Push.
- LBS advertising, etc., are all used, and the volume is indeed large.
- I haven't seen how to introduce native SDKs for capability expansion in the source code yet.
Let's see how often it has been updated recently.
- The mobile application assistant is updated about once every one to two months.
- The iOS version has reached 1.1.2, but the time is not visible.
- The Android version has reached 1.1.0, but the time is not visible.
That's it. It's not related to open source, it's closed.
uni-app x#
One set of code compiles into Swift on iOS and Kotlin on Android, pure native, without using a JavaScript engine or WebView.
The source code is open source. https://gitcode.net/dcloud/hello-uni-app-x
Overall, it's UTS + UVue.
- UTS language - uni type script. It will be compiled into JS/Kotlin/Swift.
- Similar to TS, it has some constraints, all for cross-platform development. It doesn't have the concept of JS or a JS engine, it's its own language.
- UVue replaces HTML+CSS and can be understood as a framework based on UTS that is compatible with Vue syntax.
- After all, it's all pure native, without the communication overhead of various intermediate layers.
As expected, there is code, and it looks like Vue 2's options syntax.
- UVue does not currently support setup.
- UVue only supports flex layout.
- Some components are included, such as containers, text, images, rich text, input-related components, audio and video, etc.
- Some capabilities are still under development, mainly some component capabilities.
- So far, only Android has been implemented, and Swift for iOS is still under development.
- Automated testing is mentioned separately.
- Historical compatibility migration is mentioned separately.
Thoughts#
Starting from an article, I saw two different technical solutions:
- Converting existing projects to apps.
- Starting a new project to convert UTS to native languages.
Both are good ideas.
Dount#
However, Tencent Cloud's history of changing things as they please is a concern. I hope they can continue to develop it. If the technology is not open source, once it is abandoned, it will be lost and the experience cannot be reused. Moreover, if you use Tencent's unopened capabilities or encounter problems, you can only wait for the official solution. If you take a look at the mini-program forum, you will feel discouraged.
uni-app x#
As for UTS, I think the development workload is huge, and it requires a lot of manpower to go through it one by one.
Currently, uni-app-x is open source, so let's take a quick look at the data.
It has been invested for about half a year now, starting in early June according to the git commits. There are 21 email addresses involved, which may include cases where a company email and a personal email correspond to one person. Quite a few programmers have been involved. There have been over 600 commits in total, but of course, this is just data and doesn't represent anything.
The above image shows the records with more than ten commits, with 14 people listed according to git shortlog -sne
. The development branch is slightly ahead, but the difference is not significant.
This is the code statistics. UTS is classified as TS, and UVue is classified as Vue.js component.
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Text 1 0 0 2598
JavaScript 67 261 231 2272
JSON 15 6 0 1535
Vuejs Component 9 43 44 670
CSS 3 51 17 226
HTML 2 3 4 111
Markdown 4 21 0 51
SCSS 1 14 25 37
TypeScript 1 3 23 16
INI 1 1 0 8
XML 1 4 0 5
-------------------------------------------------------------------------------
SUM: 105 407 344 7529
-------------------------------------------------------------------------------
Ignore the first txt.
Let's see how hard it is: git log --pretty=format:"%ad" --date=short | uniq -c
Outlook#
Overall, it's quite impressive. Tencent has put a lot of effort into the platform, and uni-app has also put in a lot of effort. I also looked at the number of commits, and it's not easy. This is just what has been released as open source, and there are definitely more things that haven't been released.