on ‎2014 Jan 19 6:59 AM
When using Components in UI5 apps I can see a stray GET request each time the application is loaded looking for Component-preload.js in the app directory.
There is a little bit of explanation on preloading in the SDK help (but not much). From what I can gather: library pre-loading is something thats only applicable to the SAP-provided UI5 libraries. Our own code can't execute till the UI5 libraries are loaded anyway
I've tried setting data-sap-ui-preload="async" (sync is the default); but then UI5 won't load. Interestingly if I set sap-ui-preload=auto as a url query string parameter; the app seems to load normally (sync) and there is no stray GET on the Component-preload.js file.
Does anyone have any further information on pre-loading and why there is a GET request on this file and the best way to stop it.
If you also know how to stop all the message bundle GET's that would be interesting to know as well. 😉
Request clarification before answering.
I just resolved this issue, by adding a new file Component-preload.js in the app directory, with following contents:
jQuery.sap.declare("sap.ui.demo.myFiori.Component-preload");
I think it is a nice idea to have this new file so that we can add a piece of code (hook) before loading the whole component.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
this file is not meant to be loaded "before" a Component, but it is supposed to contain the entire application code, including all Views, Controllers, etc. within ONE file. (to reduce requsts)
The format is the same (or similar) as the library-preload file, hence the name. "Preload" because all resources are loaded in advance and then parsed on demand.
See my top-level response for more details.
Regards
Andreas
| User | Count |
|---|---|
| 7 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.