Analysis of Taobao small program plug-in

Writing in the front

I have worked as an intern in Taodepartment for one month and participated in the construction of several scenes, including the development of Taobao small program plug-ins. The following is the author of taobao small program plug-in (hereinafter referred to as plug-in) some views (combined with official documents, plus the author’s humble opinion).

The plug-in itself

When we see the word plug-in, we think it refers to some extension. Taobao small program plug-in is an extension of taobao small program service ability, and enriches taobao small program ecology.

A plug-in is a wrapper around a set of custom components, pages, or JS interfaces. Plug-ins cannot run independently and must be embedded in applets to be used. And small programs in the use of plug-ins, plug-in code is not seen. Therefore, plug-ins are suitable for encapsulating their own functions or services for small programs to use. Plug-ins are more independent than regular JS files or custom components, with separate apis, domain name lists, and so on, but subject to some limitations. Plug-in API permissions are verified independently of third-party applets.

Plug-in development is similar to applets in that the plug-in developer writes and uploads the plug-in, and then releases the plug-in before the applets can use it. The plug-in shelf is subject to control, requiring background audit, effectively restricting bad behavior, control the quality of plug-in.

So taobao small program plug-in design is centralized control, distributed existence.

Principle of plug-ins

Plug-in code consists of custom components and JS code files that are uploaded to the applets platform for storage when the plug-in developer publishes the plug-in. When the plug-in is used by the small program, the user can fill in the AppID and version number of the plug-in and get the corresponding plug-in code from the background. When the applet is called, the uploaded plug-in code is downloaded and run along with the applet.

Plug-in acquisition and use

Some potholes may be encountered when using plug-ins, which can be solved by carefully reading the official documentation

  • Miniapp.open.taobao.com/doc.htm?doc…
Plug-in development and launch

If you have experience developing mainstream JS frameworks (react, Vue), you can get started with API documentation

  • Miniapp.open.taobao.com/doc.htm?doc…
Advantages of plug-ins
  • Enhanced versatility: Plug-ins of Taobao mini programs are universal, and the qualification requirements of categories are reduced. Enterprises can directly apply for use to realize service sharing.
  • Reduce the technical threshold: many functions are not simple, and this kind of complex service implementation (such as calendar, map) is packaged, developers can directly call, coupled with simple basic code, can realize the development of functions, effectively reduce the development difficulty of developers.
  • Save development cost: The plug-in function can shorten the development cycle of small programs, save research and development costs, and bring more flexibility to small program developers.
other
  • Plug-in development and use is supported since applets base library version 1.18.0.

  • Applets are protected by data security isolation between applets and each plug-in they use to ensure that they cannot steal data from each other.

  • Taobao small program plug-in supports mobile and PC (Windows only)

The official documentation

Miniapp.open.taobao.com/docV3.htm?d…