-
-
Notifications
You must be signed in to change notification settings - Fork 406
Closed
Description
At the moment, only argument names starting with a lowercase letter are allowed.
I think it would be nice if this restriction could be loosened for the following use cases:
- Argument names starting with an uppercase letter (passing along a component via an argument to another component):
<Foo @Bar={{component "bar"}} />{{! foo.hbs }}
<@Bar />The PascalCase argument name makes it clearer that we are passing along a component,
and is also inline with how the component is normally invoked (<Bar />).
- Argument names starting with an underscore (passing along a "private" argument from a parent component to a child component):
{{! parent.hbs }}
{{yield (hash Child=(component "child" _foo="bar"))}}{{! child.hbs }}
{{@_foo}}The underscore makes it clearer that this argument can only come from its parent,
and is not meant to be used publicly when invoking the child component.
Both cases also work in JS land:
this.args.Barthis.args._foo
Mainly opening this issue to see if other people think this is a good idea,
and to see if other uses cases are missing.
Totally up for writing the RFC myself if this turns out to be a good idea.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels