Incomplete npm dependencies for sap.m?
I'm trying the new approach, installing OpenUI5 runtime from npm, when I discovered that sap.m package has no dependency on sap.ui.layout?
According to my limited knowledge (may be incorrect), some components in sap.m are dependents of sap.ui.layout, an advanced code search reveals 11 occurences of sap.ui.layout or sap/ui/layout within /src/sap.m/src/sap/m folder.
If the dependency is there, you may want to add them to the dependency list (or refactor the code so that it no longer depends on the said library), otherwise some functionality may become broken I think?
Hello @zypA13510 , Thank you for sharing this finding. I've created an internal incident 1880532741. The status of the issue will be updated here in GitHub. Regards, Alex
@codeworrior, @matz3: do you know whether the missing sap.ui.layout dependency in the sap.m .library file is an error or intentionally?
There are a couple of layout dependencies in sap.m controls. Examples: https://github.com/SAP/openui5/blob/b9f14206bd1ff5f18a8bbde6bf20762b6238cd2a/src/sap.m/src/sap/m/P13nFilterPanel.js#L402
https://github.com/SAP/openui5/blob/b9f14206bd1ff5f18a8bbde6bf20762b6238cd2a/src/sap.m/src/sap/m/QuickViewPage.js#L10-L12
Dependencies within controls alone are NOT sufficient as an indicator for a library dependency. The colleagues responsible for the sap.m library decided in the past to model only very common dependencies (those where it is unlikely that a user of sap.m can work without those dependencies).
Any hard dependency would add to the initial load for every app loading sap.m.
As long as many common controls of sap.m can be used without loading sap.ui.layout, I would assume that it was a conscious decision to omit the dependency. But the colleagues should know best.
The source of truth is the .library file and it only lists sap.ui.core (which is mandatory) and sap.ui.unified (as a lazy dependency). So the NPM module seems to be consistent with that.
Strangely, the pom.xml lists a dependency to sap.ui.layout, We usually suggest to add a lazy dependency then to the .library file (as it was done for sap.ui.unified). Not sure why this was not done for sap.ui.layout.
Last but not least: there must be no cycles in the dependencies. As far as I can see, there's no dependency from sap.ui.layout to sap.m, that's fine.
Thanks for the clarification.
Strangely, the
pom.xmllists a dependency tosap.ui.layout
Which pom.xml file are you referring to here? I couldn't find such a dependency declaration in the sap.m pom.xml or the root pom.xml.
Ping @codeworrior
Ping @codeworrior: do you think we should add sap.ui.layout as a dependency in the package.json of sap.m?
Hey @zypA13510, we added the sap.ui.layout dependency to sap.m with 2cd8650. This change will probably get released with the next minor OpenUI5 release. Thanks for reporting!