by hellofunk · 8y ago · 0 comments
Perhaps, but it’s quite nice when you use languages that were built to support Google Closure from the beginning, like Clojurescript. Then it is painless and built into the build process automatically, and you get to benefit from all the other great advantages of advanced optimizations in Google Closure that this article does not mention, and which Elm still cannot support or offer an alternative for, like automatic loop unrolling and other notable performance improvements.
The big surprise though, is how few other new library/framework/platform/languages/whatever have followed this path.
Good riddance to that abandoned pile of rubbish, and fuck Google management for letting it get so bad. They had a five-year lead on the rest of the industry in serious JavaScript development, and now they're ten years behind.
But this does look like a team that's focused on the needs of Google's internal customers? An external-focused project would have better docs and do more outreach.
[1] https://github.com/google/closure-compiler/commits/master
[2] https://github.com/google/closure-compiler/wiki/Releases
Note that Elm has always appeared to work on the surface with advanced optimizations, but the bugs would creep in and show up eventually, and the official advice has always been not to use those optimizations.
That's not to say that there are not other issues, though.
Elm also outputs smaller assets than cljs+closure.
That being said, I do love cljs, having used it on numerous projects myself :)
"almost never" and "simply use externs file (which you may or may not need to write yourself)" does underpin my point that you have to take care. I'm not saying it is necessarily difficult or takes a long time to get right, but it does require that someone makes sure everything survives the advanced opts compilation.
This has burned me on a past cljs project, it's not even a concern on my Elm projects.