-
Notifications
You must be signed in to change notification settings - Fork 2.4k
WIP: Add strict binding parser note #2665
base: master
Are you sure you want to change the base?
WIP: Add strict binding parser note #2665
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for writing this up! This in general looks good. 1 improvement would be to add a problematic case in this example, taken from one of the issues linked in the original PR. I will let the doc writers do the full text review, as I am not the expert in that.
@TimvdLippe I modified the example using issue Polymer/polymer#4723 |
Thanks! This all looks fine to me, but I will leave the rest of the review to our doc writers. |
@@ -697,6 +697,44 @@ to listen for `property-changed` events. The following constructions are equiva | |||
<my-element value="{{hostValue}}"> | |||
``` | |||
|
|||
## Strict binding parser | |||
|
|||
The default implementation of the binding parser uses a regular expression, due to its better |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this! I'd like to suggest alternate text to focus more on the use cases (when you need it, what to do) and less on the implementation. Here's my first take:
The default binding parser emphasizes performance over completeness. Some bindings can't be parsed correctly by the default parser—for example, bindings with JavaScript identifiers that include non-ASCII characters.
For a more exact binding parser, use the StrictBindingParser
mixin. This mixin provides an alternate binding parser that handles all possible cases, although it's slightly less performant than the default parser.
I don't love the phrase, "handles all possible cases," but I can't think of anything better at the moment, either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the feedback. Regarding the last sentence, what about something like this:
This mixin provides an alternate binding parser that supports Unicode characters, although it's slightly less performant than the default parser.
Hi @TimvdLippe,
This is what I got so far from issue #2508.
I'm missing the info for Polymer 3, I wanted to check with you before adding that.
Also, I'm not sure if Polymer 1 should be in scope for this.
Anyways, looking forward to your comments