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
Setup TypeScript for the project #5424
Comments
The TypeScript compiler has a flag,
We could also start re-writing the smaller modules and slowly progress to bigger ones.
|
I'm going to make a start on this if there are no objections |
This evening I made a start with TypeScript where I have the Currently there's two ecmascript proposals for this functionality:
However both proposals are still in stage 1 and therefor will not be in the language anywhere soon. Two solutions I can think of right now:
I'd love to hear your thoughts on this. |
@erwinheitzman let‘s use the normal bind method given that the proposals haven’t made much progress. |
I believe we can start refactoring package by package. It would be way easier to review |
yeah I am starting with the webdriverio package and migrate only a few small files but once I have it setup we should be able to reuse that across all packages |
Let's keep the scope of this issue to setup TypeScript for all modules with minimal actual code rewrite after that we can start refactoring file by file. |
@erwinheitzman do you think we can change the target from es5 to I'd also insist on using a linter for TS files straight away, ex:
|
With #5804 we will get rid of Babel and therefor can close this. |
Is your feature request related to a problem? Please describe.
As the code base is growing and the ecosystem leaning more and more towards TypeScript as type safe JavaScript flavor it makes sense to introduce it into the project as well. It help us grow the code base while at the same time reduce the amount of errors due to type issues.
Describe the solution you'd like
Let's get rid of Babel as compiler and replace it with TypeScript to start type safe programming. As we can't just rewrite the whole code base we should introduce a setup that allows us to continue to use our ESNext code while start writing new code in TypeScript.
Describe alternatives you've considered
Alternatively I considered just getting rid of Babel and convert everything to ES Modules (see #5401). However this can still be achieved with TypeScript.
Additional context
This discussion was triggered by #5399 and was discussed with the @webdriverio/technical-steering-committee. Everyone agreed that switching to TypeScript is a good idea. The reason why (particular myself) was hesitating towards this was that adding TypeScript to the code base increases the barrier for contributing to the project. However the code base increased in size which already creates a high barrier for people that aren't experienced enough.
The text was updated successfully, but these errors were encountered: