Use TypeScript in your Ember.js apps!
MIT License
Bot releases are hidden (Show)
Published by chriskrycho almost 6 years ago
For details on the changes since 1.x, see the 2.0.0-beta.1
release notes.
tsc
re: class property initialization order (#365)ember install ember-cli-typescript@beta
Thanks to everyone who opened/discovered an issue we fixed or PR we merged in this release!
Published by dfreeman almost 6 years ago
For details on the changes since 1.x, see the 2.0.0-beta.1
release notes.
ember install ember-cli-typescript@beta
Thanks to everyone who opened an issue we fixed or PR we merged in this release!
Published by chriskrycho almost 6 years ago
Just some fixes and polishes!
ember install [email protected]
Thanks to everyone who opened an issue we fixed or PR we merged in this release!
Published by chriskrycho almost 6 years ago
This is a major release with π₯ breaking changes π₯! However, most apps will compile with minimal (or no) changes! π They'll also tend to compile much faster in many cases. β‘οΈ
We now use Babel 7's support for TypeScript to build apps and addons. Most of the horrible hacks we had to do before are now gone, and the error outputs you will see for type errors are much nicer as well. (As a particular note, we should work better with ember-auto-import
now, since we're just part of the normal Broccoli/Babel pipeline Ember CLI uses.)
THIS IS A BETA! Please test this out in your apps! Please do not use this for your production apps!
We now build the application using Babel 7's TypeScript plugin. This has a few important limitations β some of them bugs (linked below); others are conscious decisions on the part of Babel. The changes:
const enum
types are unsupported. You should switch to constants or regular enums.
trailing commas after rest function parameters (function foo(...bar[],) {}
) are disallowed by the ECMAScript spec, so Babel also disallows them.
re-exports of types have to be disambiguated to be types, rather than values. Neither of these will work:
export { FooType } from 'foo';
import { FooType } from 'foo';
export { FooType };
In both cases, Babel attempts to emit a value export, not just a type export, and fails because there is no actual value to emit. You can do this instead as a workaround:
import * as Foo from 'foo';
export type FooType = Foo.FooType;
this
types in ES5 getters and setters are do not work (babel/babel#8069)
destructuring of parameters in function signatures currently do not work (babel/babel#8099)
Other bugs you should be aware of:
ember-cli-typescript
must be in dependencies
instead of devDependencies
for addons, since we now hook into the normal Broccoli + Babel build pipeline instead of doing an end-run around it
Addons can no longer use .ts
in app, because an addon's app
directory gets merged with and uses the host's (i.e. the other addon or app's) preprocessors, and we cannot guarantee the host has TS support. Note that in-repo-addons will continue to work for in-repo addons because of the app build works with the host's (i.e. the app's, not the addon's) preprocessors.
Apps need to use .js
for overrides in app, since the different file extension means apps no long consistently "win" over addon versions (a limitation of how Babel + app merging interact) β note that this wonβt be a problem with Module Unification apps
ember install ember-cli-typescript@beta
Thanks to everyone who opened an issue we fixed or PR we merged in this release!
Published by dfreeman about 6 years ago
Thanks to everyone who opened an issue we fixed or PR we merged in this release!
Published by chriskrycho about 6 years ago
ember install [email protected]
Published by chriskrycho about 6 years ago
ember install [email protected]
Published by chriskrycho about 6 years ago
ember install [email protected]
Published by chriskrycho about 6 years ago
ember install ember-cli-typescript@latest
ember install ember-cli-typescript@latest
Published by dfreeman about 6 years ago
ember install ember-cli-typescript@latest
Thanks to everyone who opened an issue we fixed or PR we merged in this release!
Published by jamescdavis about 6 years ago
node_modules
hoisted above project root (e.g. yarn workspaces)@types/ember__test-helpers
test-support
and addon-test-support
directoriesember install ember-cli-typescript@latest
Thanks to everyone who opened an issue we fixed or PR we merged in this release!
ember-cli-typescript
will now run after ember-decorators
, ensuring that the ember-cli-typescript
blueprints override ember-decorators
'.ember install ember-cli-typescript@latest
Thanks to everyone who opened an issue we fixed or PR we merged in this release!
ember install ember-cli-typescript@latest
Thanks to everyone who opened an issue we fixed or PR we merged in this release!
ember install ember-cli-typescript@latest
Please open an issue with "1.3.1" in the title if you have any new errors!
Thanks to everyone who opened an issue we fixed or PR we merged in this release!
Published by jamescdavis over 6 years ago
This release says bye to compilation churn, bye to spurious rebuilds and errors, and bye to relaxed TypeScript checks by default. Great efforts were made to get Broccoli and the TypeScript compiler "NSYNC".
Note: As of this release, re-running the blueprint on an existing project (e.g. ember generate ember-cli-typescript
) will update tsconfig.json
with maximum compiler strictness settings, which are likely to result in new TypeScript errors being reported. You can always turn these checks off individually, but they are now on by default.
noEmitOnError: true
in tsconfig.json
.tmp
directory.tsconfig.json
to use the maximum strictness we can with Ember's typings.ember install ember-cli-typescript@latest
Please open an issue with "1.3.0" in the title if you have any new errors!
Thanks to everyone who opened an issue we fixed or PR we merged in this release!
Published by dfreeman over 6 years ago
Published by chriskrycho over 6 years ago
tsconfig.json
to use the maximum strictness we can with Ember's typings.ember install ember-cli-typescript@beta
Please open an issue with "1.3.0-beta.4" in the title if you have any new errors!
Published by chriskrycho over 6 years ago
ember install ember-cli-typescript@beta
Please open an issue with "1.3.0-beta.3" 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 dfreeman over 6 years ago
ember install ember-cli-typescript@beta
Please open an issue with "1.3.0-beta.2" in the title if you have any new errors!
Everyone who opened an issue we fixed or PR we merged in this release!