-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[bazel+closure]: Vendor the version of closure library we use #16742
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
base: trunk
Are you sure you want to change the base?
Conversation
We used to have a version of Google Closure Library tucked away in `//third_party/closure/goog` We never really updated it, because we switched to using `rules_closure`, and that bundles a different version of Google Closure Library. This PR vendors the version of Closure back into `third_party/closure/goog` and then updates our builds and tests to use. This is a necessary prelude to updating `rules_closure` to the latest release. That version no longer bundles a copy of closure, so we need to be using a vendored one. However, the version we end up on won't be _this_ version of closure because the later `rules_closure` has an updated closure compiler that doesn't like our code. However, one thing at a time! Let's start by vendoring the thing we're using and remove ourselves from the clutches of a bundled version of the library.
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
We used to have a version of Google Closure Library tucked away in
//third_party/closure/googWe never really updated it, because we switched to usingrules_closure, and that bundles a different version of Google Closure Library.This PR vendors the version of Closure back into
third_party/closure/googand then updates our builds and tests to use.This is a necessary prelude to updating
rules_closureto the latest release. That version no longer bundles a copy of closure, so we need to be using a vendored one. However, the version we end up on won't be this version of closure because the laterrules_closurehas an updated closure compiler that doesn't like our code.However, one thing at a time! Let's start by vendoring the thing we're using and remove ourselves from the clutches of a bundled version of the library.
PR Type
Enhancement, Bug fix
Description
Vendors Google Closure Library version into
third_party/closure/googto replace the bundled version fromrules_closureUpdates locale data to CLDR version 35 with new country codes and language translations
Refactors
ModuleManagerto extendAbstractModuleManagerbase class with improved dependency orderingModernizes multiple modules to ES6 syntax and safe DOM APIs (
goog.module,goog.dom.safe)Fixes type annotations for nullable elements in UI components
Improves element visibility detection logic and documentation
Updates i18n formatting symbols and date/time patterns to CLDR version 35
Removes obsolete code and performance-related test files
Necessary prelude to updating
rules_closureto the latest release which no longer bundles Closure LibraryDiagram Walkthrough
File Walkthrough
7 files
nativenameconstants.js
Update Closure Library locale data to CLDR version 35third_party/closure/goog/locale/nativenameconstants.js
language names
readability
CP, DG, EA, IC, MF, SX, SS, TA, XK)
current CLDR data
compactnumberformatsymbols.js
Update Closure Library i18n data to CLDR version 35third_party/closure/goog/i18n/compactnumberformatsymbols.js
internationalization data
ar_EG(Egyptian Arabic) support with correspondingformatting symbols
Arabic, Azerbaijani, Bengali, Breton, Catalan, Danish, Spanish, French
Canadian, Galician, Hindi, Italian, Khmer, Kyrgyz, Macedonian,
Mongolian, Norwegian, Odia, Albanian, Swahili) with corrected or
localized abbreviations
ifstatements to asingle
switchstatement for better performance and maintainabilitymodulemanager.js
Refactor ModuleManager to extend AbstractModuleManager base classthird_party/closure/goog/module/modulemanager.js
goog.Disposabletogoog.loader.AbstractModuleManagerto align with new module loadingarchitecture
duplicate implementations
moduleInfoMap_from private to protected property and updatedall references
goog.loader.AbstractModuleManagerinstead of local definitionssetLoaded()to work without parameters by usingcurrentlyLoadingModule_stategetNotYetLoadedTransitiveDepIds_()with BFS algorithm andbetter dependency ordering
goog.log.info()togoog.log.fine()forconsistency
getInstance()static method returning active module managerinstance
isDisposed()methodeventtargettester.js
Modernize closure library test module to ES6 syntaxthird_party/closure/goog/events/eventtargettester.js
goog.provide/goog.requireto moderngoog.modulesyntax
exportsobjectwith nested
commonTestspropertyletdeclarations
goog.inheritspattern to ES6classsyntaxfor
TestEventcommonTestsobject while maintainingtheir functionality
string.js
Refactor string utilities to use internal module and safe APIsthird_party/closure/goog/string/string.js
goog.requirestatements forgoog.dom.safe,goog.html.uncheckedconversions,goog.string.Const, andgoog.string.internalgoog.string.internalimplementations (e.g.,
startsWith,endsWith,trim,contains){@code}tags forinline code references
goog.definecalls to assign results to module propertiesinstead of standalone calls
AMP_RE_,LT_RE_,GT_RE_, etc.) thatare now handled internally
unescapeEntitiesUsingDom_to use safe DOM APIs(
goog.dom.safe.setInnerHtml) instead of directinnerHTMLassignmentgoog.isDef()andgoog.isString()to modernequivalents (
!== undefined,typeof === 'string')nexttick.js
Update async utilities to use safe DOM APIsthird_party/closure/goog/async/nexttick.js
goog.requirestatements for safe DOM and HTML APIs(
goog.dom,goog.dom.safe,goog.html.SafeHtml,goog.html.TrustedResourceUrl,goog.string.Const)goog.dom.createElement(),goog.dom.safe.setIframeSrc(),goog.dom.safe.documentWrite()string assignment
goog.isDef()check to modern!== undefinedcomparison@suppress {missingProperties}annotation forsetImmediateproperty access
delay.js
Modernize type checks in delay modulethird_party/closure/goog/async/delay.js
goog.isDef()call to modern!== undefinedcomparison instart()method2 files
unsafe.js
Improve documentation and remove visibility annotationthird_party/closure/goog/html/sanitizer/unsafe.js
@visibilityannotation from JSDocalsoAllowTagsmethod to clarify thatblacklisted tags are removed from blacklist when added to whitelist
precedence
textarearenderer.js
Update JSDoc formatting in TextareaRendererthird_party/closure/goog/ui/textarearenderer.js
{@code}tag3 files
combobox.js
Update type annotations to indicate nullable elementsthird_party/closure/goog/ui/combobox.js
input_property fromElementto?Elementto indicate nullable type
button_property fromElementto?Elementto indicate nullable type
assertthat.js
Add forward declaration for Matcher typethird_party/closure/goog/labs/testing/assertthat.js
goog.forwardDeclareforgoog.labs.testing.Matcherto handleforward declaration
style.js
Improve element visibility detection logicthird_party/closure/goog/testing/style/style.js
visibility
getComputedStyle()instead ofcustom style retrieval
invisible
101 files