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 codebase from coffeescript to ES6 #3459
Comments
This has begun in 791d737. |
What about Typescript? 🤓 |
Formal types would be nice, but I want to generally avoid transpilation, to keep the development model simple. |
Just a small tip: |
@gdh1995 Great, thanks for calling this out. I'll bump the minimum required versions of Firefox and Chrome so we can use ES2017, and note which version of javascript developers are allowed to use in CONTRIBUTING.md. Ok, this conversion is now complete. I did the port very carefully using decaffeinate with a lot of subsequent tuning of the input coffeescript, and then the converted javascript, but even still, there are at least 3 bugs I was able to easily spot after some usage, which I didn't spot while I was in the middle of the conversion: #3566, #3567, #3568. I expect there are many more small ones which will surface when others start using this (I don't regularly use all of the features of Vimium). Please file them when you see them. Retrospective: I'm very thankful to be done with Coffeescript. It has persisted long past its usefulness. Besides it being a barrier to entry for many javascript developers, it added insidious complexity which was gnawing at our code base:
From this point forward, I intend to make the code base increasingly simple. This was the first big step. |
Since the removal of coffeescript in #3459, we're now using some newer features of javascript. I think the most recent feature we're currently using is Array.flat, which was introduced in Chrome 69 and Firefox 62. I checked the google analytics for our chrome store page, and less than 0.5% of users visiting that page have a Chrome version prior to 80, so this increased version requirement should be acceptable. We don't currently enforce a minimum version for Firefox; I'll do that in a separate commit.
How did you do that ? I'm also caring about the statistics of Chrome versions, but the extension dashboard doesn't provide it.
Maybe those old users don't need to visit Chrome Store page. And they may stay on an old Chrome. Anyway, according to https://caniuse.com/usage-table , Chrome 69 only owns 0.09% of the total market , so 69 seems OKay. |
Hey folks,
I plan to modernize the code base by porting it from coffeescript to ES6. This will make the source more accessible to more developers, and remove the complexity of having to transpile.
Major impacts of this:
Some hard-to-notice bugs may be introduced by the decaffeinate conversion. When I've used decaffeinate on large code bases before, I've botched a few cases of removing unnecessary implicit return statements which are on by default on coffeescript.
All of the open PRs will become unmergeable and require revision before they can be re-evaluated.
Forks of Vimium will no longer be able to cleanly rebase on top of our recent commits.
It will become harder to find the history behind each line using git blame and git grep.
I wanted to give a heads up that this is coming, in case anyone has strong objections. The tentative date for the conversion is Jan 20, 2020. I may ship a new release to the store before then, with a few bug fixes.
Regarding the open PRs, I'm going to review the most recent 20-30 and merge those which seem valuable and low-risk. If a change is large and has a strong risk of destabilizing the code base, I'll likely not merge it and ask that it be reworked post the ES6 conversion. In case anyone wants to advocate strongly for an existing open PR to get merged before the conversion, now is the time.
Once the source is converted to ES6, I'd appreciate beta testers using the version on master, to help surface breakages in features that I don't normally use, before this version gets shipped to the chrome store to a wider audience.
Thanks! This should be great!
The text was updated successfully, but these errors were encountered: