Merged
Conversation
[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.
Member
|
Okay, here we go! |
This file contains hidden or 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
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
v2branch 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
tscto using@babel/plugin-transform-typescriptfor transpiling.tsfiles. 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
dependencyrather than adevDependencyfor 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-typescriptitself.tmpmay bog typechecking down on some systems. Ember CLI 3.5 movestmpout 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, andenums 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 typeis preferred anyway)get foo(this: bar)), but these should be resolved over time and we as a community can contribute fixes as necessary.tsfiles in theirappdirectories (this is how ember-cli preprocessors work, and we've been cheating up to now—I regret caving on that 😉).tsfiles in theirappdirectories (assuming the root app itself uses ember-cli-typescript); transpilation for addons'appfiles is managed by the host app's preprocessorsapptrees must use.jsfiles 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.
tscts:precompilecommand to only emit.d.tsfiles, since.tsones will be used as part of the regular Babel build processember-cli-typescript-blueprints@2.0-beta.x.jsfiles in theapp/directory for addons, not.tsonesember-cli-babelandember-cli-typescriptasdependenciesember-cli-typescript-blueprints@2in the host as part of the defaultember-cli-typescriptblueprint (remove from our owndependencies)pathsconfig rather than hard-coded knowledge of typical project structureisolatedModulesby default