Learn not move! The official launch of micro-channel front-end Web applets and unified framework Kbone

I heard recently launched a micro-channel official unified front-end Web and applets framework - Kbone, specifically to see the next. . .

Why engage in micro-channel Kbone?

Different models and bottom ends of the micro-channel Web applet, the Web developer can not directly moved side code execution environment within the applet.

Birth Kbone is to solve this problem, it implements an adapter to simulate a browser environment in the adaptation layer, let the end of the code for the Web can not change anything, you can run a small program.

So Kbone What are the advantages?

Because kbone is achieved by providing an adapter homogeneous way, so its advantages are obvious:

The most popular front-end framework can run on kbone, such as Vue, React, Preact and so on.

A more complete front-end frame support characteristics, as the underlying framework will not kbone pruning (such as the v-html Vue instruction, Vue-router plug).

It provides a common dom / bom interface that allows the user code does not need to do much change can migrate from the Web to the small end of the program end.

In the end the applet is running, you can still use the characteristics of the small program itself (such as live-player built-in components, sub-function).

Provides some Dom expansion interface, so that some can not be perfectly compatible with the small end of the program interface also has an alternative use of the program (such as getComputedStyle Interface).

In the end how to choose?

In fact, the industry there have been many solutions on isomorphic, and each program has its own pros and cons, scheme perfectly solve all the problems does not exist. kbone too, its advantages mentioned above, but it also brings its lack of realization of the principle.kbone is the use of certain performance loss, in exchange for a more comprehensive Web-side features support.

Therefore, regarding the performance, if your performance on the applet particularly harsh, it recommended direct use of native small program development; if the number of your pages node particularly large (typically 1,000 nodes or more), but also to ensure that remains in the number of nodes infinite rise stable rendering performance, you can try using a static template translation industry program; otherwise it can be directly used kbone up.

Kbone to use, or see the official documents it:

https://developers.weixin.qq.com/miniprogram/dev/extended/kbone/

Guess you like

Origin www.cnblogs.com/chinb/p/12386783.html