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

Investigate using vmBeingRendered === null vs isRendering flag #259

Closed
Gr8Gatsby opened this issue Apr 23, 2018 · 2 comments
Closed

Investigate using vmBeingRendered === null vs isRendering flag #259

Gr8Gatsby opened this issue Apr 23, 2018 · 2 comments
Labels
need help If you are looking to contribute to LWC, this is where you start. perf

Comments

@Gr8Gatsby
Copy link

SOMA#506

Migrated issue

Notes:

In theory, vmBeingRendered should never be null when isRendering is true (and vise-versa).

Questions

  • Is there ever a case where isRendering would be false and vmBeingRendered would be true?
  • What would be the implications of replacing isRendering statements with vmBeingRendered !== null
  • It appears that TypeScript would have an easier time with vmBeingRendered !== null, but is that the case?

They are effectively the same. Maybe we can abstract that into a method that we use everywhere:

function isRendering() {
    return vmBeingRendered !== null;
}

and see if engines can optimize that.

@caridy
Copy link
Contributor

caridy commented Jul 5, 2018

We need a volunteer here that want to try to clean this up.

@caridy caridy added the need help If you are looking to contribute to LWC, this is where you start. label Jul 5, 2018
@ravijayaramappa
Copy link
Contributor

This issue is obsolete now. Things have changed after PR #1551.
The engine now has two flags, one to mark the invocation of render() method and another to mark the invocation of executing the template returned by the render method. In both the cases the vmBeingRendered is set. So vmBeingRendered cannot be used to infer which phase the engine is currently in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need help If you are looking to contribute to LWC, this is where you start. perf
Projects
None yet
Development

No branches or pull requests

3 participants