Use TypeScript in your Ember.js apps!
@types/ember__destroyable
when running the default blueprint (#1526), @bertdeblock
import/newline-after-import
lint violation in global.d.ts
(#1520), @bmish
testing.md
to refer to ember-cli-htmlbars
instead of ember-cli-htmlbars-inline-precompile
(#1517), @ChristopheTiet
@types
dependencies to latest (#1531), @bertdeblock and @chriskrycho
ember-cli-htmlbars
rather than htmlbars-inline-precompile
in blueprints (#1519)import/newline-after-import
lint violation in global.d.ts
(#1520)no-use-before-define
lint violation in environment.d.ts
(#1521)@types/ember
to installed packages from blueprint (#1508)@tsconfig/ember
(#1507)Full Changelog: https://github.com/typed-ember/ember-cli-typescript/compare/v5.0.0...v5.1.0
This now requires Node 12+! That's the only technically breaking change.
locationType
for Ember v4 (#1466)ember-test-helpers
-> @ember/test-helpers
(#1473)locationType
by @NullVoxPopuli in https://github.com/typed-ember/ember-cli-typescript/pull/1466
moduleName()
to determine addon's referenced name. by @timlindvall in https://github.com/typed-ember/ember-cli-typescript/pull/1476
Full Changelog: https://github.com/typed-ember/ember-cli-typescript/compare/v4.2.1...v5.0.0
ember-cli-typescript no longer manages your Babel configuration, because ember-cli-babel does. This is an early step toward officially supporting TS across the Ember ecosystem. It also means that we now use Babelโs default configuration, which also comes with a small change to align better with the JavaScript spec around class fields.
For most cases, you wonโt notice the difference, but if you were previously using TypeScriptโs constructor property shorthand to define default values and using those values in a class field initializer, like thisโ
class Demo {
constructor(public name = '') {}
public nameLen = this.name.length;
}
โyou will find that the initializer now fails. This is because the spec requires that class field initializers run before anything in the class constructorโs body except a super
call, and TSโs custom syntax here is not part of the spec, and Babel therefore runs it after all other class field initializers.
This particular pattern was always a refactoring hazard: class field initializers should not refer to this
because they can be broken by unrelated changes in surprising ways. This particular code will now not work at all, so you will need to migrate away from it. You can replace it with this code instead:
class Demo {
public nameLen: number;
constructor(public name = '') {
this.nameLen = this.name.length;
}
}
--path
([#1148])tsconfig.json
blueprint target
value to 2020
([#1108])prepack
and postpack
instead of prepublishOnly
and postpublish
([#1196])willTypecheck
s on Linux ([#1198]).ts
files will be ignored completely!ember-auto-import
, make sure you are using at least ember-auto-import@^1.6.0.ember install ember-cli-typescript@^4.0.0
or use your package manager to upgrade to ember-cli-typescript@^4.0.0
directly and skip the blueprint.--path
(#1148)tsconfig.json
blueprint target
value to 2020
(#1108)prepack
and postpack
instead of prepublishOnly
and postpublish
(#1196)willTypecheck
s on Linux (#1198).ts
files will be ignored completely!ember-auto-import
, make sure you are using at least ember-auto-import@^1.6.0.ember install ember-cli-typescript@next
or use your package manager to upgrade to ember-cli-typescript@next
directly and skip the blueprint.Thanks to everyone who contributed to this release in any way! In randomly shuffled order:
ember install ember-cli-typescript@latest
Thanks to everyone who contributed to this release in any way! In randomly shuffled order: