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

better rt-scope syntax parsing #175

Closed
nippur72 opened this issue Jul 29, 2016 · 4 comments
Closed

better rt-scope syntax parsing #175

nippur72 opened this issue Jul 29, 2016 · 4 comments

Comments

@nippur72
Copy link
Contributor

Currently the syntax parsing for rt-scope is quite weak not allowing templates like the following:

<div rt-scope="'as fast as possible' as message"></div>
<div rt-scope="';' as delimiter"></div>

The problem lies in expressions containing " as " and ";" because those are also delimiters used to scan tokens in the rt-scope attribute.

I think that can be slightly improved by having a proper regex that looks for the substring " as id;" where id is a valid JavaScript identifier and ; is optional.

Hopefully that should lower the risk of keyword clashing.

@idok
Copy link
Contributor

idok commented Jan 3, 2017

cherry picked

@idok idok closed this as completed Jan 3, 2017
@nippur72
Copy link
Contributor Author

nippur72 commented Jan 4, 2017

@idok can you please comment about the remaining features in my PR? will they be merged or can I consider them rejected? do you want me to isolate them so that they have no merge conflicts?

@idok
Copy link
Contributor

idok commented Jan 9, 2017

@nippur72 first I want to apologise for the delay in reviewing your work.
If I am not mistaken I have cherry picked all of your changes besides lodash helpers and create element alias which are still in review.
Regarding create element alias, it can potentially introduce a naming conflict which will be difficult to make sense of.

@nippur72
Copy link
Contributor Author

nippur72 commented Jan 9, 2017

@idok thanks. Regarding createElement, the rationale is saving bytes (e.g. h()) and being able to use other engines like preact. There's something similar in babel and now also in TypeScript (flag --jsxFactory) so I think it makes sense to have that in our templates too.

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

No branches or pull requests

2 participants