Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

WIP: Add strict binding parser note #2665

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

WIP: Add strict binding parser note #2665

wants to merge 2 commits into from

Conversation

twin-tigon
Copy link

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

@twin-tigon twin-tigon requested a review from a user October 15, 2018 17:00
Copy link
Contributor

@TimvdLippe TimvdLippe left a 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.

@twin-tigon
Copy link
Author

@TimvdLippe I modified the example using issue Polymer/polymer#4723

@TimvdLippe
Copy link
Contributor

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
Copy link

@arthurevans arthurevans Oct 26, 2018

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.

Copy link
Author

@twin-tigon twin-tigon Nov 7, 2018

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants