My First App to ES6

I just finished My First App and enjoyed the process.

Are there any plans to upgrade the code in the tutorial to ES6/ES2015?

1 Like

Since this is running in the JVM, we rely on the Nashorn JS engine, and it does not support ES6 quite yet. Support should arrive together with Java 9. Feel free to improve the code if you have suggestions, we would love a pull request on this :slight_smile:

1 Like

I havent even looked at the possible implications / challenges, but it might be possible to run your app files through Babel to transpile them to ES5 as part of the gradle build maybe?

1 Like

Yes, I had the same thought, @espen_haviken. I hope i will be able to look into this, but don’t know when, so if someone wants to take this on just go ahead :slight_smile: :+1:

After spending 10 minutes I was not able to integrate Babel with Gradle.

Gradle is for JVM and Babel is for JavaScript, so they are quite different domains. Can someone with more experience with Gradle please confirm/deny if this is possible?

Few questions:
Why can’t you use our current javascript support? What is your primary objective of using Babel?

There are many gradle libraries out there that might Solve your problem!

My initial thought about ES6/ES2015 was not so much about “why?” as it was “why not?”.

I thought it would be trivial, but it seems that it is not, at least until the Nashorn JS engine starts to support it.

1 Like


I have added a working example with babeljs config here, let me know if you have any questions. Look at the moowork dependency, build.gradle and package.json. Recommended to use .es6 extension in javascript to be transpiled.

Use ./gradlew bableJs -Pwatch for continous update with dev mode (./ dev)