About Applet Subcontracting

1.Why use the "subcontracting loading" scheme for miniProgram?

WeChat applets limit the code package to no more than 2MB, and the size limit is a consideration for the startup speed of the applet. However, the 2MB size severely limits the expansion of the applet's functionality, and business needs may require a larger size. Taking into account WeChat's comprehensive launch of the "package loading scheme"

2.Benefits of Subcontracting

The benefits of subcontracting small programs mainly include the following two points:
1.Can optimize the download time of the first startup of the applet
2.Better decoupling and collaboration when working with multiple teams

3.Composition of the project before subcontracting

Composition of the project before subcontracting
Before subcontracting, all the pages and resources in the applet project were packaged together, resulting in the overall project being too large, affecting the download time for the first launch of the applet, and even being unable to publish

4.Composition of the project after subcontracting

After subcontracting, the mini program consists of 1 main package+multiple subcontracts
4.1 Main package: Generally, it only includes the startup page or TabBar page of the project, as well as some public resources required for all subcontracting
4.2 Subcontracting: Contains only pages and private resources related to the current subcontracting

5. Loading rules for subcontracting

5.1. When the miniprogram starts, the main package will be downloaded by default and the page inside the main package will be launched
The pages contained in the tabBar need to be placed in the main package

5.2.When a user enters a page within a subcontract, the client will download the corresponding subcontract and display it after the download is completed
Non tabBar pages can be divided into different sub packages based on their functions, and then downloaded on demand

6.Volume limits for subcontracting

Currently, there are two limitations on the size of applet subcontracting:

6.1.The size of all subcontracts of the entire applet should not exceed 16M (main package+all subcontracts)
6.2.The size of a single subcontracting/main package cannot exceed 2M

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 用两张图告诉你,为什么你的 App 会卡顿? - Android - 掘金 Cover 有什么料? 从这篇文章中你...
    hw1212阅读 13,131评论 2 59
  • Getting Started Use the Current Stable Version (7.1) Buil...
    Leonzai阅读 1,994评论 0 3
  • 本指南的目的是帮助您确定潜在的问题,并就如何将现有的Java应用程序迁移到JDK 13发行版提供建议。 该指南还重...
    雨笋情缘阅读 1,318评论 0 0
  • afinalAfinal是一个android的ioc,orm框架 https://github.com/yangf...
    passiontim阅读 15,642评论 2 45
  • afinalAfinal是一个android的ioc,orm框架 https://github.com/yangf...
    wgl0419阅读 6,427评论 1 9