Skip to content

Instantly share code, notes, and snippets.

@jgwhite
Last active April 12, 2016 15:04
Show Gist options
  • Save jgwhite/c18427dbcea298f31393d4fd64d4a887 to your computer and use it in GitHub Desktop.
Save jgwhite/c18427dbcea298f31393d4fd64d4a887 to your computer and use it in GitHub Desktop.
Conversation with Godfrey Chan about Glimmer 2 named argument syntax (@foo)

2016-04-03


jgwhite:

I was surprised to see the {{@path.references}} in the Glimmer 2 docs: https://github.com/tildeio/glimmer/blob/master/guides/04-references.md

I’m probably behind the times… is {{@some.path}} in an RFC somewhere?


chancancode:

@jgwhite: no (not yet?)

It's the glimmer syntax for {{attrs.*}}

There are advantages to being able to "see" usages of attrs, they are essentially named arguments from the "callsite" (the component invocation)

So we made a syntax for it

It doesn't matter for curly components because you would just use {{path}}


jgwhite:

makes a lot of sense


chancancode:

{{attrs.path}} in curly components can either work by actually accessing the attrs object on the context, or we can add an AST transform for it

But we will probably have to RFC that to make it a "mainstream" syntax

Probably in the glimmer components v2 rfc


jgwhite:

thanks for filling in the blanks

these glimmer guides are a joy to read so far


chancancode:

👏 I'm glad you enjoyed them!

Which chapter should I write next?

Runtime overview?


jgwhite:

haha, well… I’ve yet to see the emberconf talk but sure, that sounds like a natural progression from describing references


chancancode:

The talk actually started with the primitives (references and validators) and then build up to "what does that have to do with rendering templates?"

Since I felt compelled to write about references and validators first maybe I should just move them up

The current structure had the advantage of mapping roughly to the steps in the actual pipeline

The talk probably isn't /that/ useful, as you can imagine it was basically impossible to fit so much content into half an hour 😆

https://twitter.com/chancancode/status/716559655359492096

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