Skip to content
This repository has been archived by the owner on Jul 30, 2018. It is now read-only.

Do not call schedule render every invalidate, only on setting properties and children #692

Merged
merged 5 commits into from
Sep 21, 2017

Conversation

agubler
Copy link
Member

@agubler agubler commented Sep 21, 2017

Type: bug

The following has been addressed in the PR:

  • There is a related issue
  • All code matches the style guide
  • Unit or Functional tests are included in the PR

Description:

Calling scheduleRender every time invalidate is called is problematic in certain scenarios when a widget is wrapped by the ProjectorMixin.

  1. When the widget has a property registered with a custom diff that always returns changed as true i.e. diffProperty('my-prop', always)
  2. Uses the new @alwaysRender decorator (such as the Container HOC).

Currently this causes projector instances to continuously schedule a render, as this.invalidate() will be called for all __setProperties__ calls.

Overriding invalidate in this way should not be needed, as a listener that calls scheduleRender is attached to projector instances' invalidated event.

Instead this invalidated event can be explicitly emitted at the end of setProperties and setChildren, the public API for projector instances.

Other mechanisms such as injectors of external state that need to schedule a render, also emit an invalidated event and therefore will be sure scheduleRender is fired.

@agubler agubler merged commit 6da481d into dojo:master Sep 21, 2017
@dylans dylans added this to the 2017.09 milestone Sep 25, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants