SAP / openui5

OpenUI5 lets you build enterprise-ready web applications, responsive to all devices, running on almost any browser of your choice.
http://openui5.org
Apache License 2.0
2.96k stars 1.24k forks source link

Issues on ui5 bootstrap #3048

Closed Victor716 closed 4 years ago

Victor716 commented 4 years ago

OpenUI5 version: 1.80.0

Questions:

  1. Why ui5 would download the library-preload.js, library.css and library-parameters.json?
  2. Can it be avoided? Coz this will require too much to download and also cause the latency of the app performance?
  3. Can I customize the size of a ui5 module from the server?

For example, if I used 10 controls in sap.m, I just want these 10 to get downloaded instead the whole sap.m I tried the data-sap-ui-preload="async", but it would download all controls used one by one. This would cause a number of requests that would finally impact the performance. Thanks a lot

Victor Ye

flovogt commented 4 years ago

Hello @Victor716,

Thank you for sharing this finding. I've created an internal incident 2070425459. The status of the issue will be updated here in GitHub.

Best Regards, Florian

Victor716 commented 4 years ago

Glad to see your response. Looking forward to your good news. If possible, can we have a call to discuss about it? My ID is c5306366.

RandomByte commented 4 years ago

Hey Victor, Answering your questions:

  1. Why ui5 would download the library-preload.js, library.css and library-parameters.json?
    • A: For every UI5 library we provide a "library-preload.js" bundle containing (almost) all modules of that library. The idea is that in a shared environment with multiple UI5 applications these bundles can be used by all of them and therefore highly benefit from a browsers caching mechanism.
  2. Can it be avoided? Coz this will require too much to download and also cause the latency of the app performance?
  3. Can I customize the size of a ui5 module from the server?
    • What do you mean exactly?

For example, if I used 10 controls in sap.m, I just want these 10 to get downloaded instead the whole sap.m I tried the data-sap-ui-preload="async", but it would download all controls used one by one. This would cause a number of requests that would finally impact the performance.

I think your application's manifest.json is missing a library dependency to sap.m. Therefore the library-preload.js is not loaded and all controls are requested individually. Please have a look at the "Use manifest.json Instead of the Bootstrap to Define Dependencies" chapter of our performance guide: https://ui5.sap.com/#/topic/408b40efed3c416681e1bd8cdd8910d4