-
Notifications
You must be signed in to change notification settings - Fork 280
refactor(framework): Deprecate RenderScheduler in favor of Render.js #2728
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
||
| const whenFinished = async () => { | ||
| await whenAllCustomElementsAreDefined(); | ||
| await whenDOMUpdated(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not related to this change, but I think we should improve this with a loop, as the DOM Update promise might result in more undefined custom elements.
|
|
||
| // Schedule a rendering task | ||
| await RenderScheduler.scheduleRenderTask(); | ||
| await renderDeferred(webComponent); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add a warning in the console, otherwise it is too easy to miss.
packages/base/src/StaticAreaItem.js
Outdated
| updateShadowRoot(this.ownerElement, true); | ||
| } | ||
| await RenderScheduler.whenDOMUpdated(); // Wait for the content of the ui5-static-area-item to be rendered | ||
| await whenFinished(); // Wait for the content of the ui5-static-area-item to be rendered |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without the RenderSchduler, whenFinished sounds too generic.
I also think the when... sounds good when followed by a then...
Maybe we can drop the when a use the render verb, something like
await renderFinished()
Changes:
Render.jsthat implements all functionality that used to be inRenderScheduler.js. This allows the code to be tree-shaken, unlike as it was before (with a static class).whenFinishedrenamed torenderFinished.RenderScheduler.jsis deprecated, although not deleted yet, and it proxies the 3 important functions that external users normally call:renderImmediately,renderDeferredandwhenFinished.registerandderegisterfunctions have been merged withrenderImmediatelyandcancelRenderrespectively and no longer exist.reRenderAllUI5Elementsfunction is nowasyncand awaits forrenderFinishedinternally. This was changed because normally when this function was called,renderFinishedwas called on the next line.renderFinishedfrom thewindow["sap-ui-webcomponents-bundle"]global variable rather than from theRenderSchedulerglobal variable.Additionally, upgraded
Chromedriverto version88.BREAKING CHANGES:
RenderScheduler.jsdeprecated. The file will be deleted in a future release. If you were using some of its methods, import these methods from the newRender.jsmodule. For example, if you were using:change to:
whenFinishedfromRenderScheduler.jsrenamed torenderFinishedand now exported byRender.js. For usage, see the previous example