# Babelify Scripts in Editor

**URL:** <https://forum.playcanvas.com/t/babelify-scripts-in-editor/1459>\
**Category:** Help & Support\
**Created:** [January 31, 2016, 4:41am UTC](https://forum.playcanvas.com/t/babelify-scripts-in-editor/1459 "2016-01-31T04:41:57Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![knownasilya](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/knownasilya/32/4624_2.png) [@knownasilya](https://forum.playcanvas.com/u/knownasilya)\
**Post date:** [January 31, 2016, 4:41am UTC](https://forum.playcanvas.com/t/babelify-scripts-in-editor/1459/1 "2016-01-31T04:41:58Z")

</div>

Are there plans to Babelify the scripts for ES6/ES7 support in the editor?

---

<div class="post-metadata">

**Author:** ![dave](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/dave/32/4558_2.png) [@dave](https://forum.playcanvas.com/u/dave)\
**Post date:** [January 31, 2016, 8:56pm UTC](https://forum.playcanvas.com/t/babelify-scripts-in-editor/1459/2 "2016-01-31T20:56:33Z")

</div>

No plans at the moment. Generally speaking we keep all engine code and interfaces in vanilla JavaScript. So as to avoid adding additional layers for people to learn.

That said it would be nice to support additional workflows for all users…

---

<div class="post-metadata">

**Author:** ![max](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/max/32/477_2.png) [@max](https://forum.playcanvas.com/u/max)\
**Post date:** [February 2, 2016, 9:34am UTC](https://forum.playcanvas.com/t/babelify-scripts-in-editor/1459/3 "2016-02-02T09:34:26Z")

</div>

Although if you want to use ES6 features, you can, but that does not gives a guarantee it will work everywhere. So that is not recommended of course.  
But if lets say you making game to be wrapped in stand-alone wrapper or mobile wrapper, and you know that this wrapper supports specific features, then its fine to use them so.

---

<div class="post-metadata">

**Author:** ![knownasilya](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/knownasilya/32/4624_2.png) [@knownasilya](https://forum.playcanvas.com/u/knownasilya)\
**Post date:** [March 25, 2016, 1:44pm UTC](https://forum.playcanvas.com/t/babelify-scripts-in-editor/1459/4 "2016-03-25T13:44:55Z")

</div>

So babel actually transforms the code into valid ES5 syntax and has polyfills for APIs that don’t exist. The idea is that it will work everywhere, and you can start using future syntax today.

---

<div class="post-metadata">

**Author:** ![knownasilya](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/knownasilya/32/4624_2.png) [@knownasilya](https://forum.playcanvas.com/u/knownasilya)\
**Post date:** [March 25, 2016, 1:49pm UTC](https://forum.playcanvas.com/t/babelify-scripts-in-editor/1459/5 "2016-03-25T13:49:59Z")

</div>

There wouldn’t be anything new anyone would have to learn, because all original could would just work. This was more of a request for improvements that the writers of the scripts would benefit from, not so much the engine or app sourcecode you guys write.

Example change

```
pc.script.create('selector', function (app) {
  class Selector {
    constructor(entity) {
      this.entity = entity;
      this.selected = undefined;
    }
    
    // Called once after all resources are loaded and before the first update
    initialize () {
    }

    // Called every frame, dt is time in seconds since last update
    update (dt) {
    }
  }
  
  return Selector;
});
```

---

<div class="post-metadata">

**Author:** ![neoflash](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/neoflash/32/3312_2.png) [@neoflash](https://forum.playcanvas.com/u/neoflash)\
**Post date:** [November 10, 2017, 4:39pm UTC](https://forum.playcanvas.com/t/babelify-scripts-in-editor/1459/6 "2017-11-10T16:39:13Z")

</div>

The same with TypeScript.

---

<div class="post-metadata">

**Author:** ![knownasilya](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/knownasilya/32/4624_2.png) [@knownasilya](https://forum.playcanvas.com/u/knownasilya)\
**Post date:** [April 21, 2018, 11:44pm UTC](https://forum.playcanvas.com/t/babelify-scripts-in-editor/1459/7 "2018-04-21T23:44:36Z")

</div>

Yeah would love this as a feature, JavaScript is moving too fast. Things like async/await, etc, are huge wins for developers.

---

<div class="post-metadata">

**Author:** ![Vishnu\_Krishnaprasad](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/vishnu_krishnaprasad/32/4859_2.png) [@Vishnu\_Krishnaprasad](https://forum.playcanvas.com/u/Vishnu_Krishnaprasad)\
**Post date:** [April 22, 2018, 2:43am UTC](https://forum.playcanvas.com/t/babelify-scripts-in-editor/1459/8 "2018-04-22T02:43:11Z")

</div>

i’d vote up for the feature request too. ES6/7 transpilation would be great.
