konsoletyper / teavm

Compiles Java bytecode to JavaScript, WebAssembly and C
https://teavm.org
Apache License 2.0
2.55k stars 262 forks source link

Add option to generate modern version of JavaScript #787

Open konsoletyper opened 8 months ago

konsoletyper commented 8 months ago

TeaVM currently produces ES5 code, and it's important for some use cases (for example, to be compatible with Rhino, which does not fully support even ES6). However, it's hardly compatible with modern web tooling, and sometimes it's possible to generate less JavaScript using modern syntax. There should be a switch (both Maven, Gradle and CLI) that turns generation of modern JavaScript instead of old-fashioned ES5