且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

SAP UI5库文件的加载细节探讨

更新时间:2022-09-02 13:08:02

In every UI5 application we declare usage on libraries like sap.ui.commons via “data-sap-ui-libs”.


Have you ever thought about how does the logic work? Since we only declare the NAME of libraries here, how, when, and where are these libraries loaded from repository when your UI5 application is launched?

SAP UI5库文件的加载细节探讨SAP UI5库文件的加载细节探讨Approach1: use XHR breakpoint ( as usual )

Enable XHR Breakpoint, and type your application url in Chrome and press enter key. The breakpoint will be triggered for loading ui core library. Click callstack “jQuery.sap.preloadModules”.

SAP UI5库文件的加载细节探讨SAP UI5库文件的加载细节探讨SAP UI5库文件的加载细节探讨SAP UI5库文件的加载细节探讨Approach2: A far more efficient way

If you have known that sap-ui-core.js uses the same code to fetch your application js code and sap UI standard library, you could find the place of this call in a more efficient way.

Deliberately generates a syntax error in your application view and launch the application.

SAP UI5库文件的加载细节探讨SAP UI5库文件的加载细节探讨