Skip to content

[v2] Use Babel 7 transforms rather than tsc for transpilation#334

Merged
dfreeman merged 8 commits intov2from
babel-7-transforms
Oct 24, 2018
Merged

[v2] Use Babel 7 transforms rather than tsc for transpilation#334
dfreeman merged 8 commits intov2from
babel-7-transforms

Conversation

@dfreeman
Copy link
Member

@dfreeman dfreeman commented Oct 5, 2018

This PR constitutes the first chunk of work toward #333. It replaces our use of tsc with @babel/plugin-transform-typescript for transpiling TypeScript files in the host.

Some notes:

  • I've added some basic local type declarations for ember-cli and converted the main addon module to TypeScript
  • At this point, ember-cli-typescript only transpiles code and does no typechecking
  • Most of the previous incremental-typescript-compiler code is still around for now; it will be cleaned up in the future once we have a good handle on typechecking
  • The ts:precompile command now only emits .d.ts files, since the .ts ones are consumed normally by Babel
  • Some test coverage has been removed
    • We're no longer testing MU code emitting: we would need to tie ourselves to ember-cli#master in order to actually test it, but since we're now just using a Babel plugin, the risk of breakage is much lower
    • We're no longer testing file shadowing behavior, as the expectations have changed (see the Breaking Changes section of ember-cli-typescript 2.0 #333 for details)
    • The "build fails on type error" acceptance test is temporarily disabled until we have typechecking again

@chriskrycho
Copy link
Member

Confirmed this works in our ~60kloc TS app. No issues, some workarounds needed as expected.

@dfreeman
Copy link
Member Author

I should add that I've gotten build + tests passing on a couple of open source projects as well

@dfreeman
Copy link
Member Author

Since this has gotten an initial pass of testing, I'm going to merge this branch into v2 so that we don't wind up with an ever-lengthening chain of dependent PRs. Review is still welcome over on #333.

@dfreeman dfreeman merged commit b979d06 into v2 Oct 24, 2018
@dfreeman dfreeman deleted the babel-7-transforms branch October 25, 2018 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants