Home IT Info News Today Google Closure compiler moves from Java to JavaScript

Google Closure compiler moves from Java to JavaScript

211

Google’s Closure compiler, for optimizing and transpling JavaScript, no longer needs Java to run. Instead, Java source code is compiled to JavaScript so it can run under Node.js or in a browser. Java-dependent Closure had been introduced by Google in 2009.

The experimental release detailed this week supports ECMAScript 2015 features like arrow functions and let and const, and it provides polyfills for some ES2015 methods. It will check both syntax and types, and will provision warnings for JavaScript “gotchas.” Google cautions, though, that some features are not available, and performance may not equal the Java version.

The upgrade is not a rewrite of Closure in JavaScript. To use the new version, developers should add it as a dependency in a project via NPM, though it also can be used with the Gulp streaming build system.

“If you’d like to migrate from google-closure-compiler, which requires Java, you’ll have to use gulp.src() or equivalents to load your JavaScript before it can be compiled. As this compiler runs in pure JavaScript, the compiler cannot load or save files from your file system directly,” Google’s Sam Thorogood, developer programs engineer, said. Developers not using Gulp or Webpack plugins will need to specify code via flags, release notes in GitHub state.

Closure is available under an Apache 2.0 license.

Source link

LEAVE A REPLY

Please enter your comment!
Please enter your name here