-
Notifications
You must be signed in to change notification settings - Fork 561
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
[P3] Remove CoffeeScript (Decaffeinate) #4
Comments
More praise for Decaffeinate here: https://benchling.engineering/from-200k-lines-of-coffeescript-to-zero-making-decaffeinate-super-stable-4de0ca68d9bc |
When using Edit: This has been merged upstream. |
It may be a good idea to do this one service at a time. I ran into some issues with classes extending other classes (e.g. must use |
I made some progress on decaffeinating the It mostly works, but something is up with the user data access. After logging in, I have no faction progress, while on |
It doesn't work very well, since it produces unlinted files which also need manual changes. Since this is a fairly complex task, I'm going to hold off on it for now while we focus on the reference deployment. |
I looked at this again today. The reason the The main thing here is https://coffeescript.org/#breaking-changes-super-this This may be tough, since there are several things which seem to rely on tweaking the object state before calling We might want to instead try compiling the files (which is what we do in the build process currently) if the resulting JS output is not too ugly. |
I tried to fix it as well but got stuck trying to understand the intention behind this and a way how to make sure that it still work properly. Does anybody have understanding how it should work so we can implement it properly with proper I believe there are not much cases which need to be fixed and they might be implemented this way not-intendedly, just occasionally. |
The testing process is generally this:
There's more info on this in the Contributor Guide here: I haven't looked closely at the super/this code yet, so I'm not yet sure what exactly is needed. But the above steps have been enough to know that it's working (or not). |
Upgrading CoffeeScript appears to result in significantly more memory usage. See #173 for details. Getting rid of CoffeeScript via compiling it (instead of upgrading it to use |
Would slowly decaffing the files work? Next time someone tries to edit a file, they could decaf it, add their logic, test and then push. JS files should still work with the other coffee files due to the interop. |
Compiling the Coffeescript seems to result in circular dependency issues, at least for the API when using the code in
Since the v1 coffeescript compiler didn't know about ES6 features, especially classes, there is likely a ton of cleanup to be done, and I think JSCodeshift might be helpful there. |
I really like this approach, and I'll add that incorporating TypeScript to the migration early on would be preferable. If it's an incremental migration then the earlier the better. |
ES6 and / or TypeScript mostly makes CoffeeScript no longer necessary. Let's try running codebase through
decaffeinate
.https://github.com/decaffeinate/decaffeinate
The text was updated successfully, but these errors were encountered: