Last week, the engine was ported from ES5 to ES6 Module format. It was a huge refactor of the PlayCanvas codebase, but it’s really exciting because it will help us move the engine forwards. Read all about the effort here:
Here’s where you come in. To ensure we have a smooth roll-out, you can help us test it and catch any potential bugs. To do so, just launch your scene from the Editor and add the following to the URL:
I’m sorry @LeXXik and @Diego_Lopez-Mobilia. It seems the engine hasn’t been deploying correctly. We’re fixing it now. I’ll let you know when it’s actually there. Once again, my apologies.
@zhou_xia Well, this is maybe a step towards Typescript. We now have import/export statements and a nice build system which integrates nicely with the Typescript compiler. We haven’t 100% decided whether we’ll choose Typescript over ES6+Babel, but I think Typescript currently is the preference.
Does this mean that we can now use ES6 in our scripts? And the engine will still transpile it to ES5 so it is still running properly on IE11 for example?
No. It means that the code editor will no longer warn you about the presence of ES6 in you scripts, and it will be up to you to run your __game-scripts.js file through Babel or Buble (by downloading your game as a ZIP from playcanvas.com).
However, I did just add the following suggestion to @syau’s issue on GitHub:
Perhaps as an intermediate step, we should make this an user preference that defaults to off.