-
-
Notifications
You must be signed in to change notification settings - Fork 405
Description
Today, support for helpers, components, modifiers, etc is all hard-coded in Glint.
For folks wanting to use glint, and have their custom-manager implementations support TS, there is no path here.
I think we should figure out a path for managers to provide the types to Glint, based on the type of thing received in the template -- since
aside from raw-values, everything involves a manger -- components, helpers, modifiers, etc.
For example,
all of these use custom managers and have no way to utilize typed templates (would currently show unresolveable errors to consumers of these addons):
-
using the component manager
- https://github.com/NullVoxPopuli/ember-statechart-component/
- https://github.com/NullVoxPopuli/ember-lifecycle-component
- https://github.com/NullVoxPopuli/ember-function-component
- https://github.com/rwjblue/ember-functional-component
- https://github.com/alexlafroscia/ember-context
- https://github.com/izelnakri/glimmer-embedded
- https://github.com/sandydoo/ember-google-maps
- https://github.com/mjanjic01/ember-konva
-
using the helper manager
- https://github.com/NullVoxPopuli/ember-functions-as-helper-polyfill/
- https://github.com/nullvoxpopuli/ember-resources
- https://github.com/BBVAEngineering/ember-route-helpers
- https://github.com/tracked-tools/ember-could-get-used-to-this
- https://github.com/LevelbossMike/ember-statecharts
- https://github.com/izelnakri/emberx
- https://github.com/josemarluedke/glimmer-apollo
-
using the modifier manager
- https://github.com/NullVoxPopuli/ember-functions-as-modifiers-polyfill/
- https://github.com/pgengler/flashcards-client
- https://github.com/gmurphey/ember-did-resize-modifier
- https://github.com/hashicorp/consul
- https://github.com/wongpeiyi/ember-animated-routes
- https://github.com/chadian/ember-fill-up
- https://github.com/OAGAnalytics/ember-split-view-modifier
- https://github.com/tracked-tools/ember-could-get-used-to-this
- https://github.com/NullVoxPopuli/ember-popperjs
- https://github.com/lifeart/ember-ref-modifier
- https://github.com/josemarluedke/ember-focus-trap
- https://github.com/upfluence/oss-components
-
what do we do if we add more managers? (like a service manager)
(as a disclaimer, I used github's search, and picked out a few things -- idk how used these things are -- but it looks like many are used by sizable companies)
Atm, @glimmer/component, specifically has ExpandSignature: https://github.com/typed-ember/glint/blob/0e31e49301776d552429892d5749ecbf88f68d00/packages/template/-private/index.d.ts
RFC here: #748
So (atm), I'm kinda thinking we need some sort of "ExpandSignature" type thing per syntax, rather than per implementation.
So, right now we have a ExpandSignature for the glimmer/component -- but what about all the other components? Or how does Expanding the signature of a helper or modifier work? we know what these are statically as they're all matched on prototype, so I can imagine "something" like:
interface HelperManagerLookup {
[SomeHelperPrototype]: SignaturueForThisHelper,
[EmberHelperProtoype]: EmberHelperSignature,
}(and similar for modifiers, components, and maybe eventually services, too? idk)
Relevant discussion in Discord: https://discord.com/channels/480462759797063690/814921339219476571/980229057931276308