Applets micro-channel open multiport frame kbone

Appropriate use field scene

kbone is a dedicated micro-channel and Web applet ends homogeneous solution.

The underlying model micro-channel and Web applets different end, we want to code directly to the Web side moved to within a small program execution environment is impossible. birth kbone is to solve this problem, it implements an adapter that simulates adaptation layer in a browser environment, so that the code can not do what the Web side of change can run a small program. In this way, we can help achieve rapid kbone Web project into small micro-channel project.

Program to achieve

Design has the following premise:

  • For a better reusable components, as complete as possible end support Web features

  • In rendering results applet as close as possible to the end of the end h5 Web page

So, with the other isomorphic different framework, kbone by way of adapters to support.

Adapter consists of two parts: responsible for providing dom / bom api's js libraries and custom components responsible for rendering, which is miniprogram-render kbone in and miniprogram-element, you can see a small program code generated kbone final two years will depend on a npm package. In addition to a need to generate WebPACK plug applet code according to the original Web server source code, the program code packages and because of the small end of a different code for the Web, it has a fixed structure, and this is plug mp-webpack-plugin.

miniprogram-render, miniprogram-element and mp-webpack-plugin package that is three kbone the core .

Frame advantage

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

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

  2. 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).

  3. 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.

  4. 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).

  5. 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).

Not all programs are impeccable, as everyone has strengths and weaknesses, kbone no exception.

kbone is the use of certain performance losses in exchange for a more comprehensive Web-side features support.

Open source exchange

We look forward to kbone open source, how to help end demand for more projects to solve practical problems, but also hope to better improve kbone itself, if you are interested in kbone, welcome Issue and PR! About Kbone use what you have questions or suggestions, please visit Kbone Community Home post exchange (PC web client can post)

G I T H U B -Open Source to address : 

https://github.com/Tencent/kbone

( Point Click the text at the end read read the original text directly connected to visit ask )

Please give kbone A th S T A R & lt !  

Huan welcome put out your of I S S U E and P R & lt !   

 States in the mirror like to address :

https://git.code.tencent.com/Tencent_Open_Source/kbone

( Gordon recorded after only able to visit and asked the public open entry projects )

Teng information worker bees source code -based system for the open source apart development are provide for complete whole , most new of Proton hearing open source term project States the mirror image

Published 43 original articles · won praise 17 · views 50000 +

Guess you like

Origin blog.csdn.net/tencent__open/article/details/104528809