A free tool for making JavaScript download and run faster

Closure Compiler

Join our mailing list

Stay up to date with latest software releases, news, software discounts, deals and more.

Subscribe
Download Closure Compiler 20220719

  -  12.9 MB  -  Open Source

What's new in this version:

Closure Compiler 20220719
- Make more property-based dead code elimination back off on reflective accesses of a property name, like goog.reflect.objectProperty('m', c)
- Update GOOG_PROVIDE_REQUIRE_PATTERN and its usage to support multi-lines declarations
- Make 2-lines module declarations recognizable by JsFileRegexParser
- Fix bug where types shadowing goog.module imports were not resolved
- Fixed bug where function arguments with side effects were sometimes deleted
- Improved dead-code elimination for special case of new class {}
- When performing a partial (stage 1 or stage 2) compilation, the compiler compiler exits with a 0 status only when no errors are reported. The exit status contains the number of errors reported up to a maximum of 127.
- This was always the intended behavior, and is consistent with single-stage compilation. A recent change accidentally caused it to exit with 0 for partial compilations regardless of any errors reported.
- Added extern and polyfill for Object.hasOwn. Confirmed the TS declarations exist in the standard .d.ts files.
- Updates to allow use of the 'd' flag for regular expressions and the indices values it creates. Currently, input and output language level need to be ES_NEXT to avoid an error message from the compiler for using this feature.
- CLOSURE_DEFINES values may now be specified with separate invididual property assignments, rather than requiring them to be in a single object literal (though it must still be in the top-level/global scope). Duplicate keys produce an error.
- Add extern definition for Object.hasOwn(object,property) method
- Added BanSettingAttributes conformance check
- Added recognition, validation, and error of the new /d flag for RegExps as part of ES_2022
- Enable support for the Error constructor {cause: err} argument and Error.prototype.cause feature added in ES2022. NOTE: This behavior is not polyfilled. We only ensure that the compiler will not complain about the argument.
- Rework pass config to aways run VarCheck pass after VariableReferenceCheck pass. This may cause more errors to surface in single-file transpilation mode.


Closure Compiler 20220601
- Correct useless label optimization when a label is nested within a label
- Compilation error on duplicate module and provide names
- Fix crash with label'd do/while blocks

Support @provideAlreadyProvided during typechecking. Here we are doing a couple of things:
- avoid creating a default namespace object type when a goog.provide is annotated with
- add some logic find the type of the implicitly assigned namespace by looking up the object from the parent namespace object. The second is valid as @provideAlreadyProvided is only useful if the parent namespace is assigned a value that contains the child namespace.
- Add externs for maps api v3.49
- Add a flag --emit_async_functions_with_zonejs to relax the restriction on disallowing --language_out=ES_2017 together with Zone.js
- Fix cases of incorrect constant folding for the coalesce operator ??
- Move "public class fields" feature down from ES_NEXT to UNSTABLE. Since ES_NEXT is supposed to be for features that are fully supported, and transpilation of public fields is not yet fully implemented, by our accounting it should only be considered UNSTABLE and not yet ES_NEXT. We do intend to add support for transpilation and will move the feature back to ES_NEXT when we do.
- Fix false positive "missing @const annotation" lint when using destructuring assigns
- Fix potential misoptimization of variables/properties in a logical assignment. Some compiler passes failed to realize that such assignments could evaluate to a mutable value and so would delete code incorrect.
- Set --angular_pass to true by default
- Refactor pass building so that there is a central way to check conditions for the pass. This is step toward making it easier to configure modes for the passes (transpile only, renaming only, etc)
- Made typechecker change to fix edge cases where @implements {I} was treated as @implements {I- Fix handling of tagged template literals side-effect detection to consider contained expressions
- Improves performance and memory usage of ControlFlowAnalysis
- Fix an issue when where source text could be retained in memory throughout the compilation process
- Fix an issue when resolving non-trivial unions when complex types, where the check for existence of template types would be n^2


Closure Compiler 20220502
- Allow specification of example text and original code text for message placeholders in goog.getMsg()
- Enabled "unnecessary escape" lint warnings in untagged template literals
- Add a new rule to OptimizeParameters to trim trailing undefined parameters from calls where the callee doesn't use rest parameters or access the arguments object. Should save code size in most applications since inlining functions that pass through optional params tends to create this pattern.
- Remove references to goog.mixin now that it has been removed
- Loosen the constraints on goog.module.get so that only assignments to global variables are banned
- Add support for @provideAlreadyProvided
- Make BanSetAttribute less restrictive by allowing certain "effectively constant" attribute names
- Only enable "unnecessary escape" warnings in the linter
- Support matching types imported from a JS boundle in conformance
- Fixed parser crash on multiline string literals with invalid escape sequences
- Modify for-await-of to only exist inside an async function


Closure Compiler 20220405
- Allow specification of example text and original code text for message placeholders in goog.getMsg().
- Enabled "unnecessary escape" lint warnings in untagged template literals
- Add a new rule to OptimizeParameters to trim trailing undefined parameters from calls where the callee doesn't use rest parameters or access the arguments object. Should save code size in most applications since inlining functions that pass through optional params tends to create this pattern.
- Remove references to goog.mixin now that it has been removed.
- Loosen the constraints on goog.module.get so that only assignments to global variables are banned.
- Add support for @provideAlreadyProvided
- Make BanSetAttribute less restrictive by allowing certain "effectively constant" attribute names.
- Only enable "unnecessary escape" warnings in the linter.
- Support matching types imported from a JS boundle in conformance.
- Fixed parser crash on multiline string literals with invalid escape sequences.
- Modify for-await-of to only exist inside an async function.

Join our mailing list

Stay up to date with latest software releases, news, software discounts, deals and more.

Subscribe