Google Closure compiler moves from Java to JavaScript

Google Closure compiler moves from Java to JavaScript

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.

IDG Insider

PREVIOUS ARTICLE

«A series of tubes: What's next for home automation

NEXT ARTICLE

Android device updates: Verizon Galaxy S7, S7 Edge get key updates, AT&T phones add Wi-Fi calling»
author_image
IDG Connect

IDG Connect tackles the tech stories that matter to you

Add Your Comment

Most Recent Comments

Our Case Studies

IDG Connect delivers full creative solutions to meet all your demand generatlon needs. These cover the full scope of options, from customized content and lead delivery through to fully integrated campaigns.

images

Our Marketing Research

Our in-house analyst and editorial team create a range of insights for the global marketing community. These look at IT buying preferences, the latest soclal media trends and other zeitgeist topics.

images

Poll

Will Kotlin overtake Java as the most popular Android programming language in 2018?