Since Baidu first proposed the concept of light applications in 2013, many apps with large traffic, such as Alipay and WeChat, have launched mini programs with the help of their own platforms. The advantages of mini programs are obvious: lightweight, no need to install, ready to use, and performance comparable to native applications. More importantly, they can give full play to the advantages of their respective platforms to bring more exciting and richer user experience. When developing mini-programs, we have to mention JavaScript and Node.js. What is JavaScript?
JavaScript actually has nothing to do with Java. Its official name is ECMAScript. It is an interpreted scripting language that can be embedded in HTML and then run in a browser. As we all know, HTML is a description file for a web page. It is static, and JavaScript can add dynamic content to these static pages, so it is essential in front-end development. The reason why JavaScript was popular in the early days was that it was powerful and could achieve great results on the client side without the need for a server, making web pages in the browser no longer dull and lifeless! However, it was also because of the dynamic nature of JavaScript that the security performance of the website could not be effectively guaranteed, so it was also criticized a lot! In 2009, with the release of Node.js, which encapsulated the Chrome V8 engine, JavaScript was reborn and became a powerful tool for server-side development, just like PHP, Python and other languages. Today, various JavaScript-based frameworks emerge in an endless stream, not only in front-end development, but also in the field of hybrid development, with the emergence of excellent frameworks such as React Native and Angular UI. Why JavaScript?When developing mini-programs, why do everyone choose JavaScript? First of all, it is inseparable from its inherent advantages, namely cross-platform, object-oriented, event-driven, etc. Secondly, Node.js brings powerful server environment support. Node.js's single-threaded, asynchronous I/O, event-driven and other features can solve the high concurrency of applications, and the powerful V8 engine to interpret JavaScript is just right for the business characteristics of mini programs. Therefore, building a small Node.js server on the platform side and then developing small programs with JavaScript has become the best solution for existing platforms. Mini Program Infrastructure
Exploring the development of mini-programs on major platforms, it is not difficult to find that they are basically composed of 4 types of files: One is the XML file used to describe page information (equivalent to the HTML file on the Web); The second is the XCSS file (CSS style file, X may have different letters on different platforms) used to beautify the page; The third is the JavaScript file used to handle events (standard JS file); The fourth is a JSON file used to declare configuration (path, information, etc.) (or other files used to describe configuration information, but JSON is the most common, after all, everyone is familiar with it and it is most suitable for JavaScript). In fact, the frameworks of mini-games and mini-programs are similar, but mini-programs may not require too many pages, so some will omit page files and CSS files, and are mainly developed based on H5's Canvas (supporting both 2D and 3D WebGL). Why not use H5?Many friends who have developed H5 applications may also wonder why the platform’s mini-programs do not use H5 directly, but instead set up their own portals and define their own specifications? First of all, the presentation formats of each platform are different, that is, the controls used are very different. H5 cannot be better adapted to different platforms, but will reduce user experience satisfaction. Secondly, each platform has its own unique API system, and H5 development cannot adapt to all of them. In short, the differences in platforms and resources determine the differences in specifications. Instead of adapting and compromising, it is better to set your own rules and then give full play to your greater advantages! Explore Toutiao Mini ProgramToutiao's mini program has been under development in secret. I had some free time these two days and looked at the API. Compared with other platforms, it is not particularly different. The Toutiao mini program fully combines its scenarios: large-traffic entrances (search, Weitou, my page), content matching (personal homepage, article details page, short video details page), advertising placement (advertising, channels, wallets), etc. However, it is still relatively weak in areas such as data storage, file storage, and cloud development. After all, Toutiao’s cloud product has not yet appeared (I wonder if it will be made?). Since it has not yet been officially launched, the experience in the beta version is quite good and it is worth looking forward to! The future of mini programsRelying on the charm of the platform, the mini program has demonstrated its unique advantages. The platform has also tried every possible way and strategy to connect with the characteristics of its own platform. At this stage, people’s acceptance of mini programs is still limited, and what people are most worried about is the bloated and chaotic platform brought by mini programs. Regardless of whether you are worried or not used to it, mini programs will become a development trend. With the development of cloud computing and 5G, mini programs will definitely bring about breakthrough development. Friends who want to learn programming, don’t focus on big data and artificial intelligence all day long. Starting with JavaScript is also a good choice! |
<<: Google hires macOS veteran to develop Fuchsia OS: accelerate replacement of Android/Chrome OS
>>: Tracking you 340 times a day, welcome to the era of zero privacy
This article focuses on the three most popular AP...
D.Phone : : : : : : : : : : : : : : :...
At midnight on February 1st, the 2021 Alipay Five...
The 618 e-commerce festival is coming soon, and m...
If your brand word appears when searching for a k...
Some time ago, the topic of MIUI 12 system having...
A classmate among my followers found me and asked...
This is a brand marketing operation manual that I...
This document introduces two contents: the first ...
The fission gameplay template is important, but w...
We often say that the biggest difference between ...
This article will explain from the thinking level...
Apple App Store is one of the two largest mobile ...
As an audio product, Himalaya has attracted a lar...
Recently, relevant personnel of Qinggua Media hav...