当前位置:网站首页>Mini Program--Independent Subcontracting & Subcontracting Pre-download
Mini Program--Independent Subcontracting & Subcontracting Pre-download
2022-08-01 21:35:00 【like Feynman %】
1. What is independent subcontracting
Independent subcontracting is essentially subcontracting, but it is relatively clear and can be run independently of the main package and other subcontracting
2. The difference between independent subcontracting and ordinary subcontracting
The main difference: whether it depends on the main package to run
- Ordinary subpackage depends on the main package
- Independent subpackage can run independently without downloading the main package
3. Application scenarios of independent subcontracting
Developers can configure certain pages with certain functional independence to independent as neededIn subcontracting.Here's why:
- When the applet restarts from the normal subpackage page, the main package needs to be downloaded first
- The independent subcontracting can run without relying on the main package, which can greatly improve the startup speed of the subcontracting page
4. Configuration method of independent subcontracting ("independent": true)
"subpackages": [{"root": "packageA","name": "p1","pages": ["pages/cat","pages/dog"]},{"root": "packageB","name": "p2","pages": ["pages/apple","pages/banana"],"independent": true}],
5. Citation principles
Independent subcontracting, common subcontracting and main subcontracting are isolated from each other and cannot reference each other's resources, for example:
- Main packageCannot referenceprivate resources of independent subcontracts
- Between independent subcontracts, cannot refer to each otherprivate resources
- Between independent subcontracting and common subcontracting, cannot refer to each otherprivate resources
- Special attention: public resources in the main package cannot be referenced in independent subcontracts
6.1 Subpackage pre-download refers to: when entering a certain page of the applet, The framework automatically pre-downloads the sub-packages that may be required, therebyImprove the startup speed when entering the subsequent subcontracting page
6.2 Configuring subpackage pre-download
The behavior of pre-downloading subpackages, will be triggered when entering the specified page, in app.json, use preloadRule section point to define the pre-download rules for sub-packages, example code:
"preloadRule": {"pages/contact/contact":{"network": "all",//Indicates pre-downloading in the specified network mode, the optional values are all (unlimited network) and WiFi (download only in WiFi mode)"packages": ["packageA"]//packages indicates which subpackages are pre-downloaded after entering the page//You can specify which subpackages are pre-downloaded by root or name}},
6.3 Restrictions on subpackage pre-download
Pages in the same subpackage have a common pre-download size limit of 2M
边栏推荐
- 测试开发人均年薪30w+?软件测试工程师如何进阶拿到高薪?
- C Pitfalls and Defects Chapter 7 Portability Defects 7.9 Case Conversion
- 【Objective-C中的@synthesize】
- 作业8.1 孤儿进程与僵尸进程
- Unity Shader 常规光照模型代码整理
- 线上一次JVM FullGC搞得整晚都没睡,彻底崩溃~
- 回收租凭系统100%开源无加密 商城+回收+租赁
- WEB 渗透之端口协议
- ORI-GB-NP半乳糖介导冬凌草甲素/姜黄素牛血清白蛋白纳米粒的研究制备方法
- Review Set/Map basics with these two hooks
猜你喜欢
随机推荐
PX4模块设计之十五:PX4 Log设计
C陷阱与缺陷 第7章 可移植性缺陷 7.7 除法运算时发生的截断
Port protocol for WEB penetration
C expert programming
用户量大,Redis没法缓存响应,数据库宕机?如何排查解决?
C Expert Programming Chapter 1 C: Through the Fog of Time and Space 1.2 Early Experience of C Language
基于php旅游网站管理系统获取(php毕业设计)
Unity Shader 常规光照模型代码整理
Review Set/Map basics with these two hooks
C专家编程 前言
Transplant MQTT source code to STM32F407 development board
小程序--分包
shell脚本
Record the first PR to an open source project
AIDL通信
C Expert Programming Chapter 1 C: Through the Fog of Time and Space 1.3 The Standard I/O Library and the C Preprocessor
基于php影视资讯网站管理系统获取(php毕业设计)
ImportError: `save_weights` requires h5py.问题解决
render-props和高阶组件
C语言_枚举类型介绍