In the best practices for app developers, the Load Only What You Really Need section is written:
Keep Your Library Dependencies Up To Date
A library preload file, the library styles and text translations are loaded for every library you define in the application descriptor or the OpenUI5 bootstrap. Always define libraries in the manifest and remove all libraries that you do not intend to use in your code.
For instance:
"sap.ui5": {
"dependencies": {
"minUI5Version": "1.85.0",
"libs": {
"sap.ui.core": {},
"sap.m": {},
"sap.ui.layout": {}
}
}
...
}
My questions:
Do I understand it correctly, that in the
libs
I have to add all the libraries which appear insap.ui.define([…])
of any controller of the UI5-app?What happens if I forget to add a library here? Is it just excluded from the
Component-preload.js
and loaded in a non-optimized way or there are more serious disadvantages?