`sap.ui.qunit.utils.nextUIUpdate` and `waitForThemeApplied` recommended as replacements, but not exposed
Prior to UI5 2.0, a couple of methods were deprecated. The jsdoc in OpenUI5, and thus TypeScript types as well as the UI5 linter expose the deprecation notices with hints to replace with alternatives from sap.ui.qunit.utils, i.e.
- https://github.com/SAP/openui5/blob/4950f1d7fe76e02604ba165c47ce65c72f60b2b2/src/sap.ui.core/src/sap/ui/core/Core.js#L2309-L2310
Core.applyChanges()suggestsnextUIUpdate - https://github.com/SAP/openui5/blob/4950f1d7fe76e02604ba165c47ce65c72f60b2b2/src/sap.ui.core/src/sap/ui/qunit/QUnitUtils.js#L122
QUtils.delayTestStart()suggestswaitForThemeApplied
Indeed, those two methods are really useful when writing tests for custom controls. However, these methods are not exposed properly. nextUIUpdate is marked as @public, but waitForThemeApplied is not. Both are not shown on https://ui5.sap.com, and don't appear in the generated types, presumably due to deliberate exclusion at https://github.com/SAP/openui5/blob/4950f1d7fe76e02604ba165c47ce65c72f60b2b2/src/sap.ui.core/src/sap/ui/core/.library#L125
This discussion started at https://github.com/SAP/ui5-typescript/issues/459, but I was redirected here as the types are generated correctly, but the issue is the JSDoc and library configuration. Also, it was noted there that (until now) the two functions were deliberately not released (yet).
- As a developer, I want to use the recommended replacements for deprecated public functionality in a compliant manner, and thus would like to have the recommended replacements publicly released and documented.
- As a developer of custom controls, I'd like to use simple promise-based methods to wait for the execution environment to be in the right state -- this especially includes waiting for UI rerendering and themes being applied.
Thus, please consider properly exposing the two methods to end users, both in JSDoc as well as in TypeScript and https://ui5.sap.com.
Thank you very much for your support! Lukas
Thanks a lot @LukasHeimann for reporting this issue. I have created an internal incident DINC0193814 and the respective team will update the status of the issue here in GitHub.
Thank you for the fix, looking forward to updating to 1.127 in August!