at present “ Applet ” Development and application presentation of “ blowout ” Trend , As the originator of small programs ,2021 In, wechat app developers made a breakthrough 300 ten thousand , Daily active users (DAU) Has more than 4.5 Billion , The advertising share paid by wechat for developers is nearly 10 billion . After the popularity of wechat apps , Various Internet manufacturers have launched their own small programs , such as : Alipay applet 、 Baidu applet 、 Bytedance applet 、 Apply it quickly 、QQ Applet 、360 Applet 、 Jingdong applet 、 Kwai applet, etc . Applets are relative to APP The application has several advantages :
We will gradually reduce the development cost , This point of view to explain the current small program development methods .
One 、 Native development

Advantage is : Take wechat applet as an example , Official documentation for native development 、 Video tutorial 、API Find all the specifications 、 System , The official documents are complete . And native development is closer to the bottom of mobile services , Easy to locate once problems occur , And solve the problem . The disadvantage is that : The amount of native development code is relatively large , There are few components and the style is not beautiful , Grammar is not flexible enough , The development efficiency is relatively low . And the applet syntax of different platforms is different , If the applet needs to adapt to multiple platforms , Development costs are very high .
Two 、 combination UI Framework development
In order to solve the problem of large amount of code in native development , There are few components and insufficient aesthetics , There are many interfaces for adapting to applets UI library . Typical ones are : Tencent's weui、 Commendable vantUI. The interface is used UI After the library , The amount of code is significantly reduced , The code is more concise , Improve the development efficiency and code maintainability .

These components UI The documentation of the library is also very standardized 、 systematic . It takes only a few simple steps to import a file 、 Use components , Most operations only require code handling .
3、 ... and 、 Cross end development mode
As I said before , At present, many manufacturers have launched their own small programs , Such as : Alipay applet 、 Baidu applet 、 Bytedance applet 、 Apply it quickly 、QQ Applet 、360 Applet 、 Jingdong applet 、 Kwai applet, etc , add android、IOS、H5 Mobile page , If you develop a set of small programs for each platform , Then the development cost is very high . So there is a cross - end development framework , Hope to write a set of code , You can automatically generate applets that adapt to multiple platforms 、H5、android、IOS. There are still many such frameworks , It is roughly divided into two factions
Among them, due to domestic vue The ecology is better ,uniapp Almost reused vue grammar , Therefore, the learning cost is relatively low . Component libraries and plug-ins are very rich , suffer greatly vue Developers love . Here the author would like to uniapp To call out injustice , Because many developers have always believed in “ The moon abroad is relatively round ”, Often mentioned uniapp When , Someone will jump out and point out “ This is not acceptable. 、 That not line ”, But my team has used uniapp Developed a number of cross end mobile applications , Overall, it's good . As long as you don't use it to develop applications that are highly integrated with mobile hardware ( For example, applications that connect various mobile phone sensors ),uniapp It can fully meet your development needs . The problem of non-standard documents has been criticized before ,uniapp It is also constantly improving . most important of all :uniapp The number of users is very large , Once a problem arises, you can communicate the solution with a large number of developers .
Of course, the disadvantage of using a cross - end development framework is : The cost of troubleshooting problems is high , When encountering a framework, there are bug Or unsupported functions , We can only expect an official update . Of course , I still want to introduce my own experience :
As long as you don't use it to develop applications that are highly integrated with mobile hardware , It's not a big problem , All can be solved .
Of course, it doesn't mean , Unable to develop applications combined with mobile phone hardware , It's like calling a cell phone GPS Get latitude and longitude 、 Make a phone call 、 compass 、 Bluetooth and other author teams have also developed , Performance comparison andoid、IOS、 The native applet will be a little worse , But the overall is also available . at present uniapp Supported hardware devices API as follows :

Four 、 Low code development
Developers are getting lazier and lazier , I think the future of programmers must be low code 、 Artificial intelligence to develop , Future developers only need to write very little code to complete functions that are unimaginable today . although “ Low code ” At present, it is still chicken ribs in many fields , But in the field of small program development , Low code is already quite feasible , After all, an important part of small program development is interface design . therefore , Visual page platform , By dragging and dropping components 、 Enter the configuration to change the style and behavior of the component , Then automatically generate code . This low code platform for small programs came into being , Like Tencent's WeDa.

5、 ... and 、 Development of cloud
Finally, let's talk about cloud development , At present, I only know that this development method is “ Wechat applet ” Provide . The main problem it solves is : At present, the core work of developing small programs is still the design and front-end implementation , Many small program developers are front-end developers , There's a problem : Front end developers have no background data , Unable to develop independently . Cloud development came into being !
Cloud development does not need to build its own background services , You can get the data of the server by calling the cloud function that operates the database . Even if only the front end , Can also develop a complete small program . Of course, these cloud services at the back end need to be paid !
summary
Finally, anyway , The core of applet development is still front-end development , namely : Development interface 、 Business logic for interaction and some data requests . You need to master the most basic HTML+JS+CSS, It's not exactly the same , But it's the same . At present, cross - end development is still the mainstream development method , So it's best to master a front-end frame first ,vue perhaps react.
原网站版权声明
本文为[InfoQ]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207072000162359.html