Loomio

Start using ES6?

DU Public Seen by 28

ES6 introduces lots of interesting features that could help us reduce the amount of code we are using and the potential errors.

Though, not all the browser support it which means we would be obliged to use a transpiler that would complexify development.

That is I really think we should start to move towards ES6 asap.

What do you all think about this?

F

Faldrian Sat 11 Jul 2015 8:15AM

I don't want to use any build-tools to create the javascript-files we use in development... just edit and reload.

If there was browser support of all major desktop and mobile browsers AND you want to create a new feature, using ES6 specific features would be acceptable. But if you have too much time, don't rewrite existing stuff in ES6, there are much more things to do. :)

JH

Jonne Haß Sat 11 Jul 2015 8:37AM

Apparently one could integrate https://github.com/browserify-rails/browserify-rails with https://github.com/thlorenz/es6ify or some similar solution that does the compilation inside the asset pipeline. But yeah, not sure it's worth all that since it increases compile time, makes the code less transparent (= harder to debug) and increases the inconsistencies again since we wouldn't want to port all existing code.

DU

Sun 12 Jul 2015 4:35PM

But yeah, not sure it’s worth all that since it increases compile time

I hadn't though about that.

increases the inconsistencies again since we wouldn’t want to port all existing code.

Couldn't be done step by step, like we did with the port of SASS to SCSS or Blueprint to BS2 ?

JH

Jonne Haß Sun 12 Jul 2015 6:03PM

Porting everything sounds like a shitload of work for little benefit. We still didn't even manage to port everything to Backbone.

DS

Dennis Schubert Tue 14 Jul 2015 7:16AM

FWIW, sprockets-es6 ships babeljs in Rails.

But, as Jonne said, I see no purpose in rewriting everything. What are you even talking about, Augier? Fat arrows?

JR

Jason Robinson Tue 14 Jul 2015 7:45AM

Really guys. Diaspora suffers from performance and bloat problems. I think there are better things to fine tune fron-end code :P

DU

Tue 14 Jul 2015 4:23PM

What are you even talking about, Augier? Fat arrows?

Among other things, yes. There are also template strings. These are really the two main features that could have lighten the code a lot.

But indeed, it is not certain it worth the effort.