Use TypeScript in your Ember.js apps!
MIT License
Bot releases are hidden (Show)
Published by chriskrycho over 6 years ago
noEmitOnError: true
in tsconfig.json
.tmp
directory.ember install ember-cli-typescript@beta
Please open an issue with "1.3.0-beta.1" in the title if you have any new errors!
Everyone who opened an issue we fixed or PR we merged in this release!
Published by chriskrycho over 6 years ago
ember install ember-cli-typescript@latest
Everyone who opened an issue we fixed or PR we merged in this release!
Published by dfreeman over 6 years ago
app/
in an addon.<app-name>/config/environment
module now resolves correctly from app code. If you have a version of this file previously generated at types/<app-name>/config/environment.d.ts
, you'll likely want to move it to app/config/environment.d.ts
.ember install ember-cli-typescript@latest
Everyone who opened an issue we fixed or PR we merged in this release!
Published by dfreeman over 6 years ago
ember-cli-typescript
now deterministically override the base ones from ember-data
and ember-source
.ember install ember-cli-typescript@latest
Everyone who opened an issue we fixed or PR we merged in this release!
Published by chriskrycho over 6 years ago
tsconfig.json
blueprint to properly include the types
directory.ember install ember-cli-typescript@latest
Everyone who opened an issue we fixed or PR we merged in this release!
Published by chriskrycho over 6 years ago
tsconfig.json
now includes inline source maps to support integrating with Babel sourcemaps, and the README has instructions for configuring Ember CLI's Babel integration.app
trees now get compiled properly.ember install ember-cli-typescript@latest
Everyone who opened an issue we fixed or PR we merged in this release!
Published by chriskrycho over 6 years ago
Another day, another bunch of bug fixes.
types/<my app>/index.d.ts
: add missing import and an export statement so ambient declarations work.ember install ember-cli-typescript@latest
Published by chriskrycho over 6 years ago
Published by chriskrycho over 6 years ago
Mostly see v1.1.0.
ember-cli-version-checker
version too low by putting it in peerDependencies
.ember install ember-cli-typescript@latest
Published by chriskrycho over 6 years ago
This is the short version (and it mostly just duplicates the new CHANGELOG.md file). For the long version, read the announcement blog post!
ember generate <blueprint>
now creates TypeScript files for youember-cli-typescript
and typescript
itself can remain in devDependencies
instead of dependencies
, and addons can easily distribute compiled JavaScript with TypeScript type definition (.d.ts
) files.ember serve
or ember test --serve
now use TypeScript's tsc --watch
mode to only rebuild what changed, so your builds should be much fastertsconfig.json
is no longer so annoyingly temperamental; you can largely do what you want with it.ember serve
no longer triggers a full rebuild of all TypeScript files every time any file in your project changes.ember install ember-cli-typescript@latest
Massive credit goes to Dan Freeman (@dfreeman) and Derek Wickern (@dwickern), who did most of the heavy lifting on the internals for this release, and together unlocked both incremental compilation and addon support. Derek also did the lion's share of the work on writing the types for Ember and Ember Data.
Thanks to Maarten Veenstra (@maerten) for the original inspiration (and a spike last summer) for using a type registry, and to Mike North (@mike-north) for some discussion and planning around the idea late in 2017. I may have implemented them, but the ideas came from the community!
Thanks to Frank Tan (@tansongyang) for doing a lot of the work on porting the generators from the Ember and Ember Data repositories to ember-cli-typescript, as well as converting them to TypeScript and to use the new formats. He also contributed the type definitions for the new (RFC #232) QUnit testing API.
Thanks to everyone who contributed to ember-cli-typescript or the Ember typings in any way since we released 1.0.0:
ember-cli-typescript contributors (note that I intentionally include here everyone who opened issues on the repository: that is not a small thing and has helped us immensely):
Ember typings contributors:
Thanks to Rob Jackson (@rwjblue) and Tobias Bieniek (@Turbo87 on GitHub, @tbieniek in the Ember Slack) for answer tons of questions and putting up with regular pestering about Ember CLI.
And last but not least, thanks to everyone who's popped into #topic-typescript on the Ember Community Slack with questions, comments, problem reports, and the occasional word of encouragement. It really does help.
Published by chriskrycho almost 7 years ago
Integrate broccoli-typescript-compiler 2.1.1, for proper support for TS 2.6. This should make your build properly respect things like // @ts-ignore
special comments.
Run the install command again:
$ ember install [email protected]
This will run the generators again, so you should review the changes before committing. If you've made specific customizations to your tsconfig.json
, you'll need to merge them; see the Notes on tsconfig.json
in the README.
Published by chriskrycho almost 7 years ago
Updated the base tsconfig.json
to set the noImplicitThis
option to true
. What that means: your type inference will work correctly for methods when you do this now:
import Component from '@ember/component';
export default Component.extend({
thingToSay: 'Hello',
sayTo(name: string) {
const thingToSay = this.get('thingToSay');
alert(`${thingToSay}, ${name}!`);
},
});
Previously, you'd have seen the error Argument of type '"thingToSay"' is not assignable to parameter of type 'never'.
on the line with this.get
.
(Sadly, this doesn't fix a related but not identical issue with classes, but we'll get that sorted out shortly.)
Thanks, @inkless!
Run the install command again:
$ ember install [email protected]
This will run the generators again, so you should review the changes before committing. If you've made specific customizations to your tsconfig.json
, you'll need to merge them; see the Notes on tsconfig.json
in the README.
Published by chriskrycho almost 7 years ago
environment.d.ts
Published by chriskrycho about 7 years ago
Run the install command again:
$ ember install [email protected]
This will run the generators again, so you should review the changes before committing. If you've made specific customizations, you may want to merge them; see the Notes on tsconfig.json
in the README.
Thanks to some nice work by @simonihmig, cleans up the install process and makes various informational and error messages go to stderr or stdout and be colorized nicely. (If you were using something like JUnit, this might have badly broken your CI, and I'm truly sorry! —@chriskrycho)
Also, thanks to @ryanlabouve for cleaning up a dead link in the README!
Published by chriskrycho about 7 years ago
Run the install command again:
$ ember install [email protected]
This will run the generators again, so you should review the changes before committing. If you've made specific customizations, you may want to merge them; see the Notes on tsconfig.json
in the README.
Actually does what I claimed 1.0.1 did, but correctly: updates the generated tsconfig.json
to set "module": "es6"
in the compiler options, so that codemods which operate on modules, like babel-plugin-ember-modules-api-polyfill, will actually work.
Note: the typings for the RFC #176 are in progress here. This PR does not add types for the modules; it just makes it so that if you import using the new module style and the codemod, your app will actually build.
Published by chriskrycho about 7 years ago
Run the install command again:
$ ember install [email protected]
This will run the generators again, so you should review the changes before committing. If you've made specific customizations, you may want to merge them; see the Notes on tsconfig.json
in the README.
Updates the generated tsconfig.json
to set "modules": "ES6"
in the compiler options, so that codemods which operate on modules, like babel-plugin-ember-modules-api-polyfill, will actually work.
Note: the typings for the RFC #176 are in progress here. This PR does not add types for the modules; it just makes it so that if you import using the new module style and the codemod, your app will actually build.
Published by chriskrycho about 7 years ago
A stable foundation for building Ember.js apps with TypeScript!
Run the install command again:
$ ember install ember-cli-typescript@1
This will run the generators again, so you should review the changes before committing. If you've made specific customizations, you may want to merge them; see the Notes on tsconfig.json
in the README.
A bunch of internal changes, with minimal impact on you as a consumer except improving runtime a teensy bit and making it so your types all check a bit better right out of the box:
this.ui.write
instead of console.log
paths
(thanks @toranb!)Many thanks to @krisselden, @rwjblue, @dwickern, @mfeckie, and @twokul for their contributions!
Note: the new modules API is not yet supported by the official typings (which are distinct from this addon, though we install them). We hope to have support for them in a week or two!
Published by chriskrycho about 7 years ago
Courtesy of @mfeckie and @twokul, with a hard-to-identify-but-oh-so-important one-line fix that makes this work (again!) for Ember Engines!
Published by chriskrycho about 7 years ago
You can now compile in-repo addons, which should also help make engines work! Thanks again to @dwickern for adding not only the feature but also tests to make sure it works.
Published by chriskrycho about 7 years ago
Courtesy of @dwickern's awesomeness in testing, made it so we have less dumb errors on build: we no longer pass allowJs into TypeScript, since Broccoli manages the .ts and .js files for us.