Skip to content

Commit

Permalink
Merge branch 'master' into rewrite-expression-parser
Browse files Browse the repository at this point in the history
  • Loading branch information
TimvdLippe committed Mar 31, 2018
2 parents bb69819 + 55d9175 commit 8d97d13
Show file tree
Hide file tree
Showing 23 changed files with 308 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ If you are asking a question rather than filing a bug, try one of these instead:

#### Live Demo
<!-- jsBin starting point (fork and edit) -->
https://jsbin.com/luhaxab/1/edit
https://jsbin.com/luhaxab/edit
<!-- glitch.me starting point (remix and edit -- must be logged in to persist!) -->
https://glitch.com/edit/#!/polymer-repro?path=my-element.html:2:0
<!-- ...or provide your own repro URL -->
Expand Down
125 changes: 125 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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))

Expand Down
8 changes: 5 additions & 3 deletions externs/closure-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -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
*/
Expand Down
5 changes: 4 additions & 1 deletion lib/elements/dom-module.html
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
5 changes: 3 additions & 2 deletions lib/legacy/legacy-element-mixin.html
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
6 changes: 3 additions & 3 deletions lib/mixins/disable-upgrade-mixin.html
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -113,4 +113,4 @@

})();

</script>
</script>
2 changes: 1 addition & 1 deletion lib/mixins/element-mixin.html
Original file line number Diff line number Diff line change
Expand Up @@ -311,9 +311,9 @@
} else {
template = template.cloneNode(true);
}
this.prototype._template = template;
}

this.prototype._template = template;
}

/**
Expand Down
5 changes: 3 additions & 2 deletions lib/mixins/properties-changed.html
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
10 changes: 9 additions & 1 deletion lib/mixins/property-effects.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@
READ_ONLY: '__readOnly'
};

/** @const {string} */
const capitalAttributeRegex = /[A-Z]/;

/**
* @typedef {{
* name: (string | undefined),
Expand Down Expand Up @@ -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';
}
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/boot.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
};
/* eslint-enable */

window.Polymer.version = '2.5.0';
window.Polymer.version = '2.6.0';

/* eslint-disable no-unused-vars */
/*
Expand Down
1 change: 1 addition & 0 deletions lib/utils/debounce.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
}
}

/** @const */
Polymer.Debouncer = Debouncer;
})();
</script>
4 changes: 3 additions & 1 deletion lib/utils/style-gather.html
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
2 changes: 2 additions & 0 deletions test/smoke/behavior-mixin.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
</template>
</dom-module>
<script>
/** @polymerBehavior */
var MyBehavior = {
properties: {
behaviorProp: {
Expand All @@ -37,6 +38,7 @@
}
}

/** @polymerBehavior */
var MyBehavior2 = {
ready: function() {
console.log(this.localName, 'MyBehavior2.ready');
Expand Down
37 changes: 36 additions & 1 deletion test/unit/inheritance.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,24 @@
</script>
</dom-module>

<dom-module id="parent-element-template-overriding">
<script>
HTMLImports.whenReady(function() {
class ParentElementWithTemplate extends Polymer.Element {
static get template() {
return Polymer.html`This template should not exist`;
}
}
class ChildWithNoTemplate extends ParentElementWithTemplate {
static get template() {
return null;
}
}
customElements.define('child-with-no-template', ChildWithNoTemplate);
});
</script>
</dom-module>

<test-fixture id="basic">
<template>
<base-el></base-el>
Expand Down Expand Up @@ -237,6 +255,23 @@
assert.equal(child.handleCustomEvent.callCount, 1);
});
});

suite('child overriding a template', function() {
let el;

setup(function() {
el = document.createElement('child-with-no-template');
document.body.appendChild(el);
});

teardown(function() {
document.body.removeChild(el);
});

test('returning null nullifies the parent template', function() {
assert.equal(el.shadowRoot, null);
});
});
</script>
</body>
</html>
</html>
Loading

0 comments on commit 8d97d13

Please sign in to comment.