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

add helper and modifier helpers #412

Closed
wants to merge 6 commits into from
Closed

Conversation

patricklx
Copy link
Contributor

@patricklx patricklx commented Sep 15, 2022

fixes #410

the documentation for them is not published yet. It should be there when 4.7 is published:
emberjs/ember.js@d75a0cb

@chriskrycho
Copy link
Member

Thank you! One of us will review this week!

@chriskrycho
Copy link
Member

@patricklx thanks again for opening this; mind fixing up the CI failures? I'll try to review tomorrow or Friday!

@chriskrycho chriskrycho added the enhancement New feature or request label Sep 28, 2022
@dfreeman
Copy link
Member

Thank you for opening this, @patricklx!

In addition to the things flagged in CI, I think these are going to need to be a bit more complex to capture what {{helper}} and {{modifier}} can do, which isn't just looking up global helpers/modifiers, but also pre-binding arguments to either a global {{helper "foo" 123 arg="hi"}} or to actual helper values {{helper this.someHelper 123 arg="hi"}}.

You can see an example of how this works with the {{component}} helper, which does the same thing: https://github.com/typed-ember/glint/blob/main/packages/environment-ember-loose/-private/intrinsics/component.d.ts

Is that something you've got the time/interest to take on? If so, great, and let us know if you need any additional guidance. If not, no worries—Chris or I should hopefully be able to get to it in the near future.

@boris-petrov
Copy link
Contributor

I just noticed that these two:

<div {{(if true (modifier "on" "click" this.func))}}></div>
<div {{(if true (modifier "on")) "click" this.func}}></div>

Actually mean the same thing so Glint should somehow support them both. No idea how. 😄

@dfreeman
Copy link
Member

Yep! Those two examples should fall out naturally and "just work" assuming we implement the currying semantics of those two helpers I mentioned above 🙂

@SergeAstapov
Copy link
Contributor

Hi @patricklx! Would you be able to pick up the suggestion from @dfreeman how to overcome missing parts here?

@chriskrycho
Copy link
Member

Actually, I believe @dfreeman is working on getting these done. From Discord:

I’m working on adding those (and hopefully slightly improving inference characteristics for {{component}}) for what should be the final 1.0 beta release

🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

support helper and modifier helpers
5 participants