Skip to content

Simplify resolution of context and signature types #16

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

Merged
merged 2 commits into from
Sep 7, 2020

Conversation

dfreeman
Copy link
Member

@dfreeman dfreeman commented Sep 7, 2020

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.

@dfreeman dfreeman added the breaking A breaking change label Sep 7, 2020
@dfreeman dfreeman merged commit 93565e6 into master Sep 7, 2020
@dfreeman dfreeman deleted the simplify-resolution branch September 7, 2020 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking A breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant