# Javascript's ES6(ECMAScript 2015) Support

**URL:** <https://forums.fusetools.com/t/javascripts-es6-ecmascript-2015-support/4419>\
**Category:** Feature Suggestions\
**Created:** [October 2, 2015, 1:50am UTC](https://forums.fusetools.com/t/javascripts-es6-ecmascript-2015-support/4419 "2015-10-02T01:50:53Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Haze\_Lee](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/haze_lee/32/375_2.png) [@Haze\_Lee](https://forums.fusetools.com/u/Haze_Lee)\
**Post date:** [October 2, 2015, 1:50am UTC](https://forums.fusetools.com/t/javascripts-es6-ecmascript-2015-support/4419/1 "2015-10-02T01:50:53Z")

</div>

I know about Fuse’s Javascript supports ES5.1, and will support ES6 later. Uno is good alternative for Javascript, But I want to use ES6 more fast.

---

<div class="post-metadata">

**Author:** ![Anders\_Lassen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/anders_lassen/32/522_2.png) [@Anders\_Lassen](https://forums.fusetools.com/u/Anders_Lassen)\
**Post date:** [October 2, 2015, 2:04am UTC](https://forums.fusetools.com/t/javascripts-es6-ecmascript-2015-support/4419/2 "2015-10-02T02:04:14Z")

</div>

Hi!

Yeah, we are working on getting V8 support on Android - that’s the only missing piece 🙂

---

<div class="post-metadata">

**Author:** ![Haze\_Lee](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/haze_lee/32/375_2.png) [@Haze\_Lee](https://forums.fusetools.com/u/Haze_Lee)\
**Post date:** [October 4, 2015, 11:13am UTC](https://forums.fusetools.com/t/javascripts-es6-ecmascript-2015-support/4419/3 "2015-10-04T11:13:23Z")

</div>

Awesome. If Fuse support ES6, It will be more attractive than any javascript native app development framework. 😃

---

<div class="post-metadata">

**Author:** ![Jake\_Taylor](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/jake_taylor/32/512_2.png) [@Jake\_Taylor](https://forums.fusetools.com/u/Jake_Taylor)\
**Post date:** [October 4, 2015, 4:41pm UTC](https://forums.fusetools.com/t/javascripts-es6-ecmascript-2015-support/4419/4 "2015-10-04T16:41:09Z")

</div>

yeah, should be awesome 😃

---

<div class="post-metadata">

**Author:** ![auser](https://avatars.discourse-cdn.com/v4/letter/a/5e9695/32.png) [@auser](https://forums.fusetools.com/u/auser)\
**Post date:** [October 24, 2015, 9:20am UTC](https://forums.fusetools.com/t/javascripts-es6-ecmascript-2015-support/4419/5 "2015-10-24T09:20:23Z")

</div>

Thought here (haven’t explore the framework much yet): Is it possible (possibly) to run the JS through a transpiler, like babel, for instance?

---

<div class="post-metadata">

**Author:** ![COCPORN](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/cocporn/32/576_2.png) [@COCPORN](https://forums.fusetools.com/u/COCPORN)\
**Post date:** [October 24, 2015, 10:04am UTC](https://forums.fusetools.com/t/javascripts-es6-ecmascript-2015-support/4419/6 "2015-10-24T10:04:11Z")

</div>

It is very easy to create a setup using babel as a transpiler. We do it on our project.

Add a `build.bat` or `build.sh` file to the project:

It typically looks like:

`call babel *.js > ./JavaScript/Generated/JavaScript.js`

Then you add `Generated/JavaScript.js` using `<JavaScript File="JavaScript/Generated/JavaScript.js" />`

Then add babel to the system and set up a Sublime Text 3 build:

`npm install --global babel` (requires Node.js or npm installed on the system)

Then go to: `Tools -> Build System -> New Build System` in Sublime Text 3.

Add this on Windows:

```auto

{
    "cmd": "build.bat",
    "working_dir": "$project_path",
    "windows" : {
        "shell": true
    }
}

```

And on Mac:

```auto
{
  "cmd": "./build.sh",
  "working_dir":"${folder}",
  "windows" : {
      "shell": true
  }
}

```

Save. Then you press Command/Control-B to prebuild your JavaScript.

---

<div class="post-metadata">

**Author:** ![Stefan\_Rimaila](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/stefan_rimaila/32/456_2.png) [@Stefan\_Rimaila](https://forums.fusetools.com/u/Stefan_Rimaila)\
**Post date:** [October 24, 2015, 10:16am UTC](https://forums.fusetools.com/t/javascripts-es6-ecmascript-2015-support/4419/7 "2015-10-24T10:16:16Z")

</div>

In addition to Cocporn’s method, you can do the `npm install -g babel`, and while developing, run:

```auto
babel ./source-directory --out-dir ./compiled-directory --watch

```

You can also add some [optional transforms](https://babeljs.io/docs/advanced/transformers/) and things like that if the default Babel settings don’t offer the things you need. By default, Babel transpiles everything from _Stage 2_ and up, so if you want things like class properties, you need to enable them manually, by either adding `--optional es7.classProperties`, or by enabling the entire stage of proposals by adding `--stage 1`.

[Flow type](http://www.flowtype.org) support is also built in in Babel as an optional transform; `--optional flow`.

In case you get a larger bunch of options that you feel like you need to pass to Babel, consider adding a `.babelrc` file to your project.

---

<div class="post-metadata">

**Author:** ![COCPORN](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/cocporn/32/576_2.png) [@COCPORN](https://forums.fusetools.com/u/COCPORN)\
**Post date:** [October 24, 2015, 10:23am UTC](https://forums.fusetools.com/t/javascripts-es6-ecmascript-2015-support/4419/8 "2015-10-24T10:23:02Z")

</div>

Awesome, we might add some of this.

I was surprised to see babel actually supports some features from ES7 also, like async/await (enabled by default).

---

<div class="post-metadata">

**Author:** ![ckwong90](https://avatars.discourse-cdn.com/v4/letter/c/958977/32.png) [@ckwong90](https://forums.fusetools.com/u/ckwong90)\
**Post date:** [June 4, 2016, 2:59pm UTC](https://forums.fusetools.com/t/javascripts-es6-ecmascript-2015-support/4419/9 "2016-06-04T14:59:42Z")

</div>

So it’s been 8 months since the last comment, I was wondering what the progress is for es6 native support with the javascript VM with fuse?

---

<div class="post-metadata">

**Author:** ![Anders\_Bondehagen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/anders_bondehagen/32/98_2.png) [@Anders\_Bondehagen](https://forums.fusetools.com/u/Anders_Bondehagen)\
**Post date:** [June 10, 2016, 11:46am UTC](https://forums.fusetools.com/t/javascripts-es6-ecmascript-2015-support/4419/10 "2016-06-10T11:46:19Z")

</div>

If you are exporting to Android, you are using V8 and that will give you a lot of the ES6 syntax. If you export to iOS we have to use JavaScriptCore wich is far from done with adding ES6 features. So you need to use a transpiler like babel in that case.

---

<div class="post-metadata">

**Author:** ![schrepfler](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/schrepfler/32/183_2.png) [@schrepfler](https://forums.fusetools.com/u/schrepfler)\
**Post date:** [September 20, 2016, 9:00am UTC](https://forums.fusetools.com/t/javascripts-es6-ecmascript-2015-support/4419/11 "2016-09-20T09:00:34Z")

</div>

Are the steps above still the suggested way to use ES6 with Fuse or will this change over time?
