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

Make it easier to avoid errors with vanilla tsc #248

Merged
merged 5 commits into from
Jan 14, 2022
Merged

Make it easier to avoid errors with vanilla tsc #248

merged 5 commits into from
Jan 14, 2022

Conversation

dfreeman
Copy link
Member

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 or tsserver.

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 and ts-glimmerx-app test packages now run tsc as part of their test suite.

Fixes #222 and resolves #92.

@dfreeman dfreeman added the enhancement New feature or request label Jan 14, 2022
@dfreeman dfreeman merged commit 8172ba4 into main Jan 14, 2022
@dfreeman dfreeman deleted the tsc-compat branch January 14, 2022 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Type 'GlimmerComponent<{}>' is not assignable to type 'TemplateComponent<{}>'. Can't find registry module
1 participant