From 7abd7037732408583a8fe696aa2cd775162c33f5 Mon Sep 17 00:00:00 2001 From: Daniel Freedman Date: Tue, 2 May 2017 16:19:31 -0700 Subject: [PATCH] ensure latest closure, stay on polymer-build 1.1 until warnings can be ignored --- closure.log | 78 ++++++++++++++------------------ externs/webcomponents-externs.js | 7 ++- gulpfile.js | 4 +- package.json | 4 +- 4 files changed, 45 insertions(+), 48 deletions(-) diff --git a/closure.log b/closure.log index 4c508ec48e..da937ea6f1 100644 --- a/closure.log +++ b/closure.log @@ -470,78 +470,78 @@ Found : PropertyEffects value = inst.__data[path]; ^^^^^^^^^^^ -/polymer.html_script_11.js:126: WARNING - Property properties never defined on klass of type HTMLElement +/polymer.html_script_11.js:124: WARNING - Property properties never defined on klass of type HTMLElement klass.properties : {}; ^^^^^^^^^^^^^^^^ -/polymer.html_script_11.js:144: WARNING - Property observers never defined on klass of type HTMLElement +/polymer.html_script_11.js:142: WARNING - Property observers never defined on klass of type HTMLElement klass.observers : []; ^^^^^^^^^^^^^^^ -/polymer.html_script_11.js:184: WARNING - Property prototype never defined on klass of type HTMLElement{__classProperties:Object|null} +/polymer.html_script_11.js:182: WARNING - Property prototype never defined on klass of type HTMLElement{__classProperties:Object|null} let superCtor = Object.getPrototypeOf(klass.prototype).constructor; ^^^^^^^^^^^^^^^ -/polymer.html_script_11.js:187: WARNING - Invalid type for parameter 1 of function propertiesForClass. +/polymer.html_script_11.js:185: WARNING - Invalid type for parameter 1 of function propertiesForClass. Expected : HTMLElement|null Found : Function Object.create(propertiesForClass(superCtor)), ^^^^^^^^^ -/polymer.html_script_11.js:241: WARNING - Property prototype never defined on klass of type HTMLElement +/polymer.html_script_11.js:239: WARNING - Property prototype never defined on klass of type HTMLElement let proto = klass.prototype; ^^^^^^^^^^^^^^^ -/polymer.html_script_11.js:260: WARNING - Property prototype never defined on klass of type HTMLElement{__finalized:boolean} +/polymer.html_script_11.js:258: WARNING - Property prototype never defined on klass of type HTMLElement{__finalized:boolean} let proto = klass.prototype; ^^^^^^^^^^^^^^^ -/polymer.html_script_11.js:274: WARNING - Property template never defined on klass of type HTMLElement{__finalized:boolean, is:truthy=} +/polymer.html_script_11.js:272: WARNING - Property template never defined on klass of type HTMLElement{__finalized:boolean, is:truthy=} let template = klass.template; ^^^^^^^^^^^^^^ -/polymer.html_script_11.js:318: WARNING - Property _createMethodObserver never defined on proto of type HTMLElement +/polymer.html_script_11.js:316: WARNING - Property _createMethodObserver never defined on proto of type HTMLElement proto._createMethodObserver(observers[i], dynamicFns); ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -/polymer.html_script_11.js:390: WARNING - Property _hasReadOnlyEffect never defined on proto of type HTMLElement +/polymer.html_script_11.js:388: WARNING - Property _hasReadOnlyEffect never defined on proto of type HTMLElement if (info.computed && !proto._hasReadOnlyEffect(name)) { ^^^^^^^^^^^^^^^^^^^^^^^^ -/polymer.html_script_11.js:391: WARNING - Property _createComputedProperty never defined on proto of type HTMLElement +/polymer.html_script_11.js:389: WARNING - Property _createComputedProperty never defined on proto of type HTMLElement proto._createComputedProperty(name, info.computed, allProps); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -/polymer.html_script_11.js:393: WARNING - Property _hasReadOnlyEffect never defined on proto of type HTMLElement +/polymer.html_script_11.js:391: WARNING - Property _hasReadOnlyEffect never defined on proto of type HTMLElement if (info.readOnly && !proto._hasReadOnlyEffect(name)) { ^^^^^^^^^^^^^^^^^^^^^^^^ -/polymer.html_script_11.js:394: WARNING - Property _createReadOnlyProperty never defined on proto of type HTMLElement +/polymer.html_script_11.js:392: WARNING - Property _createReadOnlyProperty never defined on proto of type HTMLElement proto._createReadOnlyProperty(name, !info.computed); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -/polymer.html_script_11.js:396: WARNING - Property _hasReflectEffect never defined on proto of type HTMLElement +/polymer.html_script_11.js:394: WARNING - Property _hasReflectEffect never defined on proto of type HTMLElement if (info.reflectToAttribute && !proto._hasReflectEffect(name)) { ^^^^^^^^^^^^^^^^^^^^^^^ -/polymer.html_script_11.js:397: WARNING - Property _createReflectedProperty never defined on proto of type HTMLElement +/polymer.html_script_11.js:395: WARNING - Property _createReflectedProperty never defined on proto of type HTMLElement proto._createReflectedProperty(name); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -/polymer.html_script_11.js:399: WARNING - Property _hasNotifyEffect never defined on proto of type HTMLElement +/polymer.html_script_11.js:397: WARNING - Property _hasNotifyEffect never defined on proto of type HTMLElement if (info.notify && !proto._hasNotifyEffect(name)) { ^^^^^^^^^^^^^^^^^^^^^^ -/polymer.html_script_11.js:400: WARNING - Property _createNotifyingProperty never defined on proto of type HTMLElement +/polymer.html_script_11.js:398: WARNING - Property _createNotifyingProperty never defined on proto of type HTMLElement proto._createNotifyingProperty(name); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -/polymer.html_script_11.js:404: WARNING - Property _createPropertyObserver never defined on proto of type HTMLElement +/polymer.html_script_11.js:402: WARNING - Property _createPropertyObserver never defined on proto of type HTMLElement proto._createPropertyObserver(name, info.observer, allProps[info.observer]); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -/polymer.html_script_11.js:433: WARNING - Invalid type for parameter 1 of function window.ShadyCSS.prepareTemplate. +/polymer.html_script_11.js:431: WARNING - Invalid type for parameter 1 of function window.ShadyCSS.prepareTemplate. Expected : HTMLTemplateElement Found : HTMLTemplateElement|null More details: @@ -549,34 +549,34 @@ The found type is a union that includes an unexpected type: null window.ShadyCSS.prepareTemplate(template, is, ext); ^^^^^^^^ -/polymer.html_script_11.js:435: WARNING - Property _bindTemplate never defined on proto of type HTMLElement +/polymer.html_script_11.js:433: WARNING - Property _bindTemplate never defined on proto of type HTMLElement proto._bindTemplate(template); ^^^^^^^^^^^^^^^^^^^ -/polymer.html_script_11.js:458: WARNING - Invalid type for parameter 1 of function propertiesForClass. +/polymer.html_script_11.js:454: WARNING - Invalid type for parameter 1 of function propertiesForClass. Expected : HTMLElement|null Found : PolymerElement let properties = propertiesForClass(this); ^^^^ -/polymer.html_script_11.js:524: WARNING - Property is never defined on this of type PolymerElement +/polymer.html_script_11.js:520: WARNING - Property is never defined on this of type PolymerElement this._template = Polymer.DomModule.import(this.is, 'template') || ^^^^^^^ -/polymer.html_script_11.js:528: WARNING - Property prototype never defined on this of type PolymerElement +/polymer.html_script_11.js:524: WARNING - Property prototype never defined on this of type PolymerElement Object.getPrototypeOf(this.prototype).constructor.template; ^^^^^^^^^^^^^^ -/polymer.html_script_11.js:546: WARNING - Property is never defined on this of type PolymerElement +/polymer.html_script_11.js:542: WARNING - Property is never defined on this of type PolymerElement const module = Polymer.DomModule.import(this.is); ^^^^^^^ -/polymer.html_script_11.js:548: WARNING - Property prototype never defined on this of type PolymerElement +/polymer.html_script_11.js:544: WARNING - Property prototype never defined on this of type PolymerElement Object.getPrototypeOf(this.prototype).constructor.importPath; ^^^^^^^^^^^^^^ -/polymer.html_script_11.js:574: WARNING - Invalid type for parameter 1 of function finalizeTemplate. +/polymer.html_script_11.js:570: WARNING - Invalid type for parameter 1 of function finalizeTemplate. Expected : HTMLElement|null Found : Object|null More details: @@ -584,33 +584,33 @@ The found type is a union that includes an unexpected type: Object finalizeTemplate(this.__proto__, this._template, baseURI, ^^^^^^^^^^^^^^ -/polymer.html_script_11.js:575: WARNING - Property localName never defined on this of type PolymerElement{_template:HTMLTemplateElement{__polymerFinalized:boolean}, constructor:Function} +/polymer.html_script_11.js:571: WARNING - Property localName never defined on this of type PolymerElement{_template:HTMLTemplateElement{__polymerFinalized:boolean}, constructor:Function} this.localName); ^^^^^^^^^^^^^^ -/polymer.html_script_11.js:582: WARNING - Invalid type for parameter 1 of function propertyDefaultsForClass. +/polymer.html_script_11.js:578: WARNING - Invalid type for parameter 1 of function propertyDefaultsForClass. Expected : HTMLElement|null Found : Function let p$ = propertyDefaultsForClass(this.constructor); ^^^^^^^^^^^^^^^^ -/polymer.html_script_11.js:618: WARNING - Invalid type for parameter 1 of function window.ShadyCSS.styleElement. +/polymer.html_script_11.js:614: WARNING - Invalid type for parameter 1 of function window.ShadyCSS.styleElement. Expected : HTMLElement Found : PolymerElement{_template:truthy} window.ShadyCSS.styleElement(this); ^^^^ -/polymer.html_script_11.js:643: WARNING - Property $ never defined on this.root of type DocumentFragment +/polymer.html_script_11.js:639: WARNING - Property $ never defined on this.root of type DocumentFragment this.$ = this.root.$; ^^^^^^^^^^^ -/polymer.html_script_11.js:676: WARNING - Missing return statement. Function expected to return Node|null. +/polymer.html_script_11.js:672: WARNING - Missing return statement. Function expected to return Node|null. _attachDom(dom) { ^^^^^^^^^^^^^^^^^ -/polymer.html_script_11.js:722: WARNING - Invalid type for parameter 1 of function propertiesForClass. +/polymer.html_script_11.js:706: WARNING - Invalid type for parameter 1 of function propertiesForClass. Expected : HTMLElement|null Found : Function|null More details: @@ -618,25 +618,21 @@ The found type is a union that includes an unexpected type: Function let type = propertiesForClass(this.constructor)[property].type; ^^^^^^^^^^^^^^^^ -/polymer.html_script_11.js:747: WARNING - Invalid type for parameter 1 of function window.ShadyCSS.styleSubtree. +/polymer.html_script_11.js:731: WARNING - Invalid type for parameter 1 of function window.ShadyCSS.styleSubtree. Expected : HTMLElement Found : PolymerElement window.ShadyCSS.styleSubtree(this, properties); ^^^^ -/polymer.html_script_11.js:779: WARNING - Property _parseTemplateContent never defined on polymerElementBase of type polymerElementBase<|function(new:polymerElementBase):?|> +/polymer.html_script_11.js:763: WARNING - Property _parseTemplateContent never defined on polymerElementBase of type polymerElementBase<|function(new:polymerElementBase):?|> return super._parseTemplateContent(template, templateInfo, nodeInfo); ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -/polymer.html_script_11.js:870: WARNING - Property is never defined on prototype of type HTMLElement +/polymer.html_script_11.js:854: WARNING - Property is never defined on prototype of type HTMLElement console.log('[' + prototype.is + ']: registered') ^^^^^^^^^^^^ -/polymer.html_script_21.js:331: WARNING - Property polyfillWrapFlushCallback never defined on window.customElements of type CustomElementRegistry - !(window.customElements.polyfillWrapFlushCallback); - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - /polymer.html_script_22.js:853: WARNING - Function this.splice: called with 3 argument(s). Function requires at least 4 argument(s) and at most 4. return this.splice(arrayOrPath, index, 1); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1083,10 +1079,6 @@ The found type is a union that includes an unexpected type: null let templateInfo = template.__templateInfo; ^^^^^^^^^^^^^^^^^^^^^^^ -/polymer.html_script_9.js:396: WARNING - Property decorate never defined on HTMLTemplateElement of type HTMLTemplateElement<|function(new:HTMLTemplateElement):?|> - HTMLTemplateElement.decorate(template); - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - /polymer.html_script_9.js:412: WARNING - Returned type does not match declared return type. Expected : DocumentFragment|null Found : Node{$:Object{}, __noInsertionPoint:boolean, nodeList:Array} @@ -1130,4 +1122,4 @@ externs/closure-types.js:759: WARNING - property toggle on interface Polymer_Arr Polymer_ArraySelectorMixin.prototype.toggle; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -0 error(s), 242 warning(s), 74.7% typed +0 error(s), 240 warning(s), 74.8% typed diff --git a/externs/webcomponents-externs.js b/externs/webcomponents-externs.js index f7bba2421f..87b4875f05 100644 --- a/externs/webcomponents-externs.js +++ b/externs/webcomponents-externs.js @@ -42,4 +42,9 @@ HTMLElement.prototype._activeElement; /** * @param {HTMLTemplateElement} template */ -HTMLTemplateElement.prototype.decorate = function(template){}; +HTMLTemplateElement.decorate = function(template){}; + +/** + * @param {function(function())} cb callback + */ +CustomElementRegistry.prototype.polyfillWrapFlushCallback = function(cb){}; diff --git a/gulpfile.js b/gulpfile.js index 789ea7ad1b..7504b94692 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -148,7 +148,7 @@ gulp.task('closure', ['clean', 'generate-closure-externs'], () => { language_in: 'ES6_STRICT', language_out: 'ES5_STRICT', warning_level: 'VERBOSE', - output_wrapper: '(function(){\n%output%\n}).call(self);', + isolation_mode: 'IIFE', assume_function_wrapper: true, rewrite_polyfills: false, new_type_inf: true, @@ -199,7 +199,7 @@ gulp.task('lint-closure', (done) => { gulp.task('estimate-size', ['clean'], () => { const babelPresets = { - presets: [['babili', {regexpConstructors: false}]] + presets: [['babili', {regexpConstructors: false, simplifyComparisons: false}]] }; const project = new PolymerProject({ diff --git a/package.json b/package.json index a41ca8b1cb..fe97db4f99 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "del": "^2.2.1", "dom5": "^1.3.1", "eslint-plugin-html": "^2.0.1", - "google-closure-compiler": "^20170409.0.0", + "google-closure-compiler": "^20170423.0.0", "gulp": "^3.9.1", "gulp-babel": "^6.1.2", "gulp-eslint": "^3.0.1", @@ -22,7 +22,7 @@ "gulp-vulcanize": "^6.0.1", "lazypipe": "^1.0.1", "merge-stream": "^1.0.1", - "polymer-build": "^1.1.0", + "polymer-build": "1.1.x", "run-sequence": "^1.1.0", "through2": "^2.0.0", "web-component-tester": "^6.0.0-prerelease.4"