terraform icon indicating copy to clipboard operation
terraform copied to clipboard

added ES6 support with babel

Open janza opened this issue 10 years ago • 17 comments

This pull request adds support for babel transpiler for javascript. It adds support for ES6/7 features in files with .es extension.

janza avatar Feb 25 '15 17:02 janza

oh wow, this would be nice.

Is the .es extension an existing convention?

sintaxi avatar Feb 25 '15 20:02 sintaxi

I've seen it listed as supported extension in babel alogside .es6 and .js. I think that it's better to have a separate extension for this (than to parse every .js file in the directory).

janza avatar Feb 25 '15 22:02 janza

cool beans

zeke avatar Mar 04 '15 17:03 zeke

Is there a plan to merge this? Anything missing?

janza avatar May 27 '15 23:05 janza

Time to properly review it mainly :)

We haven’t forgotten about it, but it probably won’t be in the next release (which might be #94). We’d still need to write docs too.

Definitely appreciate the hard work that has gone into this, so thank you!

kennethormandy avatar May 28 '15 01:05 kennethormandy

Awesome, thanks!

janza avatar May 28 '15 07:05 janza

Anything I can do to help move this along, would be very interested in this feature.

Happy to help with docs or something.

jdcauley avatar Jul 03 '15 15:07 jdcauley

I think we would need to:

  • [ ] Make sure @sintaxi wants it merged
  • [ ] Merge the Browserify stuff first #97 #98 using .js as the extension instead of .es (this requires a change in Harp since .html, .css, and .js were always omitted from preprocessing before
  • [ ] Decide on an extension (.es makes sense to me, but I don’t know the Babel/ES6/ES2015/whatever conventions well)
  • [ ] Add docs, the CoffeeScript page could be used as a starting point, although those are quite sparse as well

kennethormandy avatar Jul 03 '15 18:07 kennethormandy

The defacto standard (because of the interpret module used by gulp/webpack/etc) is .babel.js

phated avatar Jul 28 '15 19:07 phated

Thanks Blaine. That makes it kind of a confusing choice since we do .[output].[input] for the asset pipeline, ex. .xml.jade. So .js.babel would actually be the “correct” choice, with Harp’s current conventions.

I supposed in this case Babel is drawing from .min.js? We could just do .babel but then I guess everyone would still have to re-name things they were porting, which kind of defeats the purpose of trying to conform to existing conventions at all.

kennethormandy avatar Jul 28 '15 20:07 kennethormandy

@kennethormandy I think .js.babel could work. We had a long discussion at https://github.com/gulpjs/gulp/issues/830 and determined that making the extension contain which transpiler made more sense than a generic .es or .es6 extension because there is more than 1 transpiler and they handle things differently

phated avatar Jul 28 '15 20:07 phated

@jdcauley thanks for asking.

I want this in. I just want to make sure we keep CommonJS a high priority. Also, anything that works in JS ideally also works within coffeescript files. Perhaps that is less of a priority if we go with another extension such as .es.

sintaxi avatar Jul 28 '15 20:07 sintaxi

@sintaxi Is this going into the next release?

ir-g avatar Nov 05 '15 10:11 ir-g

+1 please

Ore4444 avatar Dec 31 '15 11:12 Ore4444

+1

og2t avatar Feb 29 '16 13:02 og2t

Manually doing a :+1: here.

danguilherme avatar Sep 09 '16 21:09 danguilherme

Anything new on this thread regarding ES6 support in Harp?

eapostol avatar Mar 15 '17 18:03 eapostol