atom-julia-client icon indicating copy to clipboard operation
atom-julia-client copied to clipboard

Decaffination + Modernize import/export

Open aminya opened this issue 5 years ago • 4 comments

Method

Decaffeination can be done easily using:

decaffeinate . --use-js-modules --loose

or without automatic import/export

decaffeinate . --loose

or without loose modifications (the safest but worst looking)

decaffeinate .

We need to run either of those and then fix the linkage of modules manually. We don't need to use import/export, but it will help to reduce excess deps in Webpack.

Why

  • Webpack build fails because of coffee files https://github.com/JunoLab/atom-julia-client/pull/714.
  • Helps TypeScript

Side-Note

There is also bulk-decaffeinate that automatically searches for connections, but it doesn't work well on Windows (I couldn't get it to work).

  • I will test on my Linux machine to see if it works there
  • If you want to try this, you need Eslint from https://github.com/JunoLab/atom-julia-client/pull/712

https://github.com/decaffeinate/bulk-decaffeinate https://github.com/decaffeinate/bulk-decaffeinate/issues/265

aminya avatar Apr 01 '20 12:04 aminya

cc: @pfitzseb @aviatesk Let me know if you agree with this. I need your confirmation and collaboration before I put time on it.

To do this:

  • we should merge the open PRs that edit the coffee files (mainly https://github.com/JunoLab/atom-julia-client/pull/641 and https://github.com/JunoLab/atom-julia-client/pull/713)
  • and stop editing the files for a few days (maybe a week) unless a serious bug needs to be fixed.

This doesn't take much. We just need to fix the import/export connections for now. Decaffeinated already compiles a very good code, and fine adjustments can be done later. ES6 import/export shouldn't be done right away, we can do that later as long as the software works.

aminya avatar Apr 02 '20 07:04 aminya

Decaffeination is very welcome. The most important thing is whether the JSfied code is maintainable; don't forget to read through and check the code "makes sense" even when you start with the auto-decaf tool at the beginning.

As for webpack, I guess it only gives negligible loading time improvement. Atom uses transpiled cache even if we don't transpile AOT. So it's not good idea to rush decaf stuff just because of webpacking, etc.

aviatesk avatar Apr 13 '20 14:04 aviatesk

Yeah, let's do the decaffeination as a first step. Just a quick comment on your PRs, @aminya: We're currently using something close to standard for our JS, so it'd be cool if you could switch your linter pass to that (or just follow the style manually, I guess).

pfitzseb avatar Apr 13 '20 17:04 pfitzseb

Probably, I will not spend more time on this project. I cannot deal with loads of strong opinions.

If you want you can close this issue.

aminya avatar Apr 14 '20 02:04 aminya