目录

Loading by Subpackage

For larger ASCF atomic services, you can use the feature of loading by subpackage. Specifically, all pages and resources in the project are divided into multiple independent subpackages based on configuration rules. These subpackages are downloaded separately at runtime, thereby accelerating page rendering. Loading by subpackage reduces the initial startup latency of the ASCF atomic services and streamlines management and decoupling of different functionalities.

Dependent on the compilation tool, this feature divides a project into one main package and several subpackages based on the subpackages configuration defined in the manifest.json file. The main package contains public resources and pages, and the subpackages are organized based on your specified resource directories. Each package is treated as a rawfile in the atomic service and functions as an independent HSP.

In actual running, the ASCF atomic service loads the main package and the subpackages required for page rendering. Other subpackages are automatically preloaded in the background.

The package size restrictions for the ASCF comply with those set for atomic services.

To achieve better package splitting, you are advised to: