Closed LukasHeimann closed 2 months ago
I'm not sure if I got your point regarding the two APIs at the end:
clock
parameter of nextUIUpdate
is optional and documented as such and waitForThemeApplied
was never intended as a public API. Did you find references to it in our documentation?In general, it was a conscious decision so far to not make the testing helpers (sap/ui/qunit/**
) public. But I understand that this is at least inconsistent if we, at the same time, mention them in replacement lists.
clock
that might have been my mistake, I was not sure about the JSDoc syntax -- in TypeScript, an explicit ?
or | undefined
would have been necessarywaitForThemeApplied
: in our code, we have built exactly the same with deprecated Core
APIs. When I looked to find out about nextUIUpdate
, didn't find anything in the docs and types, but in the code, I thought using it would also be possible (but broken typewise for the same reasons).applyChanges
suggests to use nextUIUpdate
for test code -- which was exactly my use case: https://github.com/SAP/openui5/blob/b1e9f4df71716680d1fd0416c363fcd9a659133f/src/sap.ui.core/src/sap/ui/core/Core.js#L2305-L2310
waitForThemeApplied
is also recommended as replacement at least here: https://github.com/SAP/openui5/blob/4381626e15361b273d64ebef10f3c872b4744e7e/src/sap.ui.core/src/sap/ui/qunit/QUnitUtils.js#L121-L122
I'd really like these two functions, they fill the exact spot that the test for my small custom control needs.
I don't think there is any issue in the dts generator, right?
The types not being marked as public in the OpenUI5 sources is nothing that can be changed in the generator. After all you explicitly wrote "the two modules are also missing from ui5.sap.com's documentation", which is not a result of this generator. As far as I see everything is about the annotations in the original UI5 code. So please open an issue in the OpenUI5 repo to get the officially recommended replacements actually usable.
nextUIUpdate
is in fact marked as public, but I'm going to go ahead and also open something at OpenUI5
Ok, I'll check.
@akudev As you might remember, we've excluded sap/ui/qunit
from the docs.
It's done here: https://github.com/SAP/openui5/blob/master/src/sap.ui.core/src/sap/ui/core/.library#L125.
I've opened https://github.com/SAP/openui5/issues/4074 as suggested :)
@akudev As you might remember, we've excluded
sap/ui/qunit
from the docs.
Right. More precisely: a bit more than ten years and three months ago. It feels like it was yesterday. ;-)
But regardless, at this point I don't see anything that needs to be done within the ui5-typescript
repository. Hence closing again.
Describe the bug I want to use sap.ui.qunit.utils.nextUIUpdate and waitForThemeApplied as replacements for deprecated Core APIs, as advertised by the ui5linter. However,
@sapui5/types
is missing the modules -- perhaps because it contains neither asap.ui.d.ts
nor asap.ui.qunit.d.ts
. Thus, when importingimport nextUIUpdate from "sap/ui/qunit/utils/nextUIUpdate";
, and error message appears: "Cannot find module 'sap/ui/qunit/utils/nextUIUpdate' or its corresponding type declarations.ts(2307)"".Expected behavior Correctly typed APIs are available.
Workaround Manually place a definition file in the project:
Additional context It might be worth to doublecheck the type definitions when adding the module to the distribution:
@public
annotationNote that the two modules are also missing from ui5.sap.com's documentation