Skip to content

Files

Latest commit

b631d24 · May 7, 2024

History

History
36 lines (23 loc) · 2.57 KB

standard-variant-for-bootstrapping-91f1f45.md

File metadata and controls

36 lines (23 loc) · 2.57 KB

Standard Variant for Bootstrapping

The standard variant for bootstrapping loads all JavaScript modules of a library in advance with one single request for performance reasons.

The library preload file library-preload.js contains all modules of a certain library. These modules will only be executed on demand, if the application requires them. Using preloads significantly reduces the number of roundtrips since the single modules are bundled in one file.

Note:

An application must not reference the library-preload.js. If preload files exist, SAPUI5 automatically loads them. The dependencies to libraries are defined as part of the manifest namespace sap.ui5/dependencies/libs. For further information, see Descriptor for Applications, Components, and Libraries (manifest.json).

By setting the async=true configuration parameter, the module loader loads the modules and preload files asynchronously. You can enable it in an existing application by specifying the sap-ui-async configuration parameter in the start URL, or by adding the data-sap-ui-async attribute to the bootstrap tag:

<script
    id="sap-ui-bootstrap"
    src="resources/sap-ui-core.js"
    data-sap-ui-theme="sap_horizon"
    data-sap-ui-async="true"
    data-sap-ui-on-init="module:my/app/main"
    data-sap-ui-resource-roots='{"my.app": "./"}'
></script>

Note:

Before you use the async configuration parameter, make sure your app is ready for asynchronous loading, see Best Practices for Loading Modules and Is Your Application Ready for Asynchronous Loading?.

Related Information

noJQuery Variant for Bootstrapping

Configuration of the SAPUI5 Runtime

Is Your Application Ready for Asynchronous Loading?