Home  >  Article  >  WeChat Applet  >  How to develop small programs efficiently? Recommend an absolutely easy-to-use open source framework for small programs

How to develop small programs efficiently? Recommend an absolutely easy-to-use open source framework for small programs

php是最好的语言
php是最好的语言Original
2018-07-28 17:30:2912451browse

This article recommends to you an absolutely best open source framework for small programs. Mini programs are very popular at the moment. How can you do it if you don’t know how to develop it? However, developing WeChat mini programs is always very tedious and a headache. You have to look up various information. It took me several days and a half to figure out a clue. Anyway, I am a slow learner. Sometimes I've been holding back some knowledge for a long time and can't figure out what's going on. The purpose of writing this article is to give everyone a reference direction and a choice. I hope it can help everyone. Let’s learn together. apache php mysql

How to develop small programs efficiently? Recommend an absolutely easy-to-use open source framework for small programs

Give some examples


1. mpvue

mpvue is an open source front-end framework developed by Meituan-Dianping that uses Vue.js to develop small programs. The framework is based on the core of Vue.js. mpvue modifies the runtime and compiler implementations of Vue.js so that it can run in a mini program environment, thus introducing a complete Vue.js development experience for mini program development. Using mpvue to develop small programs, you will gain the following capabilities based on the technical system of small programs:

  • Thorough component development capabilities: Improve code complexity Usability

  • Complete Vue.js development experience

  • Convenient Vuex data management Solution: Convenient to build complex applications

  • Fast webpack construction mechanism: Customized build strategy, hotReload during development

  • Support the use of npm external dependencies

  • Use the Vue.js command line tool vue-cli to quickly initialize the project

  • H5 code conversion ability to compile into small program target code

2, Tina.js

Tina.js is a lightweight progressive WeChat applet framework.

Features: Light and compact. It is extremely easy to get started and retains most of the API design of MINA (the official framework of WeChat mini programs); whether you have experience in mini program development or not, you can easily transition to get started. Progressive enhancement includes both state manager and routing enhancement, and you can also write your own plug-ins.

3. Taro

Taro is a set of React syntax specifications created by JD.com - Aolu Lab. Multi-terminal unified development framework. If I remember correctly, it was recently open sourced.

Using Taro, we can only write a set of code, and then use Taro's compilation tool to compile the source code separately and then compile it on different terminals (WeChat applet, H5, App terminal, etc. ) to run the code. At the same time, Taro also provides out-of-the-box syntax detection and automatic completion functions, which effectively improves the development experience and efficiency.

4. wepy

WePY is a framework that allows small programs to support component development through pre-compilation This method allows developers to choose their favorite development style to develop small programs. The detailed optimization of the framework, the introduction of Promise, and Async Functions are all designed to make developing small program projects easier and more efficient.

Features:

  • ## Vue-like development style

  • Support custom component development

  • Support the introduction of NPM packages

  • Support Promise

  • Support ES2015 features, such as Async Functions

  • Supports multiple compilers, Less/Sass/Styus, Babel/Typescript, Pug

  • Supports multiple plug-in processing, file compression , image compression, content replacement, etc.

  • Support Sourcemap, ESLint, etc.

  • applet Detailed optimization, such as request queuing, event optimization, etc.

5, weweb

weweb It is a front-end framework that is compatible with the syntax of mini programs. You can use the writing method of mini programs to write web applications. If you already have a mini program, you can run your mini program in the browser.

Features: Cross-platform, one set of code runs on multiple terminals (mini program, h5, directly packaged into Android and ios apps in the future is not a dream) Comes with common components , perfectly inherits the built-in components of the mini program and is compatible with the rpx syntax of the mini program, making it easier for the page to adapt to various models

Component library

There are also various open source Component libraries, for example, include the following:

有Likezanui-weapp and iview are two of the more famous ones.

I have recommended these two component libraries on my official account before. I will not introduce the specific usage and functions. You can find my previous tweets or search them yourself. It's very clear. Usage is very simple.

Key points

The above introduces 5 open source frameworks and two component libraries. I am not saying that the above are not good. The above are definitely very good, regardless of the above. Several open source frameworks and component libraries are products from major manufacturers, and they are all very good. But they are just an open source framework, an open source framework, and a component library is a component library. It has never satisfied my pain points of developing WeChat mini programs alone.

One of the easy-to-use open source frameworks for small program development, and the other is a rich component library. The official ones alone cannot meet our needs. The above frameworks and component libraries are divided. So it doesn't solve my pain points. The open source framework I recommend today can not only provide a framework but also enrich and extend many components, so that we don’t have to worry about encapsulating the components ourselves when developing.

In fact, the component library shared above has a major shortcoming. Their component library is rich enough, but the customization of styles is very rigid and inflexible, but today's one is much more flexible. .

The open source framework I recommend to everyone is: touchwx.

Touch WX is a completely free WeChat applet development framework that contains rich UI controls to supplement official components. The features are as follows:

1. Component expansion:

Added more than 30 commonly used components for official components of supplement.

#2. Function expansion:

Compatible with Alibaba’s iconfont icon library, massive vector icons can be used at will; added Commonly used style libraries, supports less syntax, supports global configuration of theme colors, etc.

3. Development experience improvement:

The four-file method is changed to a single-file method, developed through the VSCode editor plug-in, and has web development experience;

4. The small program is converted to H5 application:

# can be converted to and from the H5 development framework Touch UI project and published into a webApp. Develop one set of code and have two sets of applications.

The principle of this framework is:

Compile the code written in the Touch WX project and directly The output is the original code of the WeChat applet project. The expanded more than 30 components are completely implemented based on the official custom component mechanism of the mini program (except row&col).

So it supports all the syntax of mini programs. How to develop mini programs is how to develop Touch WX.

However, because it is a single-file development method, the code structure of the file is slightly different. Please note this.

The advantages of this are:

1. The migration cost for developers is very small.

You can easily transplant existing small programs into Touch WX projects to use its expansion capabilities;

2. Easy to troubleshoot errors.

#When encountering a problem, developers can also view the output original code of the mini program at any time to locate the problem. You won’t be confused whether it’s a problem with the framework or your own code;

3. Compile on demand

Since mini programs have size restrictions, when developing using a framework, only the components used will be compiled and output as mini program source code. Unused ones will not be output.

#4. No dependence on the framework.

#If you don’t want to use this framework in the future, you can directly maintain the output mini program project.

Currently, I think that for small program development alone, this open source framework is the most suitable for us and the most efficient.

Finally, everyone can do it.

Today’s sharing is all compiled for you after I have used it. They are all very good. You can forward them to let more people know.

Related articles:

Top Ten Open Source Android Application Development Frameworks

Introduction to the Labrador Framework for Component Development of WeChat Mini Programs

Related videos:

WeChat Mini Program Practical Development Video Tutorial

The above is the detailed content of How to develop small programs efficiently? Recommend an absolutely easy-to-use open source framework for small programs. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn