WeChat Mini Program is not HTML5. It is based on WeChat’s independent development model, which can save people’s development costs and development cycles. The differences between WeChat mini programs and HTML5: 1. Differences in operating environment; 2. Differences in development costs; 3. Differences in obtaining system-level permissions; 4. Differences in the running fluency of applications in production environments.
The operating environment of this tutorial: Windows 7 system, HTML5 version, Dell G3 computer.
The full name of HTML in English is Hyper Text Markup Language, which is hypertext markup language. HTML5 is a technology, the shell it is attached to is a browser, and a mini program is an application based on WeChat that does not require downloading and installation.
From the perspective of "front-end development", there are many differences between WeChat applet and HTML5. In summary, there are four differences!
First, the difference in operating environment
The traditional HTML5 operating environment is a browser, including webview, while the operating environment of the WeChat applet is not a complete browser device. Please note that what I write here is a "non-complete browser" for the following reasons:
HTML5 related technologies (not all) will be used in the development process of small programs.
The final release of the mini program requires WeChat review. WeChat can update the mini program into its own software without updating its own software, which reminds us of the ReactNative framework. And some developers have discovered that the react and NodeWebkit libraries are used in the source code of WeChat applet development tools.
The official document emphasizes that the window object and document object commonly used in browsers cannot be used in scripts (based on this, libraries that operate DOM like zepto/jQuery have been completely abandoned).
So I think that the running environment of the mini program is very likely to be a built-in parser completely reconstructed by the WeChat development team based on the browser kernel. It is specially optimized for mini programs and matches its own defined development language standards. , improving the performance of the mini program.
However, since WeChat provides developers with development tools, and the development tools also have built-in programming, debugging, development environment, and publishing, we don’t need to discuss its final operating environment anymore. As long as we follow the official Just develop the document. And the move of the WeChat team to provide developers with development tools reminds me of the X-CODE development tools provided by Apple to developers. It can be imagined that WeChat's "ambition" is evident
Second Article, difference in development costs
Here I raise a question, when we face an HTML5 web development requirement, what do we need to consider?
Leave aside development tools (vscode, sublimtext, Atom, etc.), as well as front-end frameworks (Angular, react, vue, backbone, etc.), module management tools (Webpack, Browserify, etc.), task management tools ( Grunt, Gulp, etc.), as small as UI library selection, interface calling tools (ajax, Fetch Api, etc.), browser compatibility, etc. must be considered one by one. Even if it is not easy to use jqery plug-in to write H5, we must also consider it during the development process. Go find a suitable jquery plug-in to match the project.
Although these tools are very customizable and improve the development efficiency of developers. However, the editor believes that the configuration work of project development has consumed a lot of energy, although most developers have their own configuration templates. The long-term cost of version iterations and version upgrades of various external libraries used in the project should not be low.
And when we face the development needs of a WeChat applet, what do we need to consider? The WeChat team has provided developer tools and standardized development standards. The common HTML and CSS on the front end have become WeChat’s customized WXML and WXSS. Although WXML is all custom tags, there are clear usage introductions in the official documents. , I believe it should be very easy to get started; the writing methods in WXSS, JSON and js files are slightly restricted, but overall they are similar. After unifying these standards, as a developer, you will find that you only need to focus on writing programs:
When you need to call the back-end interface, call the request API;
When you need to upload and download, call the upload and download API;
When you need to cache data, call the local storage API;
Introducing maps, using compass, calling payment, calling scan code and other functions can be used directly;
In terms of UI library, the framework naturally comes with its own weui Library bonus;
And when using these APIs, you no longer have to worry about browser compatibility, and you don’t have to worry about unpredictable and wonderful bugs in the production environment. It can be seen that the WeChat applet The development cost is indeed much lower than previous web development.
Article 3. Differences in obtaining system-level permissions
Compared with HTML5 web applications, WeChat applet can obtain more system permissions, such as network communication status and data Caching capabilities, etc. These system-level permissions can be seamlessly connected with WeChat mini programs, which is what is officially claimed to have the smooth performance of Native Apps. This happens to be an area where HTML5 web applications are often criticized, and this is also the majority of HTML5 applications. The scenario is positioned because the business logic is simple and the function is single.
Article 4: The running fluency of applications in the production environment is different.
The easiest thing to distinguish between mini programs and H5 is that opening H5 actually opens a web page, and the web page needs to be rendered in the browser. When faced with complex business logic or rich page interactions, The page will freeze.
The WeChat applet runs directly on WeChat, eliminating the step of rendering through the browser. Therefore, using the applet in WeChat will be much smoother than H5. In addition to the loading time of a few seconds when opening for the first time, the experience of switching and jumping between various pages of the mini program is comparable to that of the native app and is very smooth.
Mini programs cannot jump to external links, and H5 has no restrictions.
In summary, mini programs have the advantages of lower development costs, richer functions, and better user experience than H5. (Disadvantages: WeChat has made many restrictions, and many things cannot be customized)
The above is my summary of the differences between WeChat mini programs and HTML5. WeChat currently has 900 million monthly active users. Especially after WeChat launched the public account, WeChat’s monthly active users have also increased significantly, which provides a very convenient entrance to WeChat mini programs. Taking 900 million as the base number, it laid the foundation for WeChat mini programs.
WeChat Mini Program is not HTML5, it is based on WeChat’s independent development model, which can save people’s development costs and development cycles.
For more programming related knowledge, please visit:Programming Video! !
The above is the detailed content of Is WeChat mini program HTML5?. For more information, please follow other related articles on the PHP Chinese website!