diff --git a/closure.log b/closure.log index 6dece3dc54..03bcf4cd11 100644 --- a/closure.log +++ b/closure.log @@ -26,15 +26,15 @@ polymer.html_script_26.js:173: WARNING - Property mutableData never defined on t return mutablePropertyChange(this, property, value, old, this.mutableData); ^^^^^^^^^^^^^^^^ -polymer.html_script_31.js:318: WARNING - Property as never defined on this of type DomRepeat{template:Element|null} +polymer.html_script_31.js:318: WARNING - Property as never defined on this of type DomRepeat{template: Element|null} instanceProps[this.as] = true; ^^^^^^^ -polymer.html_script_31.js:319: WARNING - Property indexAs never defined on this of type DomRepeat{template:Element|null} +polymer.html_script_31.js:319: WARNING - Property indexAs never defined on this of type DomRepeat{template: Element|null} instanceProps[this.indexAs] = true; ^^^^^^^^^^^^ -polymer.html_script_31.js:320: WARNING - Property itemsIndexAs never defined on this of type DomRepeat{template:Element|null} +polymer.html_script_31.js:320: WARNING - Property itemsIndexAs never defined on this of type DomRepeat{template: Element|null} instanceProps[this.itemsIndexAs] = true; ^^^^^^^^^^^^^^^^^ @@ -42,23 +42,23 @@ polymer.html_script_31.js:418: WARNING - Property _targetFrameTime never defined let ratio = this._targetFrameTime / (currChunkTime - this.__lastChunkTime); ^^^^^^^^^^^^^^^^^^^^^ -polymer.html_script_31.js:450: WARNING - Property delay never defined on this of type DomRepeat{__observePaths:truthy} +polymer.html_script_31.js:450: WARNING - Property delay never defined on this of type DomRepeat{__observePaths: truthy} this.__debounceRender(this.__render, this.delay); ^^^^^^^^^^ -polymer.html_script_31.js:495: WARNING - Property _setRenderedItemCount never defined on this of type DomRepeat{__pool:{length:number} (loose)} +polymer.html_script_31.js:495: WARNING - Property _setRenderedItemCount never defined on this of type DomRepeat{__pool: {length: number} (loose)} this._setRenderedItemCount(this.__instances.length); ^^^^^^^^^^^^^^^^^^^^^^^^^^ -polymer.html_script_31.js:531: WARNING - Property as never defined on this of type DomRepeat{__instances:Object, __itemsIdxToInstIdx:Object{}, __limit:number, items:?=} +polymer.html_script_31.js:531: WARNING - Property as never defined on this of type DomRepeat{__instances: Object, __itemsIdxToInstIdx: Object{}, __limit: number, items: ?=} inst._setPendingProperty(this.as, item); ^^^^^^^ -polymer.html_script_31.js:532: WARNING - Property indexAs never defined on this of type DomRepeat{__instances:Object, __itemsIdxToInstIdx:Object{}, __limit:number, items:?=} +polymer.html_script_31.js:532: WARNING - Property indexAs never defined on this of type DomRepeat{__instances: Object, __itemsIdxToInstIdx: Object{}, __limit: number, items: ?=} inst._setPendingProperty(this.indexAs, instIdx); ^^^^^^^^^^^^ -polymer.html_script_31.js:533: WARNING - Property itemsIndexAs never defined on this of type DomRepeat{__instances:Object, __itemsIdxToInstIdx:Object{}, __limit:number, items:?=} +polymer.html_script_31.js:533: WARNING - Property itemsIndexAs never defined on this of type DomRepeat{__instances: Object, __itemsIdxToInstIdx: Object{}, __limit: number, items: ?=} inst._setPendingProperty(this.itemsIndexAs, itemIdx); ^^^^^^^^^^^^^^^^^ @@ -74,19 +74,19 @@ polymer.html_script_31.js:571: WARNING - Property itemsIndexAs never defined on model[this.itemsIndexAs] = itemIdx; ^^^^^^^^^^^^^^^^^ -polymer.html_script_31.js:580: WARNING - Property as never defined on this of type DomRepeat{__pool:{pop:LOOSE_TOP_FUNCTION} (loose)} +polymer.html_script_31.js:580: WARNING - Property as never defined on this of type DomRepeat{__pool: {pop: LOOSE_TOP_FUNCTION} (loose)} inst._setPendingProperty(this.as, item); ^^^^^^^ -polymer.html_script_31.js:581: WARNING - Property indexAs never defined on this of type DomRepeat{__pool:{pop:LOOSE_TOP_FUNCTION} (loose)} +polymer.html_script_31.js:581: WARNING - Property indexAs never defined on this of type DomRepeat{__pool: {pop: LOOSE_TOP_FUNCTION} (loose)} inst._setPendingProperty(this.indexAs, instIdx); ^^^^^^^^^^^^ -polymer.html_script_31.js:582: WARNING - Property itemsIndexAs never defined on this of type DomRepeat{__pool:{pop:LOOSE_TOP_FUNCTION} (loose)} +polymer.html_script_31.js:582: WARNING - Property itemsIndexAs never defined on this of type DomRepeat{__pool: {pop: LOOSE_TOP_FUNCTION} (loose)} inst._setPendingProperty(this.itemsIndexAs, itemIdx); ^^^^^^^^^^^^^^^^^ -polymer.html_script_31.js:619: WARNING - Property as never defined on this of type DomRepeat{__instances:Object, __itemsIdxToInstIdx:Object} +polymer.html_script_31.js:619: WARNING - Property as never defined on this of type DomRepeat{__instances: Object, __itemsIdxToInstIdx: Object} let itemPath = this.as + (itemSubPath ? '.' + itemSubPath : ''); ^^^^^^^ @@ -130,4 +130,4 @@ polymer.html_script_35.js:5: WARNING - Property _mutablePropertyChange never def let mutablePropertyChange = Polymer.MutableData._mutablePropertyChange; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -0 error(s), 33 warning(s), 75.8% typed +0 error(s), 33 warning(s), 75.7% typed diff --git a/externs/closure-types.js b/externs/closure-types.js index 6c80856aa5..2f250fed0f 100644 --- a/externs/closure-types.js +++ b/externs/closure-types.js @@ -680,7 +680,7 @@ Polymer_PropertyEffects._addTemplatePropertyEffect = function(templateInfo, prop */ Polymer_PropertyEffects._parseBindings = function(text, templateInfo){}; /** -* @param {(PropertyEffectsInstance|Polymer_PropertyEffects)} inst Element that should be used as scope for +* @param {this} inst Element that should be used as scope for binding dependencies * @param {Object} part Binding part metadata * @param {string} path Property/path that triggered this effect @@ -1189,7 +1189,7 @@ Polymer_ElementMixin._addTemplatePropertyEffect = function(templateInfo, prop, e */ Polymer_ElementMixin._parseBindings = function(text, templateInfo){}; /** -* @param {(PropertyEffectsInstance|Polymer_PropertyEffects)} inst Element that should be used as scope for +* @param {this} inst Element that should be used as scope for binding dependencies * @param {Object} part Binding part metadata * @param {string} path Property/path that triggered this effect @@ -1627,7 +1627,7 @@ Polymer_LegacyElementMixin.prototype._ensureAttributes = function(){}; Polymer_LegacyElementMixin.prototype._applyListeners = function(){}; /** * @param {*} value Value to deserialize -* @return {string} +* @return {(string|undefined)} */ Polymer_LegacyElementMixin.prototype.serialize = function(value){}; /** @@ -2004,7 +2004,7 @@ Polymer_LegacyElementMixin._addTemplatePropertyEffect = function(templateInfo, p */ Polymer_LegacyElementMixin._parseBindings = function(text, templateInfo){}; /** -* @param {(PropertyEffectsInstance|Polymer_PropertyEffects)} inst Element that should be used as scope for +* @param {this} inst Element that should be used as scope for binding dependencies * @param {Object} part Binding part metadata * @param {string} path Property/path that triggered this effect @@ -2044,7 +2044,7 @@ Polymer_OptionalMutableData.prototype.mutableData; Polymer_OptionalMutableData.prototype._shouldPropertyChange = function(property, value, old){}; /** * @record -* @extends {Polymer_PropertyEffects} +* @extends {Polymer_ElementMixin} */ function Polymer_ArraySelectorMixin(){} /** @type {Array} */ @@ -2089,12 +2089,14 @@ Polymer_ArraySelectorMixin.prototype._addEventListenerToNode = function(node, ev */ Polymer_ArraySelectorMixin.prototype._removeEventListenerFromNode = function(node, eventName, handler){}; /** -* @param {string} name Name of attribute that changed -* @param {?string} old Old attribute value -* @param {?string} value New attribute value +* @override +* @param {string} name Name of attribute. +* @param {?string} old Old value of attribute. +* @param {?string} value Current value of attribute. */ Polymer_ArraySelectorMixin.prototype.attributeChangedCallback = function(name, old, value){}; /** +* @override */ Polymer_ArraySelectorMixin.prototype._initializeProperties = function(){}; /** @@ -2260,6 +2262,7 @@ Polymer_ArraySelectorMixin.prototype._enqueueClient = function(client){}; */ Polymer_ArraySelectorMixin.prototype._flushClients = function(){}; /** +* @override */ Polymer_ArraySelectorMixin.prototype._readyClients = function(){}; /** @@ -2412,6 +2415,31 @@ Polymer_ArraySelectorMixin.prototype._bindTemplate = function(template, instance */ Polymer_ArraySelectorMixin.prototype._removeBoundDom = function(dom){}; /** +* @override +*/ +Polymer_ArraySelectorMixin.prototype.connectedCallback = function(){}; +/** +* @override +*/ +Polymer_ArraySelectorMixin.prototype.disconnectedCallback = function(){}; +/** +* @param {NodeList} dom to attach to the element. +* @return {Node} +*/ +Polymer_ArraySelectorMixin.prototype._attachDom = function(dom){}; +/** +* @param {Object=} properties Bag of custom property key/values to + apply to this element. +*/ +Polymer_ArraySelectorMixin.prototype.updateStyles = function(properties){}; +/** +* @param {string} url URL to resolve. +* @param {string=} base Optional base URL to resolve against, defaults +to the element's `importPath` +* @return {string} +*/ +Polymer_ArraySelectorMixin.prototype.resolveUrl = function(url, base){}; +/** */ Polymer_ArraySelectorMixin.prototype.clearSelection = function(){}; /** @@ -2448,9 +2476,7 @@ Polymer_ArraySelectorMixin.prototype.selectIndex = function(idx){}; */ Polymer_ArraySelectorMixin._parseTemplate = function(template, outerTemplateInfo){}; /** -* @param {*} template -* @param {*} templateInfo -* @param {*} nodeInfo +* @override */ Polymer_ArraySelectorMixin._parseTemplateContent = function(template, templateInfo, nodeInfo){}; /** @@ -2559,7 +2585,7 @@ Polymer_ArraySelectorMixin._addTemplatePropertyEffect = function(templateInfo, p */ Polymer_ArraySelectorMixin._parseBindings = function(text, templateInfo){}; /** -* @param {(PropertyEffectsInstance|Polymer_PropertyEffects)} inst Element that should be used as scope for +* @param {this} inst Element that should be used as scope for binding dependencies * @param {Object} part Binding part metadata * @param {string} path Property/path that triggered this effect @@ -2568,4 +2594,7 @@ Polymer_ArraySelectorMixin._parseBindings = function(text, templateInfo){}; * @param {boolean} hasPaths True with `props` contains one or more paths * @return {*} */ -Polymer_ArraySelectorMixin._evaluateBinding = function(inst, part, path, props, oldProps, hasPaths){}; \ No newline at end of file +Polymer_ArraySelectorMixin._evaluateBinding = function(inst, part, path, props, oldProps, hasPaths){}; +/** +*/ +Polymer_ArraySelectorMixin.finalize = function(){}; \ No newline at end of file diff --git a/externs/polymer-externs.js b/externs/polymer-externs.js index d35227395b..e6b636de07 100644 --- a/externs/polymer-externs.js +++ b/externs/polymer-externs.js @@ -72,42 +72,4 @@ PolymerTelemetry.prototype._regLog; /** @type {function(HTMLElement)} */ PolymerTelemetry.prototype.register; /** @type {function(HTMLElement)} */ -PolymerTelemetry.prototype.dumpRegistrations; - -/** - * @typedef {{ - * name: (string | undefined), - * structured: (boolean | undefined), - * wildcard: (boolean | undefined) - * }} - */ -var DataTrigger; - -/** - * @typedef {{ - * info: ?, - * trigger: (!DataTrigger | undefined), - * fn: (!Function | undefined) - * }} - */ -var DataEffect; - -/** - * @record - * @extends {Polymer_PropertyEffects} - */ -function PropertyEffectsInstance(){} -/** @type {Object>} */ -PropertyEffectsInstance.prototype.__computeEffects; -/** @type {Object>} */ -PropertyEffectsInstance.prototype.__reflectEffects; -/** @type {Object>} */ -PropertyEffectsInstance.prototype.__notifyEffects; -/** @type {Object>} */ -PropertyEffectsInstance.prototype.__propagateEffects; -/** @type {Object>} */ -PropertyEffectsInstance.prototype.__observeEffects; -/** @type {Object>} */ -PropertyEffectsInstance.prototype.__readOnly; -/** @type {Object} */ -PropertyEffectsInstance.prototype.__data; \ No newline at end of file +PolymerTelemetry.prototype.dumpRegistrations; \ No newline at end of file diff --git a/lib/elements/array-selector.html b/lib/elements/array-selector.html index c607e0d075..05e8013eec 100644 --- a/lib/elements/array-selector.html +++ b/lib/elements/array-selector.html @@ -8,7 +8,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt --> - + @@ -31,7 +31,7 @@ * is an array of multiply selected items. * * @polymerMixin - * @mixes Polymer.PropertyEffects + * @mixes Polymer.ElementMixin * @memberof Polymer * @summary Element mixin for recording dynamic associations between item paths in a * master `items` array and a `selected` array @@ -41,16 +41,16 @@ /** * @constructor * @extends {superClass} - * @implements {Polymer_PropertyEffects} + * @implements {Polymer_ElementMixin} */ - let propertyEffectsBase = Polymer.PropertyEffects(superClass); + let elementBase = Polymer.ElementMixin(superClass); /** * @polymerMixinClass * @implements {Polymer_ArraySelectorMixin} * @unrestricted */ - class ArraySelectorMixin extends propertyEffectsBase { + class ArraySelectorMixin extends elementBase { static get properties() { diff --git a/lib/legacy/legacy-element-mixin.html b/lib/legacy/legacy-element-mixin.html index 72da781b0c..8a379c0d42 100644 --- a/lib/legacy/legacy-element-mixin.html +++ b/lib/legacy/legacy-element-mixin.html @@ -207,10 +207,10 @@ * the `_serializeValue` method provided by `Polymer.PropertyAccessors`. * * @param {*} value Value to deserialize - * @return {string} Serialized value + * @return {string | undefined} Serialized value */ serialize(value) { - return this._serializeValue(value) || ''; + return this._serializeValue(value); } /** @@ -457,10 +457,11 @@ * a user should call `distributeContent` if distribution has been * invalidated due to an element being added or removed from the shadowRoot * that contains an insertion point (``) inside its subtree. + * @suppress {missingProperties} */ distributeContent() { - if (window.ShadyDOM) { - window.ShadyDOM.flush(); + if (window.ShadyDOM && this.shadowRoot) { + this.shadowRoot.forceRender(); } } diff --git a/lib/mixins/property-effects.html b/lib/mixins/property-effects.html index 4f8a361c33..881f78729e 100644 --- a/lib/mixins/property-effects.html +++ b/lib/mixins/property-effects.html @@ -44,6 +44,24 @@ READ_ONLY: '__readOnly' } + /** + * @typedef {{ + * name: (string | undefined), + * structured: (boolean | undefined), + * wildcard: (boolean | undefined) + * }} + */ + let DataTrigger; //eslint-disable-line no-unused-vars + + /** + * @typedef {{ + * info: ?, + * trigger: (!DataTrigger | undefined), + * fn: (!Function | undefined) + * }} + */ + let DataEffect; //eslint-disable-line no-unused-vars + /** * Ensures that the model has an own-property map of effects for the given type. * The model may be a prototype or an instance. @@ -89,7 +107,7 @@ * Runs all effects of a given type for the given set of property changes * on an instance. * - * @param {PropertyEffectsInstance | Polymer_PropertyEffects} inst The instance with effects to run + * @param {!Polymer_PropertyEffects} inst The instance with effects to run * @param {Object} effects Object map of property-to-Array of effects * @param {Object} props Bag of current property changes * @param {Object=} oldProps Bag of previous values for changed properties @@ -115,7 +133,7 @@ /** * Runs a list of effects for a given property. * - * @param {PropertyEffectsInstance | Polymer_PropertyEffects} inst The instance with effects to run + * @param {!Polymer_PropertyEffects} inst The instance with effects to run * @param {Object} effects Object map of property-to-Array of effects * @param {number} dedupeId Counter used for de-duping effects * @param {string} prop Name of changed property @@ -180,7 +198,7 @@ * Calls the method with `info.methodName` on the instance, passing the * new and old values. * - * @param {PropertyEffectsInstance | Polymer_PropertyEffects} inst The instance the effect will be run on + * @param {!Polymer_PropertyEffects} inst The instance the effect will be run on * @param {string} property Name of property * @param {Object} props Bag of current property changes * @param {Object} oldProps Bag of previous values for changed properties @@ -208,7 +226,7 @@ * `notify: true` to ensure object sub-property notifications were * sent. * - * @param {PropertyEffectsInstance | Polymer_PropertyEffects} inst The instance with effects to run + * @param {!Polymer_PropertyEffects} inst The instance with effects to run * @param {Object} notifyProps Bag of properties to notify * @param {Object} props Bag of current property changes * @param {Object} oldProps Bag of previous values for changed properties @@ -244,7 +262,7 @@ * Dispatches {property}-changed events with path information in the detail * object to indicate a sub-path of the property was changed. * - * @param {PropertyEffectsInstance | Polymer_PropertyEffects} inst The element from which to fire the event + * @param {!Polymer_PropertyEffects} inst The element from which to fire the event * @param {string} path The path that was changed * @param {Object} props Bag of current property changes * @return {boolean} Returns true if the path was notified @@ -264,7 +282,7 @@ * Dispatches {property}-changed events to indicate a property (or path) * changed. * - * @param {PropertyEffectsInstance | Polymer_PropertyEffects} inst The element from which to fire the event + * @param {!Polymer_PropertyEffects} inst The element from which to fire the event * @param {string} eventName The name of the event to send ('{property}-changed') * @param {*} value The value of the changed property * @param {string | null | undefined} path If a sub-path of this property changed, the path @@ -289,7 +307,7 @@ * Dispatches a non-bubbling event named `info.eventName` on the instance * with a detail object containing the new `value`. * - * @param {PropertyEffectsInstance | Polymer_PropertyEffects} inst The instance the effect will be run on + * @param {!Polymer_PropertyEffects} inst The instance the effect will be run on * @param {string} property Name of property * @param {Object} props Bag of current property changes * @param {Object} oldProps Bag of previous values for changed properties @@ -318,7 +336,7 @@ * scope's name for that path first. * * @param {CustomEvent} event Notification event (e.g. '-changed') - * @param {PropertyEffectsInstance | Polymer_PropertyEffects} inst Host element instance handling the notification event + * @param {!Polymer_PropertyEffects} inst Host element instance handling the notification event * @param {string} fromProp Child element property that was bound * @param {string} toPath Host property/path that was bound * @param {boolean} negate Whether the binding was negated @@ -348,7 +366,7 @@ * * Sets the attribute named `info.attrName` to the given property value. * - * @param {PropertyEffectsInstance | Polymer_PropertyEffects} inst The instance the effect will be run on + * @param {!Polymer_PropertyEffects} inst The instance the effect will be run on * @param {string} property Name of property * @param {Object} props Bag of current property changes * @param {Object} oldProps Bag of previous values for changed properties @@ -374,7 +392,7 @@ * computed before other effects (binding propagation, observers, and notify) * run. * - * @param {PropertyEffectsInstance | Polymer_PropertyEffects} inst The instance the effect will be run on + * @param {!Polymer_PropertyEffects} inst The instance the effect will be run on * @param {!Object} changedProps Bag of changed properties * @param {!Object} oldProps Bag of previous values for changed properties * @param {boolean} hasPaths True with `props` contains one or more paths @@ -399,7 +417,7 @@ * values of the arguments specified in the `info` object and setting the * return value to the computed property specified. * - * @param {PropertyEffectsInstance | Polymer_PropertyEffects} inst The instance the effect will be run on + * @param {!Polymer_PropertyEffects} inst The instance the effect will be run on * @param {string} property Name of property * @param {Object} props Bag of current property changes * @param {Object} oldProps Bag of previous values for changed properties @@ -420,7 +438,7 @@ * Computes path changes based on path links set up using the `linkPaths` * API. * - * @param {PropertyEffectsInstance | Polymer_PropertyEffects} inst The instance whose props are changing + * @param {!Polymer_PropertyEffects} inst The instance whose props are changing * @param {string | !Array<(string|number)>} path Path that has changed * @param {*} value Value of changed path * @private @@ -526,7 +544,7 @@ * there is no support for _path_ bindings via custom binding parts, * as this is specific to Polymer's path binding syntax. * - * @param {PropertyEffectsInstance | Polymer_PropertyEffects} inst The instance the effect will be run on + * @param {!Polymer_PropertyEffects} inst The instance the effect will be run on * @param {string} path Name of property * @param {Object} props Bag of current property changes * @param {Object} oldProps Bag of previous values for changed properties @@ -561,7 +579,7 @@ * Sets the value for an "binding" (binding) effect to a node, * either as a property or attribute. * - * @param {PropertyEffectsInstance | Polymer_PropertyEffects} inst The instance owning the binding effect + * @param {!Polymer_PropertyEffects} inst The instance owning the binding effect * @param {Node} node Target node for binding * @param {Object} binding Binding metadata * @param {Object} part Binding part metadata @@ -645,7 +663,7 @@ * Setup compound binding storage structures, notify listeners, and dataHost * references onto the bound nodeList. * - * @param {PropertyEffectsInstance | Polymer_PropertyEffects} inst Instance that bas been previously bound + * @param {!Polymer_PropertyEffects} inst Instance that bas been previously bound * @param {Object} templateInfo Template metadata * @private * @suppress {missingProperties} @@ -707,7 +725,7 @@ * Adds a 2-way binding notification event listener to the node specified * * @param {Object} node Child element to add listener to - * @param {PropertyEffectsInstance | Polymer_PropertyEffects} inst Host element instance to handle notification event + * @param {!Polymer_PropertyEffects} inst Host element instance to handle notification event * @param {Object} binding Binding metadata * @private */ @@ -770,12 +788,13 @@ * functions call this function to invoke the method, then use the return * value accordingly. * - * @param {PropertyEffectsInstance | Polymer_PropertyEffects} inst The instance the effect will be run on + * @param {!Polymer_PropertyEffects} inst The instance the effect will be run on * @param {string} property Name of property * @param {Object} props Bag of current property changes * @param {Object} oldProps Bag of previous values for changed properties * @param {?} info Effect metadata * @return {*} Returns the return value from the method invocation + * @suppress {missingProperties} * @private */ function runMethodEffect(inst, property, props, oldProps, info) { @@ -991,7 +1010,7 @@ * * Note: this implementation only accepts normalized paths * - * @param {PropertyEffectsInstance | Polymer_PropertyEffects} inst Instance to send notifications to + * @param {!Polymer_PropertyEffects} inst Instance to send notifications to * @param {Array} array The array the mutations occurred on * @param {string} path The path to the array that was mutated * @param {Array} splices Array of splice records @@ -1012,7 +1031,7 @@ * * Note: this implementation only accepts normalized paths * - * @param {PropertyEffectsInstance | Polymer_PropertyEffects} inst Instance to send notifications to + * @param {!Polymer_PropertyEffects} inst Instance to send notifications to * @param {Array} array The array the mutations occurred on * @param {string} path The path to the array that was mutated * @param {number} index Index at which the array mutation occurred @@ -2544,7 +2563,7 @@ * Called to evaluate a previously parsed binding part based on a set of * one or more changed dependencies. * - * @param {PropertyEffectsInstance | Polymer_PropertyEffects} inst Element that should be used as scope for + * @param {this} inst Element that should be used as scope for * binding dependencies * @param {Object} part Binding part metadata * @param {string} path Property/path that triggered this effect