Joke Collection Website - Blessing messages - Briefly describe the principle of WeChat applet

Briefly describe the principle of WeChat applet

the principle of wechat applet includes architecture and running environment, and dual-thread model.

1. Architecture and running environment: The architecture of WeChat applet is data-driven, ui and data are separated, and all page updates need to be realized by changing the data. The code of applet runs in WeChat app instead of the traditional browser environment, so the application of some h5 technologies is limited, and WeChat app needs to provide corresponding api support. At the same time, the applet provides some unique APIs, which are not supported or not well in h5.

2. Double-thread model: The logic layer and the rendering layer of applet are separated. The logic layer runs in jscore, and there is no complete browser object, so there is no related domapi and bomapi. At the same time, the environment of jscore is different from that of nodejs, so some npm packages can't run in applet. This double-thread model leads to the data transfer between the logic layer and the view layer, which has a certain delay.

3. Wechat is a communication product launched by Tencent on January 21, 211. It mainly sends voice messages, videos, pictures and texts through the network, and supports multi-group chat and file transfer between mobile phones and computers. Wechat software itself is completely free, and there is no charge for using any function. The Internet traffic fee generated by Wechat is charged by network operators, which supports sending voice messages, videos, pictures and texts, and supports Weibo, email and text.