-
Notifications
You must be signed in to change notification settings - Fork 51
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
Discussion/pre-RFC: what is the right long-term home for environment types? #411
Comments
I think this makes sense, particularly as first-class TS support is approaching reality in Ember itself. Everything that follows is just sifting through the details.
I think in this scenario (if I'm understanding correctly),
From a naming perspective, we might go with Then we could have
Agreed we would need to think carefully about the semver policy here, but I expect after the changes under discussion in #396 land that We also need to worry some about the touchpoint between
Glint does of course have a connection to the underlying Off the top of my head, the only tight binding I know we have currently outside of an environment package is the use of I think our reasoning for making |
Today, Glint supplies all of the type definitions it requires to work via a combination of the @glint/template package (the baseline for the rest) and the various environments which extend that appropriately for their own context. This is serving us well so far, but it has the potential to cause some issues down the line, which I want to note down as I'm thinking about them today.
One of the frustrations with DefinitelyTyped is that there is no good way to match the versioning between the types on DT with the actual version of any given package, particularly around new features added in minor releases. For example, we recently had a very annoyed user complaining about the Ember 3.x types including all APIs released up through 3.28 on types which worked for any Ember 3.x consumer, and thereby providing some misleading suggestions for APIs which do not exist on the version he was on. (I do not want to over-index on that particular complaint, of course, but it is illustrative of the challenge.) We have the same potential issue for every item which appears in the globals list for any given environment.
Consider the introduction—hopefully soon!—of the equality and comparison keywords: these will need to be added to the globals/built-ins list in
environment-ember-loose
, but they will only actually work correctly in Ember on a version which actually includes that functionality.1 We do not have any particularly good way to signal which versions of Glint environment types are compatible with a given Ember version. We can (and, as long as we are taking this tack, definitely should) document it, but we also then have the problem of figuring out how to handle bug fix releases—do we end up having@glint/template
with1.1.x
and1.2.x
maintenance streams ongoing, where1.2.x
supports Ember 4.10+, while1.1.x
does not? Etc.Net, I propose that medium-to-long-term, the Glint environments should move out of Glint to the packages which they represent. Now, that has its own potential problems in that we could end up with Glint depending on types from those packages and those packages depending on types from Glint. One way to cut that knot is to make sure that
@ember/glint
(hypothetical future package) is a real package which is versioned in lockstep with and published out of the same repo asember-source
, and to then guarantee that the direction of dependencies only ever running these ways:ember-source
←@glint/template
ember-source
←@ember/glint
@glint/template
←@ember/glint
I believe that would resolve that particular thorny issue, while giving us the ability to make sure we keep the definitions for the environment in sync—but it’s very possible there’s a piece of it I’m not seeing! Also, it still has a relatively annoying issue around versioning of
@glint/template
andember-source
(and the relation of both to the underlying@glimmer/*
bits: because they are intimately and inextricably connected to at least some degree).Thoughts, @dfreeman @jamescdavis?
Footnotes
or via polyfill, of course, but the point is generally the same. ↩
The text was updated successfully, but these errors were encountered: