You can’t use a frame with a frame, not in this life.
Micro channel small program low cost, low development cost, flow dividend, low promotion cost and so on, many companies will choose small program to test the water, small program development is too popular, but the pain of the front-end engineer, and have to learn new technology… Learning makes me happy 🙄
In half a year, I have developed four small programs, including three wechat small programs and one Alipay small program. It was developed natively and the framework was used. What’s the most elegant development model? Talk, talk.
Technical solution
At present, when developing wechat small programs, there are probably a number of optional technical solutions, which are:
- Wechat small program native development
- Use the WEpy framework
- Use the MPVue framework
- Use the Taro Framework
- Other frameworks
Use the framework to develop, summed up to do one thing – sugar, but this sugar is good, not to say.
The origin of framework development
- Rapid iteration
- Reduce development costs
- Cross-platform sharing
- Improve the development experience
The Challenge (Xian) of framework Development (Shi)
- It is necessary to be familiar with wechat applet documents and third-party framework documents at the same time, which presents greater challenges for engineers
- The framework is not perfect, it is just a castrated or modified version of the front-end framework that does not support 100% of the features of the framework itself
- The framework is built on wechat applet, which leads to the invalidation of some native supported features, such as native components and modularity
- Poor framework ecology and lack of documentation and related resources
- Wechat applet itself is in a state of rapid iteration, with unstable characteristics, unlike the web, there is no unified standard
Ideal is beautiful, reality is cruel
For the WEPY framework, componentization support is not mature. In the actual development process, if the components are nested more than two layers, the probability of rolloping is very high in some special business scenarios. List rendering of components does not support the use of props, computed, watch, and so on in components of repeat.
Mpvue framework is based on the core of Vue. Js, which is a modified version of the Vue framework. It is also different from the Vue on the Web side. Meituan applets framework – MPvue pit guide
A piece of my mind
However, many features and functions added to small programs, such as WXS modules, custom components, and plug-ins, cannot be used under the control of third-party frameworks.
However, the development mode of native applets is too simple. In terms of style, students who are used to writing less, Stylus and Sass cannot tolerate the writing style of WXSS. Based on this, we decide to use gulP automatic tool to build a basic template for wechat applets development. Can also use less to write styles, while adding image compression, command line quickly create templates and other features, so development, quick zai, quick zai!
wx-miniprogram-boilerplate
Other tools will be added in the future and will be updated continuously. Your comments are welcome.