How to handle a helper and a modifier with the same name? #204
-
I'm using both @ember/render-modifiers and ember-render-helpers. The former adds a I don't think it's possible to handle that in Glint right now. What can I do? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
I think this is something we're probably not super likely to officially support, as it's not really clear how to do it in a clean way and this problem goes away with strict mode. That said, unofficially this is expressible using private APIs. As always, use these at your own risk—these types might change in any Glint release. // ️⚠️ This code may break at any time! This version is current as of Glint 1.0.0-beta.1
import { ModifierReturn, DirectInvokable } from '@glint/template/-private/integration';
import { ContentValue } from '@glint/template';
declare module '@glint/environment-ember-loose/registry' {
export default interface Registry {
'did-insert': DirectInvokable<{
(callback: () => void): ContentValue;
<T extends Element>(element: T, callback: (el: T) => void): ModifierReturn;
}>;
}
} |
Beta Was this translation helpful? Give feedback.
-
An update for those who use https://github.com/buschtoens/ember-render-helpers/releases/tag/v1.0.0 |
Beta Was this translation helpful? Give feedback.
I think this is something we're probably not super likely to officially support, as it's not really clear how to do it in a clean way and this problem goes away with strict mode.
That said, unofficially this is expressible using private APIs. As always, use these at your own risk—these types might change in any Glint release.