[BUGFIX LTS] Backport Resolver
to preview types
#20318
Merged
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.
This particular type did not "land" until 4.9.0, but its absence means the preview types published on 4.8 LTS will not be usable for most Ember TS users: without this backport,
ember-resolver
itself cannot publish correct types until 4.10 is out, andember-qunit
requires valid types forember-resolver
, which in turn blocks people from migrating from DT types forember-qunit
until they can use the types published withember-source
. It is a type-only import that was simply missed until doing some of the follow-on work, so it is completely safe to back port.Meta notes: I'm describing this as a "bug fix" because of a fairly complicated set of interactions that I've discovered in working through trying to solve #20254 across the ecosystem.
We have the new
Resolver
type. It’s present on Ember 4.9+.For any part of the community to be able to move to Ember’s own types, we need
ember-qunit
and@ember/test-helpers
to be publishing their own types. (There are others, especially Ember Data, but those are two of the biggest.) Otherwise, you end up with types for those coming from DefinitelyTyped, which are incompatible b/c of how they depend the DT definitions for e.g@ember/application
types, which are, far enough down the rabbit hole, incompatible with the stable types.ember-qunit
depends on theResolver
type, which its DT types currently get via@types/ember-resolver
.Which means ember-qunit needs to require types published natively one way or another from
ember-resolver
or just use the looser (and more correct!) contract fromimport { Resolver } from '@ember/owner'
.But for either of those to work, something has to give if folks are going to be able to use the types on 4.8 LTS:
Either
ember-resolver
needs to publish its own types which are compatible, and we have to maintain that compatibility by hand until… some arbitrary point where we can say it’s reasonable to say “you must use Ember 4.9+ if you want these types,” presumably after 4.12 is out as an LTS target.Or we backport the
Resolver
bits to 4.8 LTS and call it a “bug fix” because you can’t use the preview types without it, at which pointember-resolver
can say the same thing as literally the whole rest of the ecosystem: “This ships types as of vWhatever, but to use it you must use the latest 4.8 LTS Ember release to get that support.”This PR implements the second option there, because while it’s arguable from a SemVer Lawyer™ POV, it’s the one that gives the community the best shot at actually migrating successfully.