0

I'm currently in the process of learning a new framework "SAPUI5". One of the things I'm wondering is, what's the difference between embedding a library like "sap.m" in the manifest.json vs. in the index.html?

manifest.json:

"dependencies": {
  "minUI5Version": "1.93",
  "libs": {
    "sap.ui.core": {},
    "sap.m": {},
    "sap.f": {},
     ...
  }
},

index.html:

<script>
...    
  data-sap-ui-libs="sap.m, sap.f, ..."
...
</script>
sarius
  • 107
  • 1
  • 3
  • 12

1 Answers1

1

basically,

  • in index.html you load the libs you actually need to bootstrapp your app.
  • in manifest you add the libs that your app depends on

(keep in mind, that your app may be loaded by other apps, in which case "your index.html" file will never be loaded, only "theirs", but when any other app loads your app, it will load your manifest and the libs listed inside as dependancy.

having said that, dependencies in manifest are mainly an indicator and performance topic: if a library is listed in manifest, it will be loaded "as a whole" (one or few http requests), whereas if it isn't loaded, the loading of individual controls will be triggered whenever they are required resulting in several or dozens of http requests, which you usually want to avoid.

iPirat
  • 2,197
  • 1
  • 17
  • 30