Make it easier to avoid errors with vanilla tsc
#248
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.
Background
While vanilla TypeScript tooling will always have an incomplete picture of what's happening in a project with Glimmer templates (otherwise there'd be no use for Glint!), many users keep that tooling active. This may be for access to richer features (see #130) or because they're working in an environment without full support for Glint.
Glint environments augment the types of certain packages, and then Glint itself implicitly adds references to those augmented types when transforming source code. Because TypeScript by itself won't add those references, code relying on the augmentations won't typecheck under vanilla
tsc
ortsserver
.To work around this, folks have added imports themselves to pull in the necessary module augmentations from private paths, which isn't ideal for them as consumers or us as maintainers.
This Change
This PR aims to make it so that all users must do for TS to give their Glint-enabled apps a clean bill of health is add
import 'the-environment-package'
somewhere in their project.A note has been added at the top of the GlimmerX and Ember.js sections of the README recommending this, and the
ts-ember-app
andts-glimmerx-app
test packages now runtsc
as part of their test suite.Fixes #222 and resolves #92.