lit-html
Advanced tools
Comparing version 0.11.1 to 0.11.2
@@ -15,7 +15,20 @@ # Change Log | ||
## [0.11.2] - 2018-09-12 | ||
### Added | ||
* Added `classMap` and `styleMap` directives ([#486](https://github.com/Polymer/lit-html/pull/486)) | ||
<!-- ### Changed --> | ||
<!-- ### Removed --> | ||
### Fixed | ||
* Fixed bug in asyncReplace when rerendering the same iterable ([#485](https://github.com/Polymer/lit-html/pull/485)) | ||
* Update properties before upgrading custom elements ([#455](https://github.com/Polymer/lit-html/pull/455)) | ||
* Cache the ShadyCSS version lookup ([#477](https://github.com/Polymer/lit-html/pull/477)) | ||
## [0.11.1] - 2018-09-02 | ||
### Changed | ||
* Eliminated a cycle in the module import graph (#472) | ||
* Remove the default value for the templateProcessor parameter in TemplateResult#constuctor, making it a required paremeter (#472) | ||
* Eliminated a cycle in the module import graph ([#472](https://github.com/Polymer/lit-html/pull/472)) | ||
* Remove the default value for the templateProcessor parameter in TemplateResult#constuctor, making it a required paremeter ([#472](https://github.com/Polymer/lit-html/pull/472)) | ||
@@ -25,11 +38,11 @@ ## [0.11.0] - 2018-08-28 | ||
### Added | ||
* Added support for property, event, and boolean bindings to default syntax (#398) | ||
* Added guard directive (#438) | ||
* Added when directive (#439) | ||
* Added support for property, event, and boolean bindings to default syntax ([#398](https://github.com/Polymer/lit-html/pull/398)) | ||
* Added guard directive ([#438](https://github.com/Polymer/lit-html/pull/438)) | ||
* Added when directive ([#439](https://github.com/Polymer/lit-html/pull/439)) | ||
### Changed | ||
* Split implementation into multiple small modules and merged lit-html.js and core.js (#436) | ||
* Moved directives into top-level `directives/` directory (#436) | ||
* Replaced `PartCallback` with `TemplateProcessor` (#405) | ||
* Unified `NodePart` and `AttributePart` interfaces (#400) | ||
* Split implementation into multiple small modules and merged lit-html.js and core.js ([#436](https://github.com/Polymer/lit-html/pull/436)) | ||
* Moved directives into top-level `directives/` directory ([#436](https://github.com/Polymer/lit-html/pull/436)) | ||
* Replaced `PartCallback` with `TemplateProcessor` ([#405](https://github.com/Polymer/lit-html/pull/405)) | ||
* Unified `NodePart` and `AttributePart` interfaces ([#400](https://github.com/Polymer/lit-html/pull/400)) | ||
* AttributePart#setValue() takes a single value | ||
@@ -40,16 +53,16 @@ * `Part` has separate `setValue()` and `commit()` phases | ||
### Removed | ||
* Removed lit-extended.js (#436) | ||
* Removed lit-extended.js ([#436](https://github.com/Polymer/lit-html/pull/436)) | ||
### Fixed | ||
* Render initial undefined values in attributes (#377) | ||
* Handle case-sensitive attributes like `viewBox` correctly (#376) | ||
* Support bindings in `<template>` elements (#343) | ||
* Don’t break templates when HTML comments have bindings in them (#446) | ||
* IE: Don't use Set() constructor arguments (#401) | ||
* Handle forms as Node instead of iterable (#404) | ||
* Update values after upgrading custom elements (#385) | ||
* Dirty check primitive values passed to unsafeHTML() (#384) | ||
* Handle forms as Node instead of iterable (#404) | ||
* Upgrade disconnected custom elements before setting properties on them. (#442) | ||
* Fix style attribute bindings in IE (#448) | ||
* Render initial undefined values in attributes ([#377](https://github.com/Polymer/lit-html/pull/377)) | ||
* Handle case-sensitive attributes like `viewBox` correctly ([#376](https://github.com/Polymer/lit-html/pull/376)) | ||
* Support bindings in `<template>` elements ([#343](https://github.com/Polymer/lit-html/pull/343)) | ||
* Don’t break templates when HTML comments have bindings in them ([#446](https://github.com/Polymer/lit-html/pull/446)) | ||
* IE: Don't use Set() constructor arguments ([#401](https://github.com/Polymer/lit-html/pull/401)) | ||
* Handle forms as Node instead of iterable ([#404](https://github.com/Polymer/lit-html/pull/404)) | ||
* Update values after upgrading custom elements ([#385](https://github.com/Polymer/lit-html/pull/385)) | ||
* Dirty check primitive values passed to unsafeHTML() ([#384](https://github.com/Polymer/lit-html/pull/384)) | ||
* Handle forms as Node instead of iterable ([#404](https://github.com/Polymer/lit-html/pull/404)) | ||
* Upgrade disconnected custom elements before setting properties on them. ([#442](https://github.com/Polymer/lit-html/pull/442)) | ||
* Fix style attribute bindings in IE ([#448](https://github.com/Polymer/lit-html/pull/448)) | ||
@@ -56,0 +69,0 @@ |
@@ -50,3 +50,3 @@ /** | ||
const itemPart = new NodePart(part.templateFactory); | ||
part.value = itemPart; | ||
part.value = value; | ||
let i = 0; | ||
@@ -64,3 +64,3 @@ try { | ||
// the part, and if not bail because a new value owns this part | ||
if (part.value !== itemPart) { | ||
if (part.value !== value) { | ||
break; | ||
@@ -67,0 +67,0 @@ } |
@@ -21,3 +21,3 @@ /** | ||
* While this directive can render any regular part, it makes the most sense | ||
* when used with TemplateResulte since most other values are dirty checked | ||
* when used with TemplateResult since most other values are dirty checked | ||
* already. | ||
@@ -24,0 +24,0 @@ * |
@@ -22,3 +22,3 @@ /** | ||
* While this directive can render any regular part, it makes the most sense | ||
* when used with TemplateResulte since most other values are dirty checked | ||
* when used with TemplateResult since most other values are dirty checked | ||
* already. | ||
@@ -25,0 +25,0 @@ * |
@@ -200,5 +200,4 @@ /** | ||
const template = this.templateFactory(value); | ||
let instance; | ||
if (this.value && this.value.template === template) { | ||
instance = this.value; | ||
this.value.update(value.values); | ||
} | ||
@@ -209,14 +208,13 @@ else { | ||
// from the render function so that it can control caching. | ||
instance = | ||
new TemplateInstance(template, value.processor, this.templateFactory); | ||
const instance = new TemplateInstance(template, value.processor, this.templateFactory); | ||
const fragment = instance._clone(); | ||
// Since we cloned in the polyfill case, now force an upgrade | ||
if (isCEPolyfill && !this.endNode.isConnected) { | ||
if (isCEPolyfill) { | ||
document.adoptNode(fragment); | ||
customElements.upgrade(fragment); | ||
} | ||
instance.update(value.values); | ||
this._commitNode(fragment); | ||
this.value = instance; | ||
} | ||
instance.update(value.values); | ||
} | ||
@@ -223,0 +221,0 @@ _commitIterable(value) { |
@@ -23,14 +23,12 @@ /** | ||
const getTemplateCacheKey = (type, scopeName) => `${type}--${scopeName}`; | ||
const verifyShadyCSSVersion = () => { | ||
if (typeof window.ShadyCSS === 'undefined') { | ||
return false; | ||
} | ||
if (typeof window.ShadyCSS.prepareTemplateDom === 'undefined') { | ||
console.warn(`Incompatible ShadyCSS version detected.` + | ||
`Please update to at least @webcomponents/webcomponentsjs@2.0.2 and` + | ||
`@webcomponents/shadycss@1.3.1.`); | ||
return false; | ||
} | ||
return true; | ||
}; | ||
let compatibleShadyCSSVersion = true; | ||
if (typeof window.ShadyCSS === 'undefined') { | ||
compatibleShadyCSSVersion = false; | ||
} | ||
else if (typeof window.ShadyCSS.prepareTemplateDom === 'undefined') { | ||
console.warn(`Incompatible ShadyCSS version detected.` + | ||
`Please update to at least @webcomponents/webcomponentsjs@2.0.2 and` + | ||
`@webcomponents/shadycss@1.3.1.`); | ||
compatibleShadyCSSVersion = false; | ||
} | ||
/** | ||
@@ -50,3 +48,3 @@ * Template factory which scopes template DOM using ShadyCSS. | ||
const element = result.getTemplateElement(); | ||
if (verifyShadyCSSVersion()) { | ||
if (compatibleShadyCSSVersion) { | ||
window.ShadyCSS.prepareTemplateDom(element, scopeName); | ||
@@ -139,7 +137,6 @@ } | ||
instance.update(result.values); | ||
const host = container instanceof ShadowRoot ? container.host : undefined; | ||
// If there's a shadow host, do ShadyCSS scoping... | ||
if (host !== undefined && verifyShadyCSSVersion()) { | ||
if (container instanceof ShadowRoot && compatibleShadyCSSVersion) { | ||
ensureStylesScoped(fragment, template, scopeName); | ||
window.ShadyCSS.styleElement(host); | ||
window.ShadyCSS.styleElement(container.host); | ||
} | ||
@@ -146,0 +143,0 @@ removeNodes(container, container.firstChild); |
{ | ||
"name": "lit-html", | ||
"version": "0.11.1", | ||
"version": "0.11.2", | ||
"description": "HTML template literals in JavaScript", | ||
@@ -5,0 +5,0 @@ "license": "BSD-3-Clause", |
@@ -51,2 +51,2 @@ > ## 🛠 Status: In Development | ||
Please see [CONTRIBUTING.md](). | ||
Please see [CONTRIBUTING.md](./CONTRIBUTING.md). |
@@ -47,3 +47,3 @@ /** | ||
const itemPart = new NodePart(part.templateFactory); | ||
part.value = itemPart; | ||
part.value = value; | ||
@@ -62,3 +62,3 @@ let i = 0; | ||
// the part, and if not bail because a new value owns this part | ||
if (part.value !== itemPart) { | ||
if (part.value !== value) { | ||
break; | ||
@@ -65,0 +65,0 @@ } |
@@ -32,3 +32,3 @@ /** | ||
* While this directive can render any regular part, it makes the most sense | ||
* when used with TemplateResulte since most other values are dirty checked | ||
* when used with TemplateResult since most other values are dirty checked | ||
* already. | ||
@@ -101,2 +101,2 @@ * | ||
cache.prevCondition = !!condition; | ||
}); | ||
}); |
@@ -228,5 +228,4 @@ /** | ||
const template = this.templateFactory(value); | ||
let instance: TemplateInstance; | ||
if (this.value && this.value.template === template) { | ||
instance = this.value; | ||
this.value.update(value.values); | ||
} else { | ||
@@ -236,14 +235,14 @@ // Make sure we propagate the template processor from the TemplateResult | ||
// from the render function so that it can control caching. | ||
instance = | ||
const instance = | ||
new TemplateInstance(template, value.processor, this.templateFactory); | ||
const fragment = instance._clone(); | ||
// Since we cloned in the polyfill case, now force an upgrade | ||
if (isCEPolyfill && !this.endNode.isConnected) { | ||
if (isCEPolyfill) { | ||
document.adoptNode(fragment); | ||
customElements.upgrade(fragment); | ||
} | ||
instance.update(value.values); | ||
this._commitNode(fragment); | ||
this.value = instance; | ||
} | ||
instance.update(value.values); | ||
} | ||
@@ -250,0 +249,0 @@ |
@@ -36,16 +36,14 @@ /** | ||
const verifyShadyCSSVersion = () => { | ||
if (typeof window.ShadyCSS === 'undefined') { | ||
return false; | ||
} | ||
if (typeof window.ShadyCSS.prepareTemplateDom === 'undefined') { | ||
console.warn( | ||
`Incompatible ShadyCSS version detected.` + | ||
`Please update to at least @webcomponents/webcomponentsjs@2.0.2 and` + | ||
`@webcomponents/shadycss@1.3.1.`); | ||
return false; | ||
} | ||
return true; | ||
}; | ||
let compatibleShadyCSSVersion = true; | ||
if (typeof window.ShadyCSS === 'undefined') { | ||
compatibleShadyCSSVersion = false; | ||
} else if (typeof window.ShadyCSS.prepareTemplateDom === 'undefined') { | ||
console.warn( | ||
`Incompatible ShadyCSS version detected.` + | ||
`Please update to at least @webcomponents/webcomponentsjs@2.0.2 and` + | ||
`@webcomponents/shadycss@1.3.1.`); | ||
compatibleShadyCSSVersion = false; | ||
} | ||
/** | ||
@@ -66,3 +64,3 @@ * Template factory which scopes template DOM using ShadyCSS. | ||
const element = result.getTemplateElement(); | ||
if (verifyShadyCSSVersion()) { | ||
if (compatibleShadyCSSVersion) { | ||
window.ShadyCSS.prepareTemplateDom(element, scopeName); | ||
@@ -173,8 +171,6 @@ } | ||
const host = container instanceof ShadowRoot ? container.host : undefined; | ||
// If there's a shadow host, do ShadyCSS scoping... | ||
if (host !== undefined && verifyShadyCSSVersion()) { | ||
if (container instanceof ShadowRoot && compatibleShadyCSSVersion) { | ||
ensureStylesScoped(fragment, template, scopeName); | ||
window.ShadyCSS.styleElement(host); | ||
window.ShadyCSS.styleElement(container.host); | ||
} | ||
@@ -181,0 +177,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
333236
100
4810