loio |
---|
91f1f4536f4d1014b6dd926db0e91070 |
view on: demo kit nightly build | demo kit latest release
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.
An application must not reference the
library-preload.js
. If preload files exist, OpenUI5 automatically loads them. The dependencies to libraries are defined as part of the manifest namespacesap.ui5/dependencies/libs
. For further information, see Manifest (Descriptor for Applications, Components, and Libraries).
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-async="true"
data-sap-ui-on-init="module:my/app/main"
data-sap-ui-resource-roots='{"my.app": "./"}'
></script>
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