Today’s main analysis understanding small program development ecological solutions, especially technical solutions, and development tool chain.

Applets development process overview

First, if you have your own small program can be converted into intelligent small program through the migration tool. Second, use the third party framework, the application layer of the architecture, access to our third party framework. Developers in the development of debugging, there is no problem in the development tool, and then on the phone to preview, testing no problem, you can be released to the background, you can be baidu want to change the array such as the tune up to download, can be web, H5 browsing. Today’s focus is on access.

Technology grading solution

When we want to access baidu to develop small procedures, will face a technical level of the problem. Then you will face both situations, from zero development, or have wechat applets. If you haven’t developed applets before, develop from scratch. You can choose to use native development or application layer framework development.

No development of small programs, from zero development

Native development

Native development, is to use Baidu this set of intelligent small program development, divided into view layer and logic layer. Our view layer is similar to H5 language, not in HTML, but in SWAN file, and the markup language is different from H5. If you are developing native applets, you need to refer to our tags, which are available in native tools, as well as custom tags, bound events, control flows, properties, and expressions. The logical layer defines its own life cycle, mainly within the page, which is invoked for transitions and switches, unlike the WEB. This is our own declaration cycle and event response, basically data management, data driven, very traditional way, very low cost to get started.

Application layer framework development

Application layer framework access, cross-platform is always the eternal theme of software development. And cross-platform solutions, want to run on Baidu small program, and want to run on wechat small program, and want to run on the WEB, or other platforms, there is no solution? You can use the source code of the framework layer, after compiling, can run on their respective platforms. Taro, Mpvue and WePY are two well-known frameworks. Taro, Mpvue and WePY are very active and constantly iterating. We also cooperate with these three frameworks to develop and optimize small programs.

The five characteristics of WePY framework are more in line with the existing MVVM framework development mode, like VUE, saving the time to learn small program syntax; Component-based development, support component loop, nested, component Props value, component communication, custom events, third-party components; NPM package management, support NPM resources, deal with the dependence of NPM resources; Support ESNext specification to improve development experience and embrace developers; Detail performance optimization, setData performance optimization (dirty detection), event parameters, compilers (Babel, Ts, Less, Sass), Mixin.

The four characteristics of Mpvue framework are the thorough componentized development. It uses the Vup. Js component mechanism to develop small programs and realize the reuse of small programs and H5 components. Complete Vue development experience, Vue component specification, Vuex implementation; Based on Mpvue small program, can be converted to H5, based on Vue development of H5 can also be converted to small program; NPM package management.

Taro framework is characterized by the React style, which reduces the learning cost of small program development; JSX processing, using JSX as a template, compared with string template, more free, natural, more expressive, does not rely on string template syntax sugar, can also complete complex processing; The data template update idea and implementation mechanism of applets are similar to React. React’s cross-terminal solution can bring great convenience to Taro’s later multi-terminal development.

If you have developed wechat mini program

Hierarchical access solution – Migration tool

Use the migration tool for hierarchical access, input the code of wechat small program, enter the name of wechat small program, can reach 80% of the migration, but for example, login needs to be processed. The migration tool can implement code relocation, view transformation, conversion log, syntax transformation, etc., and can carry out secondary development, meaning two versions. That is, from the time node of migration, there are two sets of versions for modification and maintenance.

Baidu intelligent small program native development + WX2swan migration tool native development, Taro framework, Mpvue framework, and WePY framework three frameworks, compared from different dimensions, syntax specification, style specification, componentalization, cross-small program platform, multi-terminal reuse, automatic construction, starting cost, data flow management, there is no good or bad points, There is only suitability. Therefore, according to their own needs, such as technology stack, framework, choose their own suitable architecture.

There are two options for developing from scratch: native development and framework development. The existing micro channel small program also has two choices, the original micro channel development and framework development.

Development tool chain

Development tools include editors, simulators, debuggers, remote debugging, moving tools, compilation tools, and previews. The function of the simulator is real computer simulation, multi-platform switch, forget to limit the simulation, size self-adjustment. Editor function is code completion, code highlighting, multiple file type support. Debugger functions are Swan node style debugging, Console input and output debugging, Sources code breakpoint debugging, Network Network capture debugging, Storages edit display debugging, AppData edit display debugging, Sensors compass gravity sensor debugging. The function of remote debugging is to run the real machine, PC remote debugging, quickly locate problems. The compiler features support for CMD/AMD/ custom mode compilation, as well as support for hot compilation.

Finally, Baidu intelligent small program, looking forward to your joining.