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

[DOC] Document helper and modifier keywords #20119

Merged
merged 1 commit into from
Jun 14, 2022

Conversation

SergeAstapov
Copy link
Contributor

Closes #19925

@SergeAstapov
Copy link
Contributor Author

SergeAstapov commented Jun 13, 2022

This is mostly copy-paste from the respective RFC https://github.com/emberjs/rfcs/blob/master/text/0432-contextual-helpers.md and could be a good starting point to land the docs and we may iterate and polish as we go.

would appreciate feedback/recommendations

Copy link
Member

@chancancode chancancode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Broadly 👍🏼 from me.

I think we can quibble on whether the examples copied from the RFCs are actually useful for explaining what the feature is. In the RFC they are more geared towards exhausting most of the possibilities, in a spec-by-examples kind of way. In documentation that may be a bit much and the point kind of gets lost. In other words, we may want to trim it down so that we only have one or two succinct/common use cases that gets the main point across.

That being said, any docs are certainly better than no docs. So if @SergeAstapov wants to do another pass now I think that's great, but otherwise we can also just merge it and let someone else iterate on this another time.

@SergeAstapov
Copy link
Contributor Author

we may want to trim it down so that we only have one or two succinct/common use cases that gets the main point across.

I actually did that originally but then decided to provide exhaustive list examples.

trimmed down to 3 examples for both helper and modifier helpers

that it can be passed around as first-class values in templates.

```handlebars
{{#let (helper "join-words" "foo" "bar" separator=" ") as |foo-bar|}}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more thing (same for the other snippet): foo-bar is it actually legal to have a dash in the local variable (block param) name? I probably should know this but I don't 🙃

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to AST explorer it seems to be fine so that's good enough for me

@chancancode chancancode merged commit f296601 into emberjs:master Jun 14, 2022
@SergeAstapov SergeAstapov deleted the document-helper-modifier branch June 14, 2022 00:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Documentation] Documentation issue report
2 participants