-
-
Save alexlafroscia/2437daf7f5d90169e1685c0170e987db to your computer and use it in GitHub Desktop.
Something else to think about -- components can have positional params as well. Helpers and components may not actually be different -- they probably follow the same rules. An inline component vs. a helper aren't actually different from the HBS file perspective and would be parsed the same way. For example, is the following an inline component or helper?
No way to know. The difference from a parsing perspective only comes into play for block components like:
Another thing to think about: the "named block RFC" will add new syntax that doesn't currently exist in Ember,, but should be accounted for (eventually)
https://github.com/emberjs/rfcs/blob/master/text/0226-named-blocks.md
And yet another thing to think about: Ember will be switching to PascalCase
for component names, a la React
This is (somewhat) similar to JSX but is really still Handlebars. Just another thing to think about since components in that form will also (eventually) need support. I can't find a link to anything referencing this at the moment, but I know this change was made to Glimmer and will eventually come to Ember once it can interoperate with Glimmer components.
All "helpers" can be broken down to the same features, so the
if
case and thehash
case aren't really different. It's just and example of a helper that only takes positional params, and one that only takes named params. So, the questions are reallyif
helper, which is only positional params)hash
helper, which is only named params))
-- in line with the final "part" of the helper? On its own line? I think I like having it on its own line better. You might want to look into Lisp-style languages to see how they normally format expressions, since the HBS helper syntax is close to a Lisp syntax itself