Closed pubmikeb closed 4 months ago
Hi @pubmikeb ,
- Should the framework/libraries section of ui5.yaml be identical to the sap.ui5/dependencies/libs one of manifest.json?
Ideally, yes. The framework
part of the ui5.yaml
gives hints on how to build you app, while the manifest.json
gives "hints" during bootstraping of the UI5 core which libs to download, eventually prefetch or lazy load.
sap.ui5
section and look for dependencies property https://sapui5.hana.ondemand.com/sdk/#/topic/be0cf40f61184b358b5faedaec98b2da
If I understand it correctly, these framework/libraries section is used to incorporate these libs into Component-preload.js. Is it a correct assumption?
- Not into the Component-preload, but yes, it bundles those libs along with your app, BUT only for self contained build
Should I specify this libraries section at all in case, if I consume UI5 lib from the CDN?
- Yes, you might need them for local development, for example
@d3xter666, thanks a lot for the detailed explanation!
Regarding the first answer, wouldn't be great to add to UI5 Tooling the possibility to «inherit» the values of manifest.json's sap.ui5/dependencies/libs
by default?
So, if nothing is specified in framework/libraries
, then UI5 Tooling tries reading sap.ui5/dependencies/libs
from manifest.json. This might help to avoid unintentional inconsistency between sap.ui5/dependencies/libs
and framework/libraries
.
- Should I specify this libraries section at all in case, if I consume UI5 lib from the CDN?
- Yes, you might need them for local development, for example
Adding to this statement, when consuming SAPUI5 via CDN during development it is not needed to declare the dependencies in the ui5.yaml.
Actually, I would even advise against it since a miss match in the SAPUI5 version of both sources could cause unexpected behavior. Many UI5 project templates therefore use multiple ui5.yaml configuration files to distinguish between CDN and local SAPUI5 dependency usage.
Regarding the first answer, wouldn't be great to add to UI5 Tooling the possibility to «inherit» the values of manifest.json's
sap.ui5/dependencies/libs
by default?So, if nothing is specified in
framework/libraries
, then UI5 Tooling tries readingsap.ui5/dependencies/libs
from manifest.json. This might help to avoid unintentional inconsistency betweensap.ui5/dependencies/libs
andframework/libraries
.
As Yavor outlined we try to have a clear separation between "runtime" and "buildtime" dependencies in the hope that this makes it easier for developers to understand and maintain the two configurations correctly.
Some examples where it might get tricky when using manifest.json as a fallback:
supportedThemes
attribute, it is not really the same as explicitly declaring a dependency. So applications would often have to declare at least their theme dependencies in the ui5.yaml. Should we ignore the other dependencies in manifest.json then? (since something is specified in framework/libraries
)I agree that inconsistency is an issue. For our framework libraries we therefore have an internal validation that ensures the ui5.yaml contains at least all dependencies listed in the manifest.json. But with regards to 3., such a check might not work for projects relying on custom UI5 libraries.
Playing with UI5 Tooling, I see that the ui5.yaml config file contains a framework library section, where we supposed to specify UI5 app dependencies, e.g.
sap.m
,sap.ui.core
etc.:My questions:
Should the
framework/libraries
section of ui5.yaml be identical to thesap.ui5/dependencies/libs
one of manifest.json?If I understand it correctly, these
framework/libraries
section is used to incorporate these libs intoComponent-preload.js
. Is it a correct assumption?Should I specify this
libraries
section at all in case, if I consume UI5 lib from the CDN?