Closure compiler v20220405 Released!

28 views
Skip to first unread message

Hana Joo

unread,
Apr 7, 2022, 11:04:41 AM4/7/22
to Closure Compiler Discuss
Downloads: 

Release Notes: 

April 7th, 2022 (v20220405)
  • Allow specification of example text and original code text for message placeholders in goog.getMsg(). (Please see the github release note for examples)

  • 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.

    The constraint on where goog.module.get was called was to discourage accidental treatment of goog.provide or bare scripts as having module scopes and polluting the global scope with imports and causing problems in far flung files.

    However, we want to allow reexporting of goog.module namespaces in goog.provide files to simplify migrations to goog.module. So here we explicitly allow alias such as:

    goog.provide('a.b.c'); a.b.c = goog.module.get('c')

    or

    goog.provide('a.b.c'); a.b.c = goog.module.get('other').c;

    While we are here cleanup the checks for goog.module.get so that they are only reported from CheckClosureImports.

  • Add support for @provideAlreadyProvided

    When this JSDoc annotation is used with a goog.provide call like:

    goog.provide('a.b'); /** @provideAlreadyProvided */ goog.provide('a.b.c'); a.b = something;

    The goog.provide rewriting pass (ProcessClosureProvidesAndRequires) will avoid creating the definition for the namespace. Without this the pass would create a declaration (a.b.c = {} in the example above).

  • 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.

Reply all
Reply to author
Forward
0 new messages