4 ms·
The Java requirement is a real pain. If someone made an npm package that took care of the Java requirements, we'd probably all be using Closure rather than some
by thomasfoster96 11y ago
The Java requirement is a real pain. If someone made an npm package that took care of the Java requirements, we'd probably all be using Closure rather than something like Uglify. Closure usually does slightly better minification wise, but it's a pain to work with.
- dkarapetyan 11y agoHuh? I mean I'm a little confused. The js ecosystem is full of transpilers, build tools, frameworks, and a bunch of package managers but installing java is one too many?
- thomasfoster96 11y agoWell all those build tools are usually npm packages, and are easily managed as dependencies using package.json (hence why there are so many being used). Adding Java and and a secondary set of dependencies isn't really worth the 5% decrease in minified file size that closure might give you. I did try to use closure instead of uglify in a project recently - closure was a real pain to deal with compared to tools with equivalent functionality that are written in JavaScript. Cross-language ecosystem tools rarely work well it seems.
- cromwellian 11y agoI don't see why the language the tool is written in matters. Lots of NPM modules have native C dependencies and it works fine. Closure advanced mode will do a lot better than 5% compared with Uglify.
- thomasfoster96 11y agoIt shouldn't matter - but it does. Native dependencies are pretty important so a lot of effort has gone into solving that issue - but I don't think making Java and Node.js work together well is a high priority for anyone. That said, closure being in JavaScript has more to do with choosing rhino than anything else. If you were starting a project like closure today you wouldn't use Java. Re: advanced mode, totally depends on what kind of code you've got. Lots of inlineable functions and constants? Double digits easily. Lots of objects and DOM? 5% better than uglify is optimistic.
- cromwellian 11y agoActually if it was started at Google today, it probably would use Java or Go. Very few development tools are written in JS at Google. Angular and Polymer (and maybe Traceur) build tools being the exception. Our internal tooling works far better with statically typed languages. It should be rather trivial to have a gulp/grunt task that installs Java and runs CC. CC could even be packaged as a EXE if desired.
- hokkos 11y agoIt works fine because node take care of compiling it and lot of packages in npm need it so you are practically forced to install a C / C++ compiler, but java here is almost alone, so the requirement is more painfull.