nano
nano copied to clipboard
Change -= name =- to {{ name }}
a limitation of alloy at the moment. will raise JIRA and/or PR soon.
From @jhaynie:
i think this might be the regular expression here FYI: https://github.com/appcelerator/alloy/blob/323f0bfd034ccd99912390ae2e12924793d9c1fc/Alloy/commands/compile/styler.js#L19
In order for Alloy not to interfere with {{name}} I think the regexp on the above line should be:
/(?:[^\{]|^)\{([^:}]+)\}(?:[^\}]|$)/
Thanks. There is another BINDING_REGEX in Ti.UI.Switch.
I like {{}} or <% %>
+1 <% %>
+1 {{ }} :wink:
+1 {{ }}
+1 <% %>
What about ColdFusion style? #name#
{{ }} would make more sense in my opinion since it has been adopted a lot of Javascript frameworks.
+1 {{ }}
@FokkeZB that looks about right to me. if you can submit a PR to alloy we can fix it ASAP.
I prefer {{ }} too.
<% %> can be implemented now.
# # I don't really like. It needs a a clear opening and closing since the expression can be long.
I will likely make it {{ }} by default but also make the syntax configurable (much like _ templates).
Sounds good to me. Ive been using handlebars on a new site for Appc , getting pretty comfortable with it. You going to just allow use of handlebars completely? So people can write plugins to it? Just an idea.
I haven't really used handlebars and not sure how/if it works outside the dom. I'll have a look.
It doesn't work off the dom. It's all string manipulation.
OK done. It defaults to {{ }} now.
using nano.syntax(/\-\=(.+?)\=\-/gi); to use the old syntax, which you need to do till alloy is fixed.
A warning about using <% %> is that it won't work if you used it as text content in xml, e.g.
<Label> Hi <% name %> </Label>
You will get this:
[ERROR] Error parsing XML file.
[ERROR] element parse error: Error: invalid tagName:%
[ERROR] @#[line:8,col:21]
[ERROR] Alloy compiler failed
nano works are run time and the xml parser that runs at precompile doesn't like it.
Leaving this open until we don't need to use the nano.syntax command anymore.
@dbankier you're doing a ticket+PR for Alloy?
@fokkezb, just implemented your change and tested it. It work well. Thanks. Here is the PR: https://github.com/appcelerator/alloy/pull/648
Here is the JIRA ticket: https://jira.appcelerator.org/browse/TC-5179
Good job guys!
Nice job @fokkezb ~
On Tue, Jan 6, 2015 at 2:35 AM, Nick den Engelsman <[email protected]
wrote:
Good job guys!
— Reply to this email directly or view it on GitHub https://github.com/dbankier/nano/issues/1#issuecomment-68839125.
https://github.com/appcelerator/alloy/pull/648 was merged. We are good to go when the change is part of an official Alloy release. I will update the README.md and close the issue then.
sweet.