@popeindustries/lit-html-server
Advanced tools
Comparing version 4.0.0-beta.1 to 4.0.0-beta.2
@@ -21,2 +21,6 @@ /** | ||
tagName: string; | ||
/** | ||
* The element's observed attributes | ||
*/ | ||
readonly observedAttributes: Array<string>; | ||
constructor(tagName: string); | ||
@@ -23,0 +27,0 @@ /** |
@@ -31,5 +31,7 @@ // src/internal/escape.js | ||
this.element; | ||
this.observedAttributes = []; | ||
} | ||
connectedCallback() { | ||
var _a, _b; | ||
this.observedAttributes = this.element.constructor.observedAttributes ?? []; | ||
(_b = (_a = this.element).connectedCallback) == null ? void 0 : _b.call(_a); | ||
@@ -45,3 +47,5 @@ } | ||
this.element.setAttribute(name, value); | ||
this.attributeChangedCallback(name, oldValue, value); | ||
if (this.observedAttributes.includes(name)) { | ||
this.attributeChangedCallback(name, oldValue, value); | ||
} | ||
} | ||
@@ -48,0 +52,0 @@ renderAttributes() { |
@@ -102,4 +102,6 @@ // src/internal/browser-buffer.js | ||
this.element; | ||
this.observedAttributes = []; | ||
} | ||
connectedCallback() { | ||
this.observedAttributes = this.element.constructor.observedAttributes ?? []; | ||
this.element.connectedCallback?.(); | ||
@@ -115,3 +117,5 @@ } | ||
this.element.setAttribute(name, value); | ||
this.attributeChangedCallback(name, oldValue, value); | ||
if (this.observedAttributes.includes(name)) { | ||
this.attributeChangedCallback(name, oldValue, value); | ||
} | ||
} | ||
@@ -118,0 +122,0 @@ renderAttributes() { |
{ | ||
"name": "@popeindustries/lit-html-server", | ||
"version": "4.0.0-beta.1", | ||
"version": "4.0.0-beta.2", | ||
"description": "Efficiently render streaming lit-html templates on the server (or in a ServiceWorker!)", | ||
@@ -60,5 +60,5 @@ "author": "Alexander Pope <alex@pope.industries>", | ||
"test": "pnpm run build && pnpm run test:unit && pnpm run test:browser", | ||
"test:unit": "NODE_ENV=test mocha --require './src/dom-shim.js' --reporter spec --timeout 2000 --node-option conditions=development'test/*-test.js'", | ||
"test:unit": "NODE_ENV=test mocha --require './src/dom-shim.js' --reporter spec --timeout 2000 --node-option conditions=development 'test/*-test.js'", | ||
"test:browser": "node ./test/browser/cli.js" | ||
} | ||
} |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
96641
2547
0