Find a collection of information that helps you to find out if your application is ready for asynchronous loading.
Applications benefit from the configuration of the SAPUI5 module loader to work asynchronously. However, if an application or library is not yet fully compatible with asynchronous loading, you may encounter issues. To avoid running into these issues, the following list provides information that helps you to find out whether your application needs to be adapted to enable asynchronous loading. The list is not exhaustive, but points to additional information and should give you a good start in getting your applications ready for asynchronous loading.
-
For asynchronous loading, your application modules have to facilitate the concept for defining and handling of modules in SAPUI5 that is aligned with the asynchronous module definition (AMD) standard. For an overview, see Best Practices for Loading Modules.
-
Existing applications may still use synchronous variants of factory methods. To make your application ready for asynchronous loading, you need to use asynchronous variants of factory methods instead.For information how you can replace the synchronous variants with asynchronous variants, see Deprecated Factories Replacement.
-
The global access to legacy APIs triggers a compatibility layer to load such modules synchronously and needs to be replaced to enable your application for asynchronous loading.For information how you replace the global access, see Deprecated jQuery.sap API Replacement.
-
The Support Assistant also helps you to identify issues in your application, especially issues related to synchronous or asynchronous loading. For information about the Support Assistant, see Support Assistant.
-
If your application relies on certain points in time, you may run into runtime issues when you switch from synchronous to asynchronous module loading and the points in time on which your application relies are different due to this change. Here are two examples of such issues:
An event gets triggered before potential listeners had the chance to attach themselves. Whereas this may have worked for synchronous loading where the timing of module loading and initializing is different, this causes issues for asynchronous loading. To resolve this and to ensure that all modules are properly loaded and exectued, all necessary module dependencies for the module that actually triggers the event need to be handled by
sap.ui.require
orsap.ui.define
.A controller listens on the
EventBus
for a certain event that is triggered by another controller. Depending on the loading time of the corresponding views, theinit
controller methods may be called at a different point in time. For information how to resolve this, see Best Practices for Loading Modules. -
Issues with asynchronous loading can also occur if your application uses XML views that are configured to be loaded asynchronously via the
manifest
property, for example for the root viewsap.ui5/rootView/async=true
. To detect such issues, we recommend to do extensive (automatic) testing to ensure the application continues to work as expected. -
If your application uses expression bindings, keep in mind that
sap.ui.base.ExpressionParser
loads some resources synchronously. To avoid this, make sure to load them in advance, for example by declaring them in thesap.ui.define
statement in your application code that runs before the expression bindings are evaluated. The following expression bindings are affected:Expression Binding(s)
Resource to be Preloaded
"odata.compare", e.g.
value="{=odata.compare(2,3)}"
sap.ui.model.odata.v4.ODataUtils
"odata.uriEncode", e.g.
value="{=odata.uriEncode('foo', 'Edm.String')}"
sap.ui.model.odata.ODataUtils
"odata.fillUriTemplate", e.g.
value="{=odata.fillUriTemplate('http://foo/{t},{m}', {'t': ${/mail}, 'm': ${/tel}})}"
sap.ui.thirdparty.URITemplate
For more information on the preload of dependencies, see Modules and Dependencies.
The sap.viz
library uses another module loader in addition to the SAPUI5 module loader in some scenarios. In combination with the `` configuration parameter, this currently leads to issues and may break your application.