-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[bazel] Bump rules_closure and google closure libary to latest release
#16755
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The Google Closure Library is the last public release, and it seems unlikely we'll ever update it again. The new version of `rules_closure` brings a new version of the closure compiler. This is stricter than the previous compiler, and necessitated an update of the Google Closure Library. However, this new version of the library had removed some key functions we relied upon. We've had to rework both our own code and the vendored version of closure to get it to work with the latest closure compiler.
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||||||||||||||||||
User description
The Google Closure Library is the last public release, and it seems unlikely we'll ever update it again.
The new version of
rules_closurebrings a new version of the closure compiler. This is stricter than the previous compiler, and necessitated an update of the Google Closure Library. However, this new version of the library had removed some key functions we relied upon. We've had to rework both our own code and the vendored version of closure to get it to work with the latest closure compiler.PR Type
Enhancement, Bug fix
Description
Upgrade
rules_closureand Google Closure Library to the latest releaseModernize vendored Closure Library code to ES6 modules and classes, replacing legacy
goog.provide/goog.requirewithgoog.modulesyntaxUpdate license headers to SPDX format across multiple files
Remove deprecated utility functions from
goog.base(goog.isDef,goog.isFunction,goog.isArray, etc.) and replace usages with native JavaScript equivalentsAdd User-Agent Client Hints (UACH) support to browser detection with new
Brandenum and version APIsModernize
SafeHtmlto ES6 class with private constructor token validationEnhance testing assertions with custom equality matchers and support for
Map,Set, andArrayBuffercomparisonAdd strict mode directives and type-safe HTML element retrieval helpers to DOM utilities
Migrate array utilities to ES6 modules with new
bucketToMapandtoMapfunctionsRemove obsolete browser compatibility code for IE8 and earlier versions
Add Trusted Types policy support and modernize global evaluation
Remove unused i18n, date/time, and legacy UI components (533+ files deleted)
Fix atom locators to use native
typeofoperator instead of deprecatedgoog.isFunctionUpdate error handling to use
goog.utils.inheritsinstead of deprecatedgoog.inheritsDiagram Walkthrough
File Walkthrough
6 files
safehtml.js
Modernize SafeHtml to ES6 class with goog.modulethird_party/closure/goog/html/safehtml.js
goog.provide/goog.requireto moderngoog.modulesyntax with ES6 class-based implementation
SafeHtmlfrom constructor function to ES6 class withprivate constructor token validation
dir_field) and related methods;simplified type contract
functions and template literals
goog.utilsdependency for type checking utilitiesbrowser.js
Add User-Agent Client Hints support to browser detectionthird_party/closure/goog/labs/useragent/browser.js
goog.provide/goog.requireto moderngoog.modulesyntax
useUserAgentDataBrand()functionBrandenum for browser brand identification and versionchecking
fullVersionOf(),isAtLeast(),isAtMost(),getVersionStringForLogging()HighEntropyBrandVersionclass forasync version loading
signatures with default parameters
base.js
Modernize Closure Library base.js for latest compilerthird_party/closure/goog/base.js
goog.isDef,goog.isString,goog.isBoolean,goog.isNumber,goog.isNull,goog.isDefAndNotNull,goog.isArray,goog.isFunction,goog.getHashCode,goog.removeHashCode,goog.mixin,goog.globalize,goog.base,goog.nullFunction)goog.Transpilerclassgoog.useSafari10Workaround,goog.workaroundSafari10EvalBug)goog.typeOfimplementation using modernArray.isArraygoog.exportPath_to support namespace merging withoverwriteImplicitparametergoog.ENABLE_DEBUG_LOADERdefault fromtruetofalsegoog.createTrustedTypesPolicyand
goog.CLOSURE_EVAL_PREFILTER_goog.globalEvalto use directevalcallgoog.GetMsgOptionsrecord type and enhancedgoog.getMsgwithunescapeHtmlEntitiesoption(
goog.DebugLoader_.IS_OLD_IE_)goog.isEdge_function for pre-Chromium Edge detectionasserts.js
Enhance testing asserts with custom equality matchersthird_party/closure/goog/testing/asserts.js
PRIMITIVE_EQUALITY_PREDICATEStoEQUALITY_PREDICATESand addedsupport for Trusted Types
PRIMITIVE_TRUE_TYPESarray for type checkinggoog.testing.asserts.registerComparatorand related functionsArrayBuffercomparison_trueTypeOfto use modern loop-based constructor matchinggoog.GetMsgOptionsrelated requiresinformation
substrtoslice'use strict'directives throughoutfindDifferencesto support custom equality functions andbetter error reporting
MapandSetcomparisonarray.js
Modernize array.js to ES6 modules and update syntaxthird_party/closure/goog/array/array.js
goog.provide/goog.requireto ES6goog.modulesyntax with proper exports
const/functionwithexplicit
exportsstatementsvartoconst/letfor better scopingbucketToMapandtoMapfor ES6 Map supportgoog.arraynamespacedom.js
Add strict mode and HTML element assertion helpers to dom.jsthird_party/closure/goog/dom/dom.js
'use strict'directives to all functions for stricter JavaScriptsemantics
getHTMLElement,getRequiredHTMLElement,getHTMLElementByClass,getRequiredHTMLElementByClassfor type-safeelement retrieval
copyContentsfunction to safely replace child nodes withoutusing
innerHTMLversions
goog.utilsandgoog.asserts.dommodules
goog.isArraytoArray.isArrayandgoog.isArrayLiketogoog.utils.isArrayLike2 files
locators.js
Remove deprecated goog.isFunction usagejavascript/atoms/locators/locators.js
goog.requirestatements forbot.Errorandbot.ErrorCodegoog.isFunction()calls with nativetypeofoperator checks
error.js
Update error.js to use goog.utils.inheritsjavascript/atoms/error.js
goog.require('goog.utils')dependencygoog.inheritscall togoog.utils.inheritsfor inheritancesetup
1 files
BUILD.bazel
Add Bazel build configuration for labs packagethird_party/closure/goog/labs/BUILD.bazel
101 files