Skip to content

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

Merged
chriskrycho merged 1 commit intomasterfrom
service-di
Dec 9, 2022
Merged

[BUGFIX beta] Types: resolve services with Owner.lookup#20319
chriskrycho merged 1 commit intomasterfrom
service-di

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 enabled auto-merge December 9, 2022 20:05
@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