SAP / openui5

OpenUI5 lets you build enterprise-ready web applications, responsive to all devices, running on almost any browser of your choice.
http://openui5.org
Apache License 2.0
2.96k stars 1.24k forks source link

`sap.ui.version` missing `@public` in API reference of `sap/ui/Global` #3386

Closed boghyon closed 2 years ago

boghyon commented 3 years ago

URL (minimal example if possible): https://openui5nightly.hana.ondemand.com/api/sap.ui

Currently, the API reference page of the namespace sap.ui doesn't mention sap.ui.version. I believe it's because the JSDoc tags @public, @readonly, and @name sap.ui.version are missing at: https://github.com/SAP/openui5/blob/8d2e7dc6a1cfad10e972f631fdea38115ab34a05/src/sap.ui.core/src/sap/ui/Global.js#L71-L79

This would result in a new section "Fields" in the sap.ui API reference page (similar to https://openui5nightly.hana.ondemand.com/api/sap.ui.core.Component.registry#properties) which doesn't exist there yet.

According to the section "Don't use references to global names", sap.ui.version is one of the exceptions that can be still used via the global name.

OpenUI5 provides a couple of static modules and (factory) functions that can be referred to via their global name:

  • ...
  • ...
    • sap.ui.version
IlianaB commented 3 years ago

Hello @boghyon , Thank you for sharing this finding. I've created an internal incident 2170321359. The status of the issue will be updated here in GitHub.

Regards, Iliana

boghyon commented 3 years ago

@IlianaB Thanks for creating the incident. Would it be possible to reopen https://github.com/SAP/openui5/issues/3384 with the label enhancement?

IlianaB commented 2 years ago

I will first check with the team is it feasible.

flovogt commented 2 years ago

Hey @boghyon , thanks for opening this issue here. sap.ui.version is a special parameter. It contains only the version of the sap.ui.core library. The UI5 version consumed by the CDN might differ from the version you get from sap.ui.version. This caused already many confusions. We recommend to use the VersionInfo API to get a detailed list of library versions.

sap.ui.require(
  ["sap/ui/VersionInfo"],
  function (VersionInfo){ 
    VersionInfo.load().then(
         function(info) {
             console.log(info);
        });
});

@codeworrior please correct me, but I guess the usage of sap.ui.version won't be further promoted.

codeworrior commented 2 years ago

Correct @flovogt , due to the potential misunderstandings that you describe, we don't want to promote sap.ui.version and won't make it public (it is intentionally not public).

boghyon commented 2 years ago

@codeworrior @flovogt Thanks for letting us know.

Somewhat related (please correct me if I'm wrong): the sap/ui/VersionInfo currently relies on the generated sap-ui-version.json file which in typical cases contains the framework version with the correct patch level (in SAPUI5 cases). Standalone apps, however, report the app version instead. Related enhancement request: https://github.com/SAP/ui5-tooling/issues/353.

AFAIK, i.e. there is currently no reliable way for standalone SAPUI5 apps to determine the correct patch version.

codeworrior commented 2 years ago

@boghyon this is correct.