SAP / ui5-typescript

Tooling to enable TypeScript support in SAPUI5/OpenUI5 projects
https://sap.github.io/ui5-typescript
Apache License 2.0
201 stars 28 forks source link

`sap.ushell.Container` removed in 1.100? #347

Closed DetachHead closed 3 months ago

DetachHead commented 2 years ago

the sap.ushell.Container const that was defined in sap.ushell.d.ts seems to no longer be present in version 1.100. how come it was removed?

codeworrior commented 2 years ago

@aschmalzhaf can you please take a look and comment? Did only the global name disappear and it's possible now to access sap.ushell.Container via a module export in UI5 1.100?

aschmalzhaf commented 2 years ago

The issue should be fixed with newer UI5 versions (1.102++ should work fine). Please excuse all inconveniences.

akudev commented 2 years ago

Hold on... I don't think so.

It appears as a class at https://ui5.sap.com/1.101.0/#/api/sap.ushell.Container, but loaded from module "sap/ushell/Container". In 1.99 it used to be a field on the namespace (https://ui5.sap.com/1.99.0/#/api/sap.ushell), which it isn't anymore.

So it's sort of back again after disappearing in 1.100, but not like it used to be. A question to @DetachHead would be whether it would be acceptable to import it from module "sap/ushell/Container" instead of addressing it as a global - and whether this works at all, giving access to the singleton instance.

Edit: a quick test seems to show that the class is imported, not the singleton instance.

akudev commented 2 years ago

Now internally tracked as 2280149651 to get it handled.

akudev commented 3 months ago

Seems like this problem has been fixed in SAPUI5 version 1.121 and later. Possible downport to 1.120 is being discussed.

akudev commented 3 months ago

I verified that the following can be written in TypeScript and also works at runtime to the extent expected:

import Container from "sap/ushell/Container";
const navService = await Container.getServiceAsync("Navigation");

("extent expected" means it fails to return a value in a standalone app without FLP, but getServiceAsync is properly called on the right object.)

Closing as finally fixed.