closure-compiler
closure-compiler copied to clipboard
A JavaScript checker and optimizer.
Closure compiler fails when it encounters any code that uses the new dynamic import() with options. Example code snippet that will break CC: ` var _module = await import(cssPath, {...
In most cases, GCC is able to figure out if a constructor is pure. As an example, consider the `Vec` class, which is a 2 dimensional vector. ```javascript /** @interface...
command `java -jar closure-compiler.jar --compilation_level ADVANCED_OPTIMIZATIONS --formatting PRETTY_PRINT --js input.js --js_output_file compiled.js` the example code is trimmed from tc39 stage 3 decorator compiled by swc. in the example,`@pureOrBreakMyCode` is added...
I see that `objectProperty` and `object` are available in closure-compiler/lib/reflect.js. However I do not see any way to use these from an es6 module. I tried adding these to goog.js...
Technically, the former appears to be a typedef and the latter might be a template for classes? But neither exists as a named function/constructor. Earlier versions of the spec do...
This breaks out one part of #2899. I looked into this briefly today. In order to do it right, we end up bloating our for-of transpilation quite a bit. Currently...
My attempt to fix #4178 add some extra logic to see if a pure function is being called when the assignment is already eliminated
`test.js` ```js export * as boom from "./a.js"; ``` running `npx google-closure-compiler --js test.js` (Version `20240317.0.0`) leads to ``` test.js:1:9: ERROR - [JSC_PARSE_ERROR] Parse error. 'from' expected 1| export *...
Input JS: ```js var buffer = new ArrayBuffer(1024); var HEAPU8 = new Uint8Array(buffer); var UTF8Decoder = new TextDecoder(); var UTF8ToString = (ptr, maxBytesToRead) => { if (!ptr) return ''; var...
In PR 4180 @shicks said "goog.reflect.cache is also obsoleted by @pureOrBreakMyCode, which can now be used instead of special-purpose caching primitive." I can't find documentation for this annotation anywhere. How...