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

Avoid unnecessary dependencies on @glimmer types #1304

Merged
merged 2 commits into from
Dec 21, 2022

Conversation

dfreeman
Copy link
Contributor

The published types from this package rely on @glimmer/interfaces in two places:

  • in the signature of render() to represent that it can accept a component
  • in the signature of the internal getComponentManager helper

This PR updates the signature of render() to simply accept any object as its first parameter. This is actually more accurate than the current type—at runtime, render() only requires that the object it receives is either a template or is some object with a component manager, but "has a component manager" isn't something we're able to model in the TS type system.

It also updates the return type of the getComponentManager utility to unknown, as we never actually interact with the manager, we only check for its existence. (In reality this change is likely unnecessary since this .d.ts file won't end up in the import path for consumers using public APIs, but updating this removes references to @glimmer/interfaces in the built types directory entirely.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants