Vue-test-utils: Migrate this project to TypeScript

Created on 17 Jan 2019  ·  8Comments  ·  Source: vuejs/vue-test-utils

What problem does this feature solve?

TypeScript is more and more popular at present. Will the source code of this project migrate to TypeScript? This can let definition files be generated automatically.

What does the proposed API look like?

N/A

feature request intend to implement

Most helpful comment

Yes there is a plan to migrate to TypeScript, but I'm focussed on getting Vue Test Utils to 1.0 before migrating. If somebody else would like to migrate then I am happy to review.

Note that I think we should keep the test files as JavaScript.

All 8 comments

Yes there is a plan to migrate to TypeScript, but I'm focussed on getting Vue Test Utils to 1.0 before migrating. If somebody else would like to migrate then I am happy to review.

Note that I think we should keep the test files as JavaScript.

Note that I think we should keep the test files as JavaScript.

Are the test files of this project or of users' test files?

The test files of this project, in the test directory

I would be interested in helping with this.

As would I. I have been working with TS a lot lately, and some of Vue's pain points around TS support (which will change with 3.0) have become clear. Anything that improves TS support is a big plus from me.

Has anyone got experience moving a large scale project to TS? This seems challenging, since the Flow types might clash. I'm guessing the best way is

  1. add the things required to compile ts (yarn add typescript). Set it up to allow you to import .js. files. This would be the branch all TS conversion PRs target, likelyepic/typescript-migration` or something, that kicks the migration off.
  2. pick a simple file. Change it to .ts, and make sure the tests still pass.
  3. Add types to said .ts file
  4. Repeat

This post has some details on how to handle flow/ts in the same codebase.

I can migrate some pieces of code to TS. @eddyerburgh may I do it?

Yes @sh7dm 👍 . But please keep tests in JavaScript for now

Ok

Was this page helpful?
0 / 5 - 0 ratings