ember-cli-typescript

Use TypeScript in your Ember.js apps!

MIT License

Downloads
2M
Stars
364
Committers
67

Bot releases are hidden (Show)

ember-cli-typescript - Let's churn less

Published by chriskrycho over 6 years ago

What Changed?

Added

  • The addon now supports failing the build when there are type errors, using noEmitOnError: true in tsconfig.json.

Changed

  • Clarified instructions for sourcemaps.

Fixed

  • TypeScript no longer churns on every change in the tmp directory.
  • Make sure ember-cli-typescript is a dev dependency when generating in-repo-addons, so their TypeScript gets built correctly.
  • Eliminated some lint errors in the build.

Upgrading

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!

Contributors

Everyone who opened an issue we fixed or PR we merged in this release!

  • Dan Freeman (@dfreeman)
  • Frank Tan (@tansongyang)
  • Jacob (@jacobq)
  • John Ruble (@jrr)
  • Per Lundberg (@perlun)
  • Martin Feckie (@mfeckie)
ember-cli-typescript - Someday, in-repo-addons will Just Work™

Published by chriskrycho over 6 years ago

What Changed?

Fixed

  • Blueprint now correctly adds ember-cli-typescript as a dependency, allowing TS to be merged into the regular app tree.

Upgrading

ember install ember-cli-typescript@latest

Contributors

Everyone who opened an issue we fixed or PR we merged in this release!

  • Martin (@mfeckie)
ember-cli-typescript - What's Old is New Again

Published by dfreeman over 6 years ago

What Changed?

Added

  • Blueprint (and tests) to generate in-repo addons configured for TypeScript
  • @ts-ignore component template import.
  • -addon blueprints for all the things to generate .ts files in app/ in an addon.

Changed

Fixed

  • Addon components need to manually set their layout property to the imported compiled template.
  • The declaration file for the <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.

Upgrading

ember install ember-cli-typescript@latest

Contributors

Everyone who opened an issue we fixed or PR we merged in this release!

  • Bouke Haarsma (@Bouke)
  • James Davis (@jamescdavis)
ember-cli-typescript - Out of the Box!

Published by dfreeman over 6 years ago

What Changed?

Fixes

  • The blueprints provided by ember-cli-typescript now deterministically override the base ones from ember-data and ember-source.
  • Correct type declarations are installed out of the box based on what test framework is present.
  • A catch-all model registry is generated on installation to avoid the "error TS2344" problem.

Upgrading

ember install ember-cli-typescript@latest

Contributors

Everyone who opened an issue we fixed or PR we merged in this release!

  • Arnav Gupta (@championswimmer)
  • Bouke Haarsma (@Bouke)
  • Jacob (@jacobq)
  • James Davis (@jamescdavis)
  • Theron Cross (@theroncross)
  • @vlascik
ember-cli-typescript - In-repo-addons are addons too!

Published by chriskrycho over 6 years ago

What changed?

Fixes

  • Fixed a regression in 1.1.4 which caused in-repo-addons written in TypeScript not to work correctly.
  • Fixed the tsconfig.json blueprint to properly include the types directory.

Upgrading

ember install ember-cli-typescript@latest

Contributors

Everyone who opened an issue we fixed or PR we merged in this release!

  • Dan Freeman (@dfreeman)
  • James Davis @jamescdavis
ember-cli-typescript - The app is last.

Published by chriskrycho over 6 years ago

What changed?

Changed

  • The default 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.

Fixed

  • TypeScript files in addon app trees now get compiled properly.
  • App files now correctly take precedence over any files of the same name earlier in the tree. (If you had a component with the same name as an addon-supplied component, for example, the addon version could override yours.)

Upgrading

ember install ember-cli-typescript@latest

Contributors

Everyone who opened an issue we fixed or PR we merged in this release!

  • Arnav Gupta (@championswimmer)
  • Dan Freeman (@dfreeman)
  • Derek Wickern (@dwickern)
  • Toran Billups (@toranb)
  • Tabeth Nkangoh (@tabeth)
ember-cli-typescript - It’s okay, Mirage. We got you.

Published by chriskrycho over 6 years ago

What changed?

Another day, another bunch of bug fixes.

Fixes

  • Fix default blueprint for types/<my app>/index.d.ts: add missing import and an export statement so ambient declarations work.
  • Add types to initializer and instance initializer blueprints.
  • Special-case handling for Mirage so that it works at all, and update generators so it works "out of the box".
  • Stop assuming the ember-cli-qunit version consumers have installed will be sufficiently high for our tests to pass.

Upgrading

ember install ember-cli-typescript@latest

Contributors

  • Chris Santero (@csantero)
  • Dan Freeman (@dfreeman)
  • Derek Wickern (@dwickern)
  • Bouke Haarsma (@Bouke)
ember-cli-typescript - So basically peer dependencies… are not a thing. 🙄

Published by chriskrycho over 6 years ago

Mostly see v1.1.0.

Fixed

  • Actually resolve the problem of throwing when running generators if ember-cli-version-checker version too low: put it in dependencies.

Upgrading

ember install ember-cli-typescript@latest

Contributors

ember-cli-typescript - Edge cases with npm, booo

Published by chriskrycho over 6 years ago

Mostly see v1.1.0.

Fixed

  • No longer throw when running generators if ember-cli-version-checker version too low by putting it in peerDependencies.
  • Clarified some parts of the README that misled people on handling certain errors.

Upgrading

ember install ember-cli-typescript@latest

Contributors

ember-cli-typescript - Faster! Generators! Addons!

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!

Added

  • Generators: ember generate <blueprint> now creates TypeScript files for you
  • Support for addons: we now precompile addon TypeScript so ember-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.
  • Incremental compilation: ember serve or ember test --serve now use TypeScript's tsc --watch mode to only rebuild what changed, so your builds should be much faster

Fixed

  • tsconfig.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.

Upgrading

ember install ember-cli-typescript@latest

Credits and Thanks

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:

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.

ember-cli-typescript - Properly support TS 2.6

Published by chriskrycho almost 7 years ago

What's new?

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.

Upgrading

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.

ember-cli-typescript - Make `this` nicer.

Published by chriskrycho almost 7 years ago

What's new?

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!

Upgrading

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.

ember-cli-typescript - Made some things nicer, that's all.

Published by chriskrycho almost 7 years ago

What's new?

  • Updated broccoli-compiler-typescript
  • Updated package.json to always install latest version of type definitions
  • Made everything ✨ Prettier ✨
  • Fixed the default generated environment.d.ts
ember-cli-typescript - Errs to stderr, the way it should be.

Published by chriskrycho about 7 years ago

Upgrading

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.

Changes

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!

ember-cli-typescript - Do what I mean, not what I say

Published by chriskrycho about 7 years ago

Upgrading

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.

Changes

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.

ember-cli-typescript - Doesn't break with new modules API now 🎉

Published by chriskrycho about 7 years ago

Upgrading

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.

Changes since 1.0.0

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.

ember-cli-typescript - Type your apps!

Published by chriskrycho about 7 years ago

A stable foundation for building Ember.js apps with TypeScript!

Upgrading

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.

Changes since 0.4.0:

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:

  • Update to [email protected]
  • Run prettier on the codebase
  • Use this.ui.write instead of console.log
  • Only process the tsconfig file once, instead of for every Broccoli tree (i.e. addons, the app, and the tests)
  • Update Ember CLI and TypeScript (thanks @mfeckie!)
  • Add some documentation of using paths (thanks @toranb!)
  • Include more type definitions in the default blueprint

Many thanks to @krisselden, @rwjblue, @dwickern, @mfeckie, and @twokul for their contributions!

New modules API

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!

ember-cli-typescript - Type your engines!

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!

ember-cli-typescript - Look ma! In-repo addons!

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.

ember-cli-typescript - Don't double-compile JS

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.

Package Rankings
Top 1.25% on Npmjs.org
Top 9.55% on Proxy.golang.org
Badges
Extracted from project README
Actions Status Ember Observer Score TS Version