SAP UI5加载时的library-preload.json文件
library-preload.json文件的作用,在Jerry的博客How I do self-study on a given Fiori control – part 1里有介紹:
In productive use, for performance reasons, all controls of a library are also available in the library-preload.json file, which is loaded initially (and can be loaded asynchronously). It contains each control/module as a string, which is then parsed into JavaScript on demand. So this avoids many HTTP requests and thus improves performance.
以上文字來(lái)自SAP UI5開發(fā)人員:Kunz Andreas:
我試著簡(jiǎn)單翻譯一下:
在productive使用場(chǎng)景下,處于性能考慮,一個(gè)SAP UI5應(yīng)用的單個(gè)library里包含的所有控件實(shí)現(xiàn)會(huì)被打包成單個(gè)的文件library-preload.json中去,可以在SAP UI5應(yīng)用bootstrap階段加載或者按需進(jìn)行異步加載。Library-preload.json以字符串的格式包含了每個(gè)control/module的實(shí)現(xiàn),可以被解析成JavaScript對(duì)象在SAP UI5框架里使用。這種打包成單個(gè)庫(kù)文件然后加載的方式,減少了HTTP請(qǐng)求的數(shù)量,提高了性能。
上圖是按照J(rèn)erry文章一個(gè)用于SAP UI5學(xué)習(xí)的腳手架應(yīng)用,沒有任何后臺(tái)API的依賴?yán)锝榻B的方法,開發(fā)了一個(gè)只包含button控件的最簡(jiǎn)單的SAP UI5應(yīng)用,加載之后在Chrome開發(fā)者工具里觀察到的網(wǎng)絡(luò)請(qǐng)求,其中包含四個(gè)library-preload.js的加載:
- https://openui5.hana.ondemand.com/resources/sap/ui/core/library-preload.js
- https://openui5.hana.ondemand.com/resources/sap/ui/commons/library-preload.js
- https://openui5.hana.ondemand.com/resources/sap/ui/layout/library-preload.js
- https://openui5.hana.ondemand.com/resources/sap/ui/unified/library-preload.js
更多Jerry的原創(chuàng)文章,盡在:“汪子熙”:
總結(jié)
以上是生活随笔為你收集整理的SAP UI5加载时的library-preload.json文件的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 《刺客信条:大革命》DLC苏杰之鹰解锁技
- 下一篇: SAP Spartacus org un