Fixed REST closure compiler has been deprecated

digitalpoint

Well-known member
Affected version
2.2.13
The default method of comping JavaScript is going away because the use of the REST endpoint for Closure Compiler (https://closure-compiler.appspot.com/compile) has been deprecated.

From: https://developers.google.com/closure/compiler/docs/gettingstarted_ui

Closure compiler service is deprecated, and will be removed. Please consider running the compiler locally instead.

Not sure on their timeline for actual removal, but seems it will stop working at some point.
 
I think we've known about this for a while. There's not really any current plans to replace it. If it stops working, there is already support for using a local binary for the compiler. And generally we'd recommend that anyway as it gets around the issue of it being slow and their rather paltry rate limits.
 
I think we've known about this for a while. There's not really any current plans to replace it. If it stops working, there is already support for using a local binary for the compiler. And generally we'd recommend that anyway as it gets around the issue of it being slow and their rather paltry rate limits.
Yep, was just throwing it out there since it's the default way of doing it (myself and others are already using the local version, so doesn't affect me personally if they shut it off).
 
Incidentally, if anyone knows of a worthy successor that is either server-side based, based on PHP or some other suitable REST API we could use instead (for free) that would be worth exploring as a replacement.

I've never looked for one.
 
I was actually just looking to see if you could use a Cloudflare Worker (which can handle 100,000 requests per day for no cost), but they don't support Java yet.
  • JavaScript
  • Rust
  • C
  • C++
  • Python
  • Scala
  • Kotlin
  • Reason
  • Dart
If they ever do add Java support, that's the route I would take... just do it server-less for free (assuming you don't need more than 100,000 requests per day).

It looks like there is a JavaScript/Rust port of Google Closure Compiler here, which might work with a Cloudflare Worker: https://github.com/swc-project/swc

Maybe I'll poke on it when I have some free time and see if I can make it work like that.
 
With the compiler shutting down next month forever, it's probably time to completely remove the code from the build command and drop a warning instead if no local compiler has been configured.
 
We’ve gone one better than that. Although we are aiming for it to be a somewhat temporary solution as we have plans to change approach down the line (XF 3.0).

We are currently testing an XF.com API endpoint (via the license / upgrade API) that will replace the existing (now broken) Google Closure Compiler web service.

The JS minifier service will now submit the JS code to our server, we will minify it, and return the minified JS back.

That should be available in 2.3.7.
 
Back
Top Bottom