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

[BUGFIX beta] Types: resolve services with Owner.lookup #20319

Merged
merged 1 commit into from
Dec 9, 2022

Conversation

chriskrycho
Copy link
Contributor

@chriskrycho chriskrycho commented Dec 9, 2022

Integrate the service registry into the DIRegistry introduced as part of rationalizing the Owner types in PR #20271 (94276b5). This allows Owner.lookup('service:foo') to resolve a FooService if one is set up in the @ember/service module's Registry interface. The preview types already used this mechanic (as of 5658b13), so this just means that when we ship the stable (i.e. built from source) version of @ember/service, it will continue working.

Meta: Shipping this implementation for the lookup was blocked on being able to publish type modules with declare module, which was implemented in PR #20316 (9adcd15). We will likely need to rework other parts of the type hierarchy to support publishing from source.

@chriskrycho chriskrycho added the TypeScript Work on Ember’s types label Dec 9, 2022
Integrate the service registry into the `DIRegistry` introduced as part
of rationalizing the `Owner` types in PR #20271 (94276b5). This allows
`Owner.lookup('service:foo')` to resolve a `FooService` if one is set
up in the `@ember/service` module's `Registry` interface. The preview
types already used this mechanic (as of 5658b13), so this just means
that when we ship the stable (i.e. built from source) version of
`@ember/service`, it will *continue* working.

Meta: Shipping this implementation for the lookup was blocked on being
able to publish type modules with `declare module`, which was
implemented in PR #20316 (9adcd15). We will likely need to rework other
parts of the type hierarchy to support publishing from source.
@chriskrycho chriskrycho changed the title Types: resolve services with Owner.lookup [BUGFIX] Types: resolve services with Owner.lookup Dec 9, 2022
@chriskrycho chriskrycho changed the title [BUGFIX] Types: resolve services with Owner.lookup [BUGFIX beta] Types: resolve services with Owner.lookup Dec 9, 2022
@chriskrycho chriskrycho merged commit a1c41ea into master Dec 9, 2022
@chriskrycho chriskrycho deleted the service-di branch December 9, 2022 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TypeScript Work on Ember’s types
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant