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

Bring apps closer to typechecking out of the box #1169

Merged
merged 4 commits into from Jul 2, 2020

Conversation

dfreeman
Copy link
Member

@dfreeman dfreeman commented Jul 1, 2020

Today, if I run ember new my-app and then immediately follow that with ember install ember-cli-typescript, I can almost rename app.js, router.js and test-helper.js to end in .ts and have a typechecking application out of the box. There are still just a couple of blockers for that:

  • app.js imports ember-resolver but we don't install the @types package for that by default
  • test-helper.js references config.APP, which isn't part of the declarations we emit for config/environment
  • test-helper.js includes relative imports for app and config/environment that work at runtime but don't match the on-disk layout, so TS rejects the import

This PR aims to fix those first two bullets, and I have an ember-cli PR open to address the third.

@@ -146,8 +146,8 @@ module.exports = {
{ name: 'ember-cli-typescript-blueprints', target: 'latest' },
{ name: 'typescript', target: 'latest' },
{ name: '@types/ember', target: 'latest' },
{ name: '@types/rsvp', target: 'latest' },
Copy link
Member Author

@dfreeman dfreeman Jul 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@types/ember already brings in @types/rsvp, and having one fewer explicit version constraint floating around makes "cannot re-declare block scoped variables" less likely to crop up as folks update various dependencies.

Copy link
Member

@jamescdavis jamescdavis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

Copy link
Member

@chriskrycho chriskrycho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💕 ship it!

@dfreeman dfreeman merged commit 89e193f into master Jul 2, 2020
@dfreeman dfreeman deleted the typecheck-out-of-the-box branch July 2, 2020 15:21
@jamescdavis jamescdavis added this to the v4.0 milestone Jul 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants