[Breaking Change] In-browser transpilation turning down July 25 #1170
Description
TL;DR: The debug loader will stop down-leveling sources on July 25.
6 years ago we added a feature to the Closure Debug Loader that would detect when source files contained newer language syntax than was supported by the browser. This was extremely useful at the time for transitioning to ES 2015, but was always intended as a last recourse "stop gap" when server-side transpilation was unavailable. In the meantime, a number of better server-side solutions have cropped up and this feature is finally no longer needed. We will be removing the in-browser transpiler on July 25.
This should only affect you (1) if you are using the debug loader, (2) are running with newer language features on older browsers that don't support them, and (3) only after you update to a new version of the library (NOTE: if you're pulling base.js directly from a raw.github-style URL, this will happen immediately - we highly discourage this practice).
If you are relying on the debug loader at all, we recommend looking into alternative bundling solutions. There are a number of very performant bundlers available that should greatly improve your development experience (note also: the debug loader should never be used for production). For Closure dependency management, consider closure-webpack-plugin if you need downleveling. Moreover, modern browsers are keeping up with the EcmaScript spec a lot faster than they were in 2015, so in many cases downleveling is not even required anymore (and you can use a compiled binary to test against older browsers when necessary).
If anyone anticipates this change to cause undue hardship, please let me know and we can look into other options and whether it makes sense to extend the timeline.
FAQ
How do I know if this will affect me?
If you write <script src="path/to/base.js">
, <script src="path/to/my/deps.js">
, and goog.require('my.namespace')
in your HTML, then you are using the debug loader. This will still work, provided your sources do not use features that are newer than the browsers it runs on. Closure Library itself may use any Stage 4 features, which should generally be supported by all evergreen browsers, but may not be available in all older browsers. If you need to run uncompiled code on older browsers, consider using a bundler that does minimal downleveling.