diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 8d68054f92..ffe1bc4655 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -10,7 +10,7 @@ If you are asking a question rather than filing a bug, try one of these instead: #### Live Demo -https://jsbin.com/luhaxab/1/edit +https://jsbin.com/luhaxab/edit https://glitch.com/edit/#!/polymer-repro?path=my-element.html:2:0 diff --git a/CHANGELOG.md b/CHANGELOG.md index d2437a76b0..364ecdcd15 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,130 @@ # Change Log +## [v2.6.0](https://github.com/Polymer/polymer/tree/v2.6.0) (2018-03-22) +- Use function instead of Set ([commit](https://github.com/Polymer/polymer/commit/33d2e1a8)) + +- [ci skip] Fix typo ([commit](https://github.com/Polymer/polymer/commit/0d1b1c2e)) + +- Fix test in shady DOM ([commit](https://github.com/Polymer/polymer/commit/a586b72c)) + +- Deduplicate style includes ([commit](https://github.com/Polymer/polymer/commit/acfef71d)) + +- use a clearer test for shadowRoot ([commit](https://github.com/Polymer/polymer/commit/b2fb1cfd)) + +- Returning null in template should nullify parent template ([commit](https://github.com/Polymer/polymer/commit/2a6c0a2a)) + +- [ci skip] Add clarifying comment ([commit](https://github.com/Polymer/polymer/commit/0573d483)) + +- Correct the JSBin version ([commit](https://github.com/Polymer/polymer/commit/cb1ae7d3)) + +- Put attribute capitalization fix in property-effects ([commit](https://github.com/Polymer/polymer/commit/d45dd575)) + +- Add note about pre v3 releases ([commit](https://github.com/Polymer/polymer/commit/f9391618)) + +- Add note for npm package ([commit](https://github.com/Polymer/polymer/commit/8f2cc0d5)) + +- Add iron-component-page dev-dependency ([commit](https://github.com/Polymer/polymer/commit/d93dd1ce)) + +- Update several gulp dependencies ([commit](https://github.com/Polymer/polymer/commit/ca57a1f3)) + +- Update dom5 to 3.0.0 ([commit](https://github.com/Polymer/polymer/commit/d4a0914e)) + +- Update Google Closure Compiler version and fix cast ([commit](https://github.com/Polymer/polymer/commit/4004c9c4)) + +- Update types ([commit](https://github.com/Polymer/polymer/commit/bb61a20d)) + +- Fix several issues in the documentation of dom-* elements ([commit](https://github.com/Polymer/polymer/commit/8e1b3f45)) + +- Handle `disabled` attribute correctly for tap gesture ([commit](https://github.com/Polymer/polymer/commit/5c0f3e6a)) + +- add test case for nested label ([commit](https://github.com/Polymer/polymer/commit/c11c99b2)) + +- Add docs and cleanup matchingLabels ([commit](https://github.com/Polymer/polymer/commit/e1df1662)) + +- Add tests ([commit](https://github.com/Polymer/polymer/commit/70edf1f8)) + +- update types ([commit](https://github.com/Polymer/polymer/commit/2d674e75)) + +- fix tests and add dependency import ([commit](https://github.com/Polymer/polymer/commit/a37ba7e2)) + +- fix typings ([commit](https://github.com/Polymer/polymer/commit/8f8135b2)) + +- Ensure DisableUpgradeMixin extends PropertiesMixin ([commit](https://github.com/Polymer/polymer/commit/7e74e363)) + +- Format comment and remove deduping mixin ([commit](https://github.com/Polymer/polymer/commit/b8c66ded)) + +- update types ([commit](https://github.com/Polymer/polymer/commit/1fd5f9cf)) + +- update types ([commit](https://github.com/Polymer/polymer/commit/5bc45ce3)) + +- Add mixin to automatically detect capitalized HTML attributes ([commit](https://github.com/Polymer/polymer/commit/37fd5ffe)) + +- Add instructions for locally viewing the source documentation ([commit](https://github.com/Polymer/polymer/commit/206d3610)) + +- Simplify condition checking in stylesFromModule function ([commit](https://github.com/Polymer/polymer/commit/e6903821)) + +- Bump type generator and generate new typings. (#5119) ([commit](https://github.com/Polymer/polymer/commit/5c027309)) + +- dispatchEvent returns boolean (#5117) ([commit](https://github.com/Polymer/polymer/commit/9d86135c)) + +- Update types ([commit](https://github.com/Polymer/polymer/commit/63e7bbc7)) + +- Fix license links ([commit](https://github.com/Polymer/polymer/commit/f3939875)) + +- Fix issue with not genering the Templatizer docs ([commit](https://github.com/Polymer/polymer/commit/55708acf)) + +- Bump TS type generator to pick up transitive mixin handling. ([commit](https://github.com/Polymer/polymer/commit/c3dad540)) + +- Remove unnecessary mutableData property from MutableData mixin ([commit](https://github.com/Polymer/polymer/commit/92b83249)) + +- Update types ([commit](https://github.com/Polymer/polymer/commit/868fba7c)) + +- Add note to updateStyles regarding updates to CSS mixins ([commit](https://github.com/Polymer/polymer/commit/d458bab3)) + +- Avoid timing issues with polyfilled Promise ([commit](https://github.com/Polymer/polymer/commit/6b3e007e)) + +- Revert use of async/await due to lack of build/serve support. ([commit](https://github.com/Polymer/polymer/commit/d4a7a45b)) + +- Revert types. ([commit](https://github.com/Polymer/polymer/commit/dea90802)) + +- Update eslint parserOptions to es2017 for async/await support. ([commit](https://github.com/Polymer/polymer/commit/ef579e29)) + +- Use stronger check for PropertyEffects clients. Fixes #5017 ([commit](https://github.com/Polymer/polymer/commit/e6d558ec)) + +- Remove unneeded file ([commit](https://github.com/Polymer/polymer/commit/a5393b6d)) + +- [PropertiesChanged]: allow old data to be gc'd after `_propertiesChanged` ([commit](https://github.com/Polymer/polymer/commit/74907b9a)) + +- Update package-lock.json ([commit](https://github.com/Polymer/polymer/commit/c58f3e0d)) + +- Make Travis update-types failure style the same as the elements. ([commit](https://github.com/Polymer/polymer/commit/8189382d)) + +- Bump TypeScript generator version. ([commit](https://github.com/Polymer/polymer/commit/3e432190)) + +- Make EventApi.path EventTarget type non-nullable. ([commit](https://github.com/Polymer/polymer/commit/3ede9b51)) + +- Lint and type fixes ([commit](https://github.com/Polymer/polymer/commit/5607a2d8)) + +- [PropertiesChanged]: adds _shouldPropertiesChange ([commit](https://github.com/Polymer/polymer/commit/c1885a6a)) + +- Update docs: templatize() cannot be called multiple times ([commit](https://github.com/Polymer/polymer/commit/27fc21c5)) + +- [ci skip] update changelog ([commit](https://github.com/Polymer/polymer/commit/65b4df86)) + +- Update types. ([commit](https://github.com/Polymer/polymer/commit/c3b6236a)) + +- Fix JSDoc example formatting ([commit](https://github.com/Polymer/polymer/commit/699cd87f)) + +- Use latest webcomponents polyfill bundle ([commit](https://github.com/Polymer/polymer/commit/8fef6776)) + +- Fix label tap by checking matched label pairs ([commit](https://github.com/Polymer/polymer/commit/a77d64e5)) + +- Defer creation related work via `disable-upgrade` ([commit](https://github.com/Polymer/polymer/commit/a7eb9754)) + +- lint fixes ([commit](https://github.com/Polymer/polymer/commit/de0ac5a2)) + +- Adds `Polymer.DisableUpgradeMixin` ([commit](https://github.com/Polymer/polymer/commit/62ce3148)) + ## [v2.5.0](https://github.com/Polymer/polymer/tree/v2.5.0) (2018-02-02) - Update types ([commit](https://github.com/Polymer/polymer/commit/5fa059fa)) diff --git a/externs/closure-types.js b/externs/closure-types.js index 53a27aed29..8e7f3dd19a 100644 --- a/externs/closure-types.js +++ b/externs/closure-types.js @@ -105,9 +105,10 @@ Polymer_PropertiesChanged.prototype._shouldPropertyChange = function(property, v * @param {string} name Name of attribute that changed * @param {?string} old Old attribute value * @param {?string} value New attribute value +* @param {?string} namespace Attribute namespace. * @return {void} */ -Polymer_PropertiesChanged.prototype.attributeChangedCallback = function(name, old, value){}; +Polymer_PropertiesChanged.prototype.attributeChangedCallback = function(name, old, value, namespace){}; /** * @param {string} attribute Name of attribute to deserialize. * @param {?string} value of the attribute. @@ -972,9 +973,10 @@ Polymer_LegacyElementMixin.prototype._initializeProperties = function(){}; * @param {string} name Name of attribute. * @param {?string} old Old value of attribute. * @param {?string} value Current value of attribute. +* @param {?string} namespace Attribute namespace. * @return {void} */ -Polymer_LegacyElementMixin.prototype.attributeChangedCallback = function(name, old, value){}; +Polymer_LegacyElementMixin.prototype.attributeChangedCallback = function(name, old, value, namespace){}; /** * @override * @return {void} @@ -1402,7 +1404,7 @@ Polymer_DisableUpgradeMixin.prototype._enableProperties = function(){}; /** * @override */ -Polymer_DisableUpgradeMixin.prototype.attributeChangedCallback = function(name, old, value){}; +Polymer_DisableUpgradeMixin.prototype.attributeChangedCallback = function(name, old, value, namespace){}; /** * @override */ diff --git a/lib/elements/dom-module.html b/lib/elements/dom-module.html index 3ca593b1a9..01aad394c8 100644 --- a/lib/elements/dom-module.html +++ b/lib/elements/dom-module.html @@ -74,17 +74,20 @@ return null; } + /* eslint-disable no-unused-vars */ /** * @param {string} name Name of attribute. * @param {?string} old Old value of attribute. * @param {?string} value Current value of attribute. + * @param {?string} namespace Attribute namespace. * @return {void} */ - attributeChangedCallback(name, old, value) { + attributeChangedCallback(name, old, value, namespace) { if (old !== value) { this.register(); } } + /* eslint-enable no-unused-args */ /** * The absolute URL of the original location of this `dom-module`. diff --git a/lib/legacy/legacy-element-mixin.html b/lib/legacy/legacy-element-mixin.html index 7306c65140..6c2045f155 100644 --- a/lib/legacy/legacy-element-mixin.html +++ b/lib/legacy/legacy-element-mixin.html @@ -137,12 +137,13 @@ * @param {string} name Name of attribute. * @param {?string} old Old value of attribute. * @param {?string} value Current value of attribute. + * @param {?string} namespace Attribute namespace. * @return {void} * @override */ - attributeChangedCallback(name, old, value) { + attributeChangedCallback(name, old, value, namespace) { if (old !== value) { - super.attributeChangedCallback(name, old, value); + super.attributeChangedCallback(name, old, value, namespace); this.attributeChanged(name, old, value); } } diff --git a/lib/mixins/disable-upgrade-mixin.html b/lib/mixins/disable-upgrade-mixin.html index a94418214e..f714325de5 100644 --- a/lib/mixins/disable-upgrade-mixin.html +++ b/lib/mixins/disable-upgrade-mixin.html @@ -60,13 +60,13 @@ } /** @override */ - attributeChangedCallback(name, old, value) { + attributeChangedCallback(name, old, value, namespace) { if (name == DISABLED_ATTR) { if (!this.__dataEnabled && value == null && this.isConnected) { super.connectedCallback(); } } else { - super.attributeChangedCallback(name, old, value); + super.attributeChangedCallback(name, old, value, namespace); } } @@ -113,4 +113,4 @@ })(); - \ No newline at end of file + diff --git a/lib/mixins/element-mixin.html b/lib/mixins/element-mixin.html index 777db15243..d83946cef2 100644 --- a/lib/mixins/element-mixin.html +++ b/lib/mixins/element-mixin.html @@ -311,9 +311,9 @@ } else { template = template.cloneNode(true); } - this.prototype._template = template; } + this.prototype._template = template; } /** diff --git a/lib/mixins/properties-changed.html b/lib/mixins/properties-changed.html index 000c1374af..cfde2854cc 100644 --- a/lib/mixins/properties-changed.html +++ b/lib/mixins/properties-changed.html @@ -407,15 +407,16 @@ * @param {string} name Name of attribute that changed * @param {?string} old Old attribute value * @param {?string} value New attribute value + * @param {?string} namespace Attribute namespace. * @return {void} * @suppress {missingProperties} Super may or may not implement the callback */ - attributeChangedCallback(name, old, value) { + attributeChangedCallback(name, old, value, namespace) { if (old !== value) { this._attributeToProperty(name, value); } if (super.attributeChangedCallback) { - super.attributeChangedCallback(name, old, value); + super.attributeChangedCallback(name, old, value, namespace); } } diff --git a/lib/mixins/property-effects.html b/lib/mixins/property-effects.html index 827c6de1a9..0feb7c9e41 100644 --- a/lib/mixins/property-effects.html +++ b/lib/mixins/property-effects.html @@ -43,6 +43,9 @@ READ_ONLY: '__readOnly' }; + /** @const {string} */ + const capitalAttributeRegex = /[A-Z]/; + /** * @typedef {{ * name: (string | undefined), @@ -2535,7 +2538,12 @@ // Attribute or property let origName = name; let kind = 'property'; - if (name[name.length-1] == '$') { + // The only way we see a capital letter here is if the attr has + // a capital letter in it per spec. In this case, to make sure + // this binding works, we go ahead and make the binding to the attribute. + if (capitalAttributeRegex.test(name)) { + kind = 'attribute'; + } else if (name[name.length-1] == '$') { name = name.slice(0, -1); kind = 'attribute'; } diff --git a/lib/utils/boot.html b/lib/utils/boot.html index ba85297eb5..0426caa656 100644 --- a/lib/utils/boot.html +++ b/lib/utils/boot.html @@ -49,7 +49,7 @@ }; /* eslint-enable */ - window.Polymer.version = '2.5.0'; + window.Polymer.version = '2.6.0'; /* eslint-disable no-unused-vars */ /* diff --git a/lib/utils/debounce.html b/lib/utils/debounce.html index 8344af328f..1507faa20a 100644 --- a/lib/utils/debounce.html +++ b/lib/utils/debounce.html @@ -113,6 +113,7 @@ } } + /** @const */ Polymer.Debouncer = Debouncer; })(); diff --git a/lib/utils/style-gather.html b/lib/utils/style-gather.html index 5c4fa8ceb6..3b0a48da6a 100644 --- a/lib/utils/style-gather.html +++ b/lib/utils/style-gather.html @@ -123,7 +123,9 @@ // other dom-modules that contain styling let include = e.getAttribute(INCLUDE_ATTR); if (include) { - styles.push(...this.stylesFromModules(include)); + styles.push(...this.stylesFromModules(include).filter(function(item, index, self) { + return self.indexOf(item) === index; + })); } if (baseURI) { e.textContent = Polymer.ResolveUrl.resolveCss(e.textContent, baseURI); diff --git a/package-lock.json b/package-lock.json index 5512cf0f9f..ebb58f4e7a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@polymer/polymer", - "version": "2.5.0", + "version": "2.6.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 354e0f544d..6dd76ec68c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@polymer/polymer", - "version": "2.5.0", + "version": "2.6.0", "description": "The Polymer library makes it easy to create your own web components. Give your element some markup and properties, and then use it on a site. Polymer provides features like dynamic templates and data binding to reduce the amount of boilerplate you need to write", "main": "polymer.html", "directories": { diff --git a/test/smoke/behavior-mixin.html b/test/smoke/behavior-mixin.html index 6c9ed28d7b..b604821080 100644 --- a/test/smoke/behavior-mixin.html +++ b/test/smoke/behavior-mixin.html @@ -22,6 +22,7 @@ + + + +