-
Notifications
You must be signed in to change notification settings - Fork 273
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
refactor(framework): Deprecate RenderScheduler in favor of Render.js #2728
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
@@ -59,7 +59,7 @@ class StaticAreaItem extends HTMLElement { | |||
this._rendered = true; | |||
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.js
that 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).whenFinished
renamed torenderFinished
.RenderScheduler.js
is deprecated, although not deleted yet, and it proxies the 3 important functions that external users normally call:renderImmediately
,renderDeferred
andwhenFinished
.register
andderegister
functions have been merged withrenderImmediately
andcancelRender
respectively and no longer exist.reRenderAllUI5Elements
function is nowasync
and awaits forrenderFinished
internally. This was changed because normally when this function was called,renderFinished
was called on the next line.renderFinished
from thewindow["sap-ui-webcomponents-bundle"]
global variable rather than from theRenderScheduler
global variable.Additionally, upgraded
Chromedriver
to version88
.BREAKING CHANGES:
RenderScheduler.js
deprecated. The file will be deleted in a future release. If you were using some of its methods, import these methods from the newRender.js
module. For example, if you were using:change to:
whenFinished
fromRenderScheduler.js
renamed torenderFinished
and now exported byRender.js
. For usage, see the previous example