Monday 5 September 2016

The tool has shed its Java dependency in favor of compiling Java source code 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.

[ Find out how to get ahead with our career development guide for developers. | The art of programming is changing rapidly. We help you navigate what's hot in programming and what's going cold. | Keep up with hot topics in programming with InfoWorld's Application Development +pnp universe . ]
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.

@itworld, +Web Solution, Web Design and development Company, India  

No comments:

Post a Comment

What Are Some Tips For Making Marketing Ads?

  Did you know that people who are interested in ads are 50% more likely to buy a product than organic visitors? If you are willing to creat...