-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Migrate code base to TypeScript #335
Comments
Hi @parisk, a few comments from the peanut gallery based on experience in https://github.com/jupyterlab/jupyterlab.
|
What problems that we have already ran into will be solved by TypeScript's features (e.g. type safety, classes etc.)?
Timing: Does it need to be implemented now (why?) or can wait until we really need this? Why not now? I believe this will boost productivity so earlier is better. What are possible regressions that might be introduced by this? It shouldn't introduce any regressions apart from the the shuffling of addons (whose locations aren't technically part of the API). It could identify some obscure bugs however when we start the process of adding the typings. What should we change in our current toolset? -babel +typescript Not sure if this will be a barrier to entry for new contributors A colleague looked into this when determining whether to use JS or TS for their team's new project and came back saying there may be a few contributors that will not contribute but the benefits you gain as mentioned above outweigh the loss of this small portion of contributors. As I mention below it's more users who refuse to use it, instead of trying, as the syntax is ES6 with some self-explanatory niceties added on. Not all maintainers are familiar with TypeScripts (so most of us will need to learn a new language and adapt to its ecosystem) When I started on VS Code I didn't know TypeScript either but never the less felt productive right from the start. Most of the syntax is based on ES6 or self explanatory with the exception of typing which is a huge benefit to quality (plus also self-explanatory). The only real difficulty I've faced since picking up TypeScript is setting up a project with it. Might be an overkill for this project xterm.js is currently sitting at over 5000 lines and it's not the only file, that's not a particularly small library. |
Although I'm not one of the main contributors to Xterm.js, I'd like to share my two cents here too. TLDR: I believe that switching to TypeScript would be the way to go, I just have a concern. How is is it to gradually switch our code? Are there any best practices of doing such a switch? How big the "minimum" effort needed for the first TypeScript release? Both @Tyriar experience with TypeScript and @blink1073 with doing such a switch in the past would be of great value here. On the bright side now:
|
We went the wholesale path of using the |
I understand, but I believe that using this flag will make the I'm not sure we'll be ready to go this way. Unless we gradually extract pieces from the core to |
In my experience even larger files tend to go rather quickly once you get into the mode of adding types. Most of the types are self-evident. |
👍 thanks a lot for the insights. I'll take a deeper look given the above info. |
I was planning on doing the majority of the conversion, the plan was to convert the existing modules first (CompositionHelper, Viewport, etc.) and then tackle xterm.js by either doing a once over to get it into a reasonable state or factoring out more modules at that point if that's easier. |
Also apply JavaScript rules in `.editorconfig` in TypeScript files as well. Part of #335
Also apply JavaScript rules in `.editorconfig` in TypeScript files as well. Part of #335
Also apply JavaScript rules in `.editorconfig` in TypeScript files as well. Part of #335
Part of xtermjs#335
One of the things proposed in order to increase the quality of this code base as it grows (both in code and popularity) was migrate from JavaScript to TypeScript.
TypeScript sports several cool features like type safety, classes etc. and is a superset of JavaScript, so not much will change.
Questions
There are some questions though that have to be answered before making such a "big" move:
Concerns
My main concerns about moving code base to TypeScript are:
/cc @Tyriar since IMO you can contribute better into this.
The text was updated successfully, but these errors were encountered: