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

Feature: introduce native (ambient) TS types #995

Merged
merged 2 commits into from Dec 16, 2022
Merged

Conversation

chriskrycho
Copy link
Contributor

@chriskrycho chriskrycho commented Dec 16, 2022

  • Add type definitions and type tests.
  • Explicitly specify the SemVer policy in the README.
  • Configure CI to run type tests against the package.
  • Add a note to the migration docs about how to update to use these.

This will shortly be superceded by types published from source and using the types published by Ember itself. Publishing this ahead of this provides a path for teams to start using ember-qunit with TypeScript without pulling it from DefinitelyTyped, allows us to remove ember-qunit from DefinitelyTyped entirely, and does not block either of those wins on the timeline of a full TS conversion.

To make this work, we need (because one of our dependencies needs) a peer and dev dep on @glimmer/interfaces and @glimmer/reference, so that types which use those will type check. This is: annoying in the extreme. We will want to keep thinking about how to tackle this as an ecosystem; for now, they are marked as optional so no one will have things blow up as a result of this at least (and that's also correct: we only need them for TS).

- Add type definitions and type tests.
- Explicitly specify the SemVer policy in the README.
- Configure CI to run type tests against the package.
- Add a note to the migration docs about how to update to use these.

This will shortly be superceded by types published from source *and*
using the types published by Ember itself. Publishing this ahead of
this provides a path for teams to start using `ember-qunit` with
TypeScript *without* pulling it from DefinitelyTyped, allows us to
remove `ember-qunit` from DefinitelyTyped entirely, and does not block
either of those wins on the timeline of a full TS conversion.

To make this work, we need (because one of our dependencies needs) a
peer and dev dep on `@glimmer/interfaces` and `@glimmer/interfaces`, so
that types which use those will type check. This is: annoying in the
extreme. We will want to keep thinking about how to tackle this as an
ecosystem; for now, they are marked as *optional* so no one will have
things blow up as a result of this at least (and that's also correct:
we *only* need them for TS).
@chriskrycho chriskrycho linked an issue Dec 16, 2022 that may be closed by this pull request
.github/workflows/ci.yml Outdated Show resolved Hide resolved
package.json Show resolved Hide resolved
chriskrycho added a commit that referenced this pull request Dec 19, 2022
I originally [thought][1] these `peerDependencies` were not breaking
because users would be able to opt into them. Unfortunately, this is
[not the case][2]: users on Ember 3.28 will have an older copy of these
dependencies, so correctly validating these breaks consumers.

[1]: #995 (comment)
[2]: #997 (comment)

We should bundle these into a v7.0.0 when we drop Node 14 and Ember
3.28, presumably in ~April 2023.
chriskrycho added a commit that referenced this pull request Dec 19, 2022
I originally [thought][1] these `peerDependencies` were not breaking
because users would be able to opt into them. Unfortunately, this is
[not the case][2]: users on Ember 3.28 will have an older copy of these
dependencies, so correctly validating these breaks consumers.

[1]: #995 (comment)
[2]: #997 (comment)

We should bundle these into a v7.0.0 when we drop Node 14 and Ember
3.28, presumably in ~April 2023.

Fixes #997
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.

Convert to TS or supply ambient definitions
3 participants