Home >WeChat Applet >Mini Program Development >What is the difference between mini programs and ordinary web development?
The main development language for small programs is JavaScript. The development of small programs is very similar to ordinary web development. For front-end developers, the cost of migrating from web development to mini program development is not high, but there are still some differences between the two.
The web page development rendering thread and the script thread are mutually exclusive, which is why long-term script running may cause the page to lose response; in small programs, the two are separated and run in different in thread. Web developers can use the DOM API exposed by various browsers to select and operate DOM.
The logic layer and rendering layer of the applet are separated. The logic layer runs in JSCore and does not have a complete browser object, so it lacks related DOM API and BOM API. This difference causes some libraries that are very familiar to front-end development, such as jQuery, Zepto, etc., to be unable to run in small programs. At the same time, the JSCore environment is different from the NodeJS environment, so some NPM packages cannot be run in small programs.
The environment that web developers need to face is a variety of browsers. On the PC side, they need to face IE, Chrome, QQ browser, etc.; on the mobile side, they need to face Safari, Chrome, iOS, and Android Various WebViews in the system. What you need to face during the development process of mini programs are the WeChat clients of the two major operating systems iOS and Android, as well as mini program developer tools for assisting development. The three major operating environments of mini programs are also different, as shown in the table 1 shown.
Table 1 Running environment of the mini program
Running environment | Logical layer | Rendering layer |
---|---|---|
iOS | JavaScriptCore | WKWebView |
Android | V8 | Chromium Customized Kernel |
Mini Program Developer Tools | NWJS | Chrome WebView |
Recommended tutorial: "WeChat Mini Program"
The above is the detailed content of What is the difference between mini programs and ordinary web development?. For more information, please follow other related articles on the PHP Chinese website!