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

Don't pass an empty {hash:{}} as the last arg to a template helper #40

Closed
lorensr opened this issue May 19, 2016 · 7 comments
Closed

Don't pass an empty {hash:{}} as the last arg to a template helper #40

lorensr opened this issue May 19, 2016 · 7 comments

Comments

@lorensr
Copy link

lorensr commented May 19, 2016

Moved from meteor/meteor#5031

@mitar
Copy link
Collaborator

mitar commented May 19, 2016

This would potentially be backwards incompatible. But yes, this is really unneeded. Also, I think it is unneeded that data is stored inside hash ant not directly inside Spacebars.kw object.

@stubailo
Copy link
Contributor

Would it make sense to simplify helpers to use either only positional or only keyword args? So either:

{{helper x y}}

Or

{{helper x=x y=y}}

The second seems more desirable as a single option, since with positional arguments you need to constantly be looking up the order, etc. Unfortunately all current code uses the first.

@mitar
Copy link
Collaborator

mitar commented Aug 30, 2016

The question for me is just why we have hash property for data, why it is not simply an object which is an instance of something (Spacebars.kw) and this is it?

@stubailo
Copy link
Contributor

No reason I can imagine at all. We should 100% get rid of it.

@MiroHibler
Copy link
Contributor

Would it make sense to simplify helpers to use either only positional or only keyword args? So either:

{{helper x y}}

Or

{{helper x=x y=y}}

The second seems more desirable as a single option, since with positional arguments you need to constantly be looking up the order, etc. Unfortunately all current code uses the first.

I'd do both for backward compatibility, get rid of hash and make the same for inclusion tags ({{> foo x y=y}}) and block tags ({{#foo x y=y}}).

@stubailo
Copy link
Contributor

I agree that helper and inclusion syntax should be consistent!

@filipenevola
Copy link
Collaborator

I'm closing this issue because it's too old.

If you think this issue is still relevant please open a new one.

Why? We need to pay attention to all the open items so we should keep opened only items where people are involved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Blaze development
Planned – spacebars
Development

No branches or pull requests

5 participants