Simplify resolution of context and signature types #16
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When a value of a given type is invoked in a template, glint needs a way to determine that value's signature—that is, what kind of template entity it behaves like, what kinds of inputs and outputs it expects, etc.
Similarly, when a template is associated with a given backing class, glint needs a way to determine what type of values
{{this}}
,{{@someArg}}
, etc have based on that type.Prior to this PR, that resolution was accomplished via indirect lookup against a registry in a similar manner to how
fp-ts
models typeclasses. This was necessary because the dependence on the template type to determine the overall type of a component required a high degree of flexibility in how we resolved signature and context types.Now, with the changes in #15, knowing the instance type of the value in question is sufficient to determine everything we need to know about how it behaves in a template, so we can remove the HKT registry approach in favor of directly tagging the appropriate types on the instance using well-known symbols.