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

Change -= name =- to {{ name }} #1

Open
dbankier opened this issue Jan 5, 2015 · 23 comments
Open

Change -= name =- to {{ name }} #1

dbankier opened this issue Jan 5, 2015 · 23 comments

Comments

@dbankier
Copy link
Owner

dbankier commented Jan 5, 2015

a limitation of alloy at the moment.
will raise JIRA and/or PR soon.

@FokkeZB
Copy link

FokkeZB commented Jan 5, 2015

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:

/(?:[^\{]|^)\{([^:}]+)\}(?:[^\}]|$)/

@dbankier
Copy link
Owner Author

dbankier commented Jan 5, 2015

Thanks. There is another BINDING_REGEX in Ti.UI.Switch.

@rblalock
Copy link

rblalock commented Jan 5, 2015

I like {{}} or <% %>

@grantges
Copy link

grantges commented Jan 5, 2015

+1 <% %>

@FokkeZB
Copy link

FokkeZB commented Jan 5, 2015

+1 {{ }} 😉

@netoramalho
Copy link

+1 {{ }}

@nicka
Copy link

nicka commented Jan 5, 2015

+1 <% %>

@iotashan
Copy link

iotashan commented Jan 5, 2015

What about ColdFusion style? #name#

@TheBrousse
Copy link

{{ }} would make more sense in my opinion since it has been adopted a lot of Javascript frameworks.

@jhaynie
Copy link

jhaynie commented Jan 5, 2015

+1 {{ }}

@jhaynie
Copy link

jhaynie commented Jan 5, 2015

@FokkeZB that looks about right to me. if you can submit a PR to alloy we can fix it ASAP.

@dbankier
Copy link
Owner Author

dbankier commented Jan 5, 2015

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).

@rblalock
Copy link

rblalock commented Jan 5, 2015

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.

@dbankier
Copy link
Owner Author

dbankier commented Jan 5, 2015

I haven't really used handlebars and not sure how/if it works outside the dom.
I'll have a look.

@rblalock
Copy link

rblalock commented Jan 5, 2015

It doesn't work off the dom. It's all string manipulation.

dbankier added a commit that referenced this issue Jan 5, 2015
@dbankier
Copy link
Owner Author

dbankier commented Jan 5, 2015

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.

@FokkeZB
Copy link

FokkeZB commented Jan 6, 2015

@dbankier you're doing a ticket+PR for Alloy?

@dbankier
Copy link
Owner Author

dbankier commented Jan 6, 2015

@FokkeZB, just implemented your change and tested it. It work well. Thanks.
Here is the PR: tidev/alloy#648

@dbankier
Copy link
Owner Author

dbankier commented Jan 6, 2015

Here is the JIRA ticket: https://jira.appcelerator.org/browse/TC-5179

@nicka
Copy link

nicka commented Jan 6, 2015

Good job guys!

@grantges
Copy link

grantges commented Jan 6, 2015

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
#1 (comment).

@dbankier
Copy link
Owner Author

dbankier commented Jan 8, 2015

tidev/alloy#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.

@jhaynie
Copy link

jhaynie commented Jan 8, 2015

sweet.

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

No branches or pull requests

9 participants