ariatemplates / hashspace

JavaScript client-side template engine
http://hashspace.ariatemplates.com
Apache License 2.0
14 stars 18 forks source link

refactor: use Pratt's parser for expressions in attributes #288

Closed PK1A closed 10 years ago

PK1A commented 10 years ago

This doesn't merge cleanly due to the custom attributes commit that landed but I'm opening a PR anyway for the early review.

@mlaval I will need your help with rebasing this one on top of your changes. Could you give me a hand with this one when you are available?

PK1A commented 10 years ago

This PR changes the syntax for the class attribute to the one discussed several weeks ago. After this PR is merged one would write class = "{{foo:bar}} {baz}" instead of class = "{foo:bar, baz}"

benouat commented 10 years ago

The changes were pretty easy to read, follow and most of it, understand. So I am really fine with it.

What I am not that keen of, is the amount of noise changes that you had to do to all these samples/*.txt files. To me it clearly shows that they are not that great as part of a testing environment. The coupling is definitely too strong.

But that's not related to this PR. Different topic, different discussion

PK1A commented 10 years ago

Yes, I agree that some of the tests are too low-level and thus pretty fragile. I think we will be gradually able to replace them with higher-level tests and / or more focused tests.

PK1A commented 10 years ago

@mlaval I've just pushed f733862 that introduces ability to get raw expression values when dealing with attributes. This should allow us to expose non-stringified values to custom attribute handlers.

Could we pair-program on the remaining part?

PK1A commented 10 years ago

@mlaval OK, so it seems like the class thing is sorted out but we seem to be getting issues from event handlers on IE :-( The error is really "cryptic" to me and I'm not sure why those errors are only triggered from the touch event handlers.... Could you give me a hand with this one?

PK1A commented 10 years ago

@ariatemplates/hashspace-contributors would be awesome if anyone could have another look at this PR - if not I'm going to land it as-is in order to not to block cleanups / syntax changes.

benouat commented 10 years ago

Latest commit 73d0c66 looks good to me