Comparing version 0.0.8 to 0.0.9
@@ -57,2 +57,3 @@ export class BlowDry extends HTMLElement { | ||
head.append(sourceTempl); | ||
templ.innerHTML = ''; | ||
currentCnt++; | ||
@@ -59,0 +60,0 @@ } |
@@ -66,2 +66,3 @@ import {BlowDryProps} from './types'; | ||
head.append(sourceTempl); | ||
templ.innerHTML = ''; | ||
currentCnt++; | ||
@@ -68,0 +69,0 @@ } |
{ | ||
"name": "blow-dry", | ||
"version": "0.0.8", | ||
"version": "0.0.9", | ||
"keywords": [ | ||
@@ -5,0 +5,0 @@ "web-components", |
@@ -41,3 +41,25 @@ # blow-dry | ||
## Templates inside of templates | ||
My performance measurements indicate that if a template has a nested template inside, it is faster to extract out the template to a shared location, clone the reduced size template, and reference the shared template. | ||
To instruct blow-dry to make this happen, add attribute blow-dry (or data-blow-dry) to the template: | ||
```html | ||
<template blow-dry></template> | ||
``` | ||
What it will leave behind is a breadcrumb: | ||
```html | ||
<template blow-dry="blow-dry-src-1234"></template> | ||
``` | ||
The content of the original template can then be obtained via: | ||
```JavaScript | ||
const clone = window['blow-dry-src-1234'].content.cloneNode(true); | ||
``` | ||
## Viewing Demos Locally | ||
@@ -44,0 +66,0 @@ |
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
14845
221
96