nodejs-verge icon indicating copy to clipboard operation
nodejs-verge copied to clipboard

Update all code to use ES6

Open bchuckles opened this issue 7 years ago • 9 comments

Guys, I am a long time follower and finally have transitioned into more of a manager/lead role and miss coding. I would love to jump in update everything to ES6 and start writing some mocha test. Do you guys mind?

bchuckles avatar Jan 09 '18 03:01 bchuckles

We started this discussion on a PR, and this seems to be a more fit place.

I would suggest moving it to TypeScript, more strict and lets you compile to whatever node version that fits your needs.

RabeaWahab avatar Jan 09 '18 14:01 RabeaWahab

Thats a great point. I can get down with that.

bchuckles avatar Jan 09 '18 15:01 bchuckles

Hi @RabeaWahab, I'm new in the Verge community! I really do not see the benefit of using TypeScript in Nodejs. I think if we want to use a statically typed language we would use another one like Scala or Java. I think that using TypeScript or Flow must be used only in Front-End. Maybe using Nodejs LTS with the current support of ES6 it's the cleanest solution. Sry for my english.

beogip avatar Jan 10 '18 02:01 beogip

@beogip

thats correct, we should keep this repository verry clear and simple. More compilers make it more complicated

lets focus on

  • Writing JSDocs
  • Updating to ES6

benammann avatar Jan 10 '18 15:01 benammann

i'm currently working on a local branch, gonna push this one tomorrow

benammann avatar Jan 10 '18 22:01 benammann

@benammann @beogip The idea is to have this module available in whatever ECMAScript standard run by the customer or client of this module, expecting that every server is running LTS is not the case for each business stack, and as there is tools to recompile I think TypeScript gives that out of the box plus the DuckTyping, etc. I am looking at it from a different non-tech angle, to be attractive to use, don't take the idea as a personal preference. I can work with anything 😄

RabeaWahab avatar Jan 12 '18 01:01 RabeaWahab

@RabeaWahab you are right we can't expect that every server is running LTS but using TypeScript in NodeJs it's not the best option (as I explain in my prev comment). We must have full control of the code that we provide, if we use a transpiler (TypeScript, Flow, Babel) we lost that control. Maybe the most sincere is keep using ES5. I think we should focus on

  • Writing JSDocs
  • Writing missing tests

What do you think?

beogip avatar Jan 12 '18 12:01 beogip

@beogip I think that would be a mistake. ES5 is already outdated, I dont think Babel makes you lose control. Also, ES6 saves you a lot of logic with deconstruction, and better scope. Purely from a snob perspective, if I see ES5 it looks like they are not up to date on the JS world. I did have hesitation with TypeScript and Node, but I can also work with anything.

bchuckles avatar Jan 12 '18 12:01 bchuckles

@beogip @bchuckles I would go then with ES6 and let the user figure out how to handle his environment, or provide examples of transpiling it to some other standard.

RabeaWahab avatar Jan 12 '18 14:01 RabeaWahab