-
Notifications
You must be signed in to change notification settings - Fork 99
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
ember-cli-typescript 2.0 #333
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[v2] Use Babel 7 transforms rather than tsc for transpilation
dfreeman
commented
Oct 24, 2018
[v2] Reintroduce typechecking
[v2] Code cleanup before an initial v2 prerelease
[v2] Install ember-cli-typescript-blueprints by default in the host
…-0.x chore(deps): update dependency ember-cli-update to v0.29.2 (v2)
chore(deps): update dependency @types/express to v4.16.1 (v2)
chore(deps): update dependency eslint to v5.13.0 (v2)
chore(deps): update dependency testdouble to v3.10.0 (v2)
chore(deps): update dependency @types/debug to v4 (v2)
chore(deps): update dependency @types/mocha to v5.2.6 (v2)
chore(deps): update ember types (v2)
chore(deps): update dependency typescript to v3.3.3 (v2)
chore(deps): update dependency ember-resolver to v5.1.1 (v2)
This reverts commit eecdd5b.
Okay, here we go! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This
v2
branch tracks progress toward a 2.0 release of ember-cli-typescript, which will hopefully alleviate a lot of the pain that folks both consuming and developing the addon have felt over the course of 1.x. The aim is to land incremental PRs against this branch and cut periodic beta releases from it to get early feedback and enable folks who want to experiment with things the new build approach will unlock.The primary planned change with 2.x is a switch from using
tsc
to using@babel/plugin-transform-typescript
for transpiling.ts
files. This comes with certain tradeoffs (outlined below) but has the massive benefit of playing more nicely with the rest of the ember-cli ecosystem and eliminating a lot of complex and fragile code that we're currently maintaining.Breaking Changes
dependency
rather than adevDependency
for addons. To this end, we've done work during the 1.x era to factor out all the blueprints (which accounted for a large portion of our dependency weight) into a separate addon, which in 2.x will need to be installed in the host alongsideember-cli-typescript
itself.tmp
may bog typechecking down on some systems. Ember CLI 3.5 movestmp
out of the project directory, eliminating that issue, so we should likely say that 3.5 is our minimum supported CLI version for the 2.0 release.namespace
,const enum
, andenum
s that span multiple declarations are all unsupported because emitting code for them requires type information<type>expr
-style casting is unsupported because it conflicts with JSX syntax (butexpr as type
is preferred anyway)get foo(this: bar)
), but these should be resolved over time and we as a community can contribute fixes as necessary.ts
files in theirapp
directories (this is how ember-cli preprocessors work, and we've been cheating up to now—I regret caving on that 😉).ts
files in theirapp
directories (assuming the root app itself uses ember-cli-typescript); transpilation for addons'app
files is managed by the host app's preprocessorsapp
trees must use.js
files to do so.To Do
Items on this list will be checked off as PRs land, and additional entries will also likely be added as they're discovered.
tsc
ts:precompile
command to only emit.d.ts
files, since.ts
ones will be used as part of the regular Babel build processember-cli-typescript-blueprints@2.0-beta.x
.js
files in theapp/
directory for addons, not.ts
onesember-cli-babel
andember-cli-typescript
asdependencies
ember-cli-typescript-blueprints@2
in the host as part of the defaultember-cli-typescript
blueprint (remove from our owndependencies
)paths
config rather than hard-coded knowledge of typical project structureisolatedModules
by default