Skip to content
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

fix(framework): make renderImmediately sync, fix lifecycle issues #1929

Merged
merged 7 commits into from
Jul 13, 2020

Conversation

vladitasev
Copy link
Contributor

@vladitasev vladitasev commented Jul 8, 2020

  • RenderQueue.js no longer manages promises at all
  • renderImmediately is completely sync now and does not use the render queue. The render queue is only used by renderDeferred. renderDeferred is async and awaits for queue processing to be over (but does not await for the "official" end of the render task - the Mutation Observer).
  • In UI5Element.js there are 2 new flags: _inDOM which is set immediately when connectedCallback is called, and is unset immediately when disconnectedCallback is called. It prevents the component from entering the render queue if removed from DOM before it gets to it. And _fullyConnected which is set before calling onEnterDOM and unset after calling onExitDOM. Thus we call onExitDOM only if we called onEnterDOM, thus preventing lifecycle issues in the components implementation.

So the following code:

x = document.createElement('ui5-table'); 
document.body.appendChild(x); 
document.body.removeChild(x);

can now run without exceptions thrown by ResizeHandler.js (as it is deregistered before ever being registered).

  • Test added

closes: #1821

@vladitasev vladitasev requested a review from pskelin July 8, 2020 12:37
@vladitasev vladitasev changed the title Lifecycle issues 3 POC fix(framework): make renderImmediately sync, fix lifecycle issues Jul 8, 2020
@vladitasev vladitasev merged commit 9141300 into master Jul 13, 2020
@vladitasev vladitasev deleted the lifecycle-issues-3 branch July 13, 2020 05:55
@ilhan007 ilhan007 added this to 1.0.0-rc.8 (released) in UI5 Web Components - Roadmap Aug 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Memory leak with Dialog closing and Deleting from DOM at same time
2 participants