Start using ES6?


(Augier) #1

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?


Note: This discussion was imported from Loomio. Click here to view the original discussion.


(Faldrian) #2

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. :slight_smile:


(Jonne Haß) #3

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.


(Augier) #4

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 ?


(Jonne Haß) #5

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


(Dennis Schubert) #6

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?


(Jason Robinson) #7

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


(Augier) #8

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.