美文网首页
About Applet Subcontracting

About Applet Subcontracting

作者: love_peaches | 来源:发表于2023-03-23 10:22 被阅读0次

    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

    相关文章

      网友评论

          本文标题:About Applet Subcontracting

          本文链接:https://www.haomeiwen.com/subject/fxhirdtx.html