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

Add flags to elide events that are strictly unnecessary for downward data-flow #4262

Closed
kevinpschaaf opened this issue Jan 18, 2017 · 2 comments
Assignees

Comments

@kevinpschaaf
Copy link
Member

kevinpschaaf commented Jan 18, 2017

Description

There are several cases where Polymer will fire events as a result of downward data flow (as opposed to async/user interaction thereof):

  • Downward data flow to notify: true events
  • dom-repeat and dom-if dom-change events
  • dom-repeat's renderedCount notifying property changes as a result of render

There should be an opt-out from these events to achieve maximum performance.

@kevinpschaaf kevinpschaaf self-assigned this Jan 18, 2017
@kevinpschaaf kevinpschaaf changed the title Add flags to elide property-changed and dom-change events for performance Add flags to elide events that are strictly unnecessary for downward data-flow Jan 18, 2017
@zhaoz
Copy link
Contributor

zhaoz commented Jan 19, 2017

How soon do we think we can get this fixed?

kevinpschaaf added a commit that referenced this issue Jan 20, 2017
…4262.

* `Polymer.Settings.suppressTemplateNotifications `- disables `dom-change` and `rendered-item-count` events from `dom-if`, `dom-repeat`, and `don-bind`. Users can opt back into `dom-change` events by setting the `notify-dom-change` attribute (`notifyDomChange: true` property) to `dom-if`/`don-repeat` instances.
* `Polymer.Settings.suppressBindingNotifications` - disables notify effects when propagating data downward via bindings. Generally these are never useful unless users are explicitly doing something like `<my-el foo="{{foo}} on-foo-changed="{{handleFoo}}">` or calling `addEventListener('foo-changed', ...)` on an element where `foo` is bound (we attempted to make this the default some time back but needed to revert it when we found via #3077 that users were indeed doing this).  Users that avoid these patterns can enjoy the potentially significant benefit of suppressing unnecessary events during downward data flow by opting into this flag.
@kevinpschaaf
Copy link
Member Author

@zhaoz PR incoming: #4267

sorvell pushed a commit that referenced this issue Jan 21, 2017
Add global flags to suppress unnecessary notification events. Fixes #4262
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants