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

[0.8] notify: true Bad idea unless it has a huge performance gain #1379

Closed
gertcuykens opened this issue Apr 7, 2015 · 2 comments
Closed

Comments

@gertcuykens
Copy link

https://www.polymer-project.org/0.8/docs/migration.html#property-bindings

This new one way default binding bothers me allot, it took me months to get used to the two way bindings and now that I finally used to it I can't program without it anymore lol :)

Can we just get rid of the "notify: true" because it is too verbose to set up two way binding and we already have a way to specify one way binding [[one way]]

Suggest to just use [[one way]] and {{two way}}

And for god sake do not in any circumstances allow {{one way}} One way bindings should always ALWAYS be marked as [[one way]] You don't have to be a google scientist to understand that one way and two way should be marked very very clearly in the code!

@justinfagnani
Copy link
Contributor

{{two way}} and notify: true serve two different purposes:

  • notify: true indicates that you publish changes to your own property.
  • {{two way}} indicates that you listen to changes from a child element's property.

Both notifying and listening have some costs, and opting in to them apparently does have performance benefits, since the performance improvement of 0.8 over 0.5 is significant.

You're right that using a {{two way}} binding to a non-notifying property doesn't make sense, so I hope we can offer a hint in a linter for that case.

@sorvell
Copy link
Contributor

sorvell commented May 22, 2015

{{ }} doesn't mean "two-way", it means "automatic."

One can successfully write an entire app using {{ }} and bindings will be two-way only when the target property is notify: true, and otherwise will be one-way, and there is no loss of fidelity. Reducing varieties of punctuation and syntax has a value.

The [[]] syntax means only "prevent two-way" in scenarios where it would otherwise occur. This is provided primarily for folks that prefer explicit syntax.

@sorvell sorvell closed this as completed May 22, 2015
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

4 participants