diff --git a/integration/__fixtures__/server-express/dist_expected/client/about/index.html b/integration/__fixtures__/server-express/dist_expected/client/about/index.html index 8397a08..8257246 100644 --- a/integration/__fixtures__/server-express/dist_expected/client/about/index.html +++ b/integration/__fixtures__/server-express/dist_expected/client/about/index.html @@ -10,7 +10,6 @@ - - + diff --git a/integration/__fixtures__/server-express/dist_expected/client/assets/404-YV9WDv3j.js b/integration/__fixtures__/server-express/dist_expected/client/assets/404-YV9WDv3j.js deleted file mode 100644 index b96d8dd..0000000 --- a/integration/__fixtures__/server-express/dist_expected/client/assets/404-YV9WDv3j.js +++ /dev/null @@ -1 +0,0 @@ -import{c}from"./document.client-Cca60DWw.js";c(); diff --git a/integration/__fixtures__/server-express/dist_expected/client/assets/document.client-Cca60DWw.js b/integration/__fixtures__/server-express/dist_expected/client/assets/document.client-CMOVr55R.js similarity index 76% rename from integration/__fixtures__/server-express/dist_expected/client/assets/document.client-Cca60DWw.js rename to integration/__fixtures__/server-express/dist_expected/client/assets/document.client-CMOVr55R.js index 2918168..7cb2cb7 100644 --- a/integration/__fixtures__/server-express/dist_expected/client/assets/document.client-Cca60DWw.js +++ b/integration/__fixtures__/server-express/dist_expected/client/assets/document.client-CMOVr55R.js @@ -2,22 +2,22 @@ * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const O=globalThis,C=O.trustedTypes,D=C?C.createPolicy("lit-html",{createHTML:s=>s}):void 0,M="$lit$",A=`lit$${Math.random().toFixed(9).slice(2)}$`,L="?"+A,tt=`<${L}>`,y=document,E=()=>y.createComment(""),H=s=>s===null||typeof s!="object"&&typeof s!="function",W=Array.isArray,F=s=>W(s)||typeof s?.[Symbol.iterator]=="function",R=`[ -\f\r]`,x=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,U=/-->/g,B=/>/g,_=RegExp(`>|${R}(?:([^\\s"'>=/]+)(${R}*=${R}*(?:[^ -\f\r"'\`<>=]|("|')|))|$)`,"g"),j=/'/g,k=/"/g,G=/^(?:script|style|textarea|title)$/i,g=Symbol.for("lit-noChange"),p=Symbol.for("lit-nothing"),V=new WeakMap,m=y.createTreeWalker(y,129);function z(s,t){if(!Array.isArray(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return D!==void 0?D.createHTML(t):t}const Z=(s,t)=>{const i=s.length-1,r=[];let e,n=t===2?"":"",o=x;for(let h=0;h"?(o=e??x,c=-1):d[1]===void 0?c=-2:(c=o.lastIndex-d[2].length,a=d[1],o=d[3]===void 0?_:d[3]==='"'?k:j):o===k||o===j?o=_:o===U||o===B?o=x:(o=_,e=void 0);const f=o===_&&s[h+1].startsWith("/>")?" ":"";n+=o===x?l+tt:c>=0?(r.push(a),l.slice(0,c)+M+l.slice(c)+A+f):l+A+(c===-2?h:f)}return[z(s,n+(s[i]||"")+(t===2?"":"")),r]};class P{constructor({strings:t,_$litType$:i},r){let e;this.parts=[];let n=0,o=0;const h=t.length-1,l=this.parts,[a,d]=Z(t,i);if(this.el=P.createElement(a,r),m.currentNode=this.el.content,i===2){const c=this.el.content.firstChild;c.replaceWith(...c.childNodes)}for(;(e=m.nextNode())!==null&&l.length0){e.textContent=C?C.emptyScript:"";for(let f=0;f<$;f++)e.append(c[f],E()),m.nextNode(),l.push({type:2,index:++n});e.append(c[$],E())}}}else if(e.nodeType===8)if(e.data===L)l.push({type:2,index:n});else{let c=-1;for(;(c=e.data.indexOf(A,c+1))!==-1;)l.push({type:7,index:n}),c+=A.length-1}n++}}static createElement(t,i){const r=y.createElement("template");return r.innerHTML=t,r}}function v(s,t,i=s,r){if(t===g)return t;let e=r!==void 0?i._$Co?.[r]:i._$Cl;const n=H(t)?void 0:t._$litDirective$;return e?.constructor!==n&&(e?._$AO?.(!1),n===void 0?e=void 0:(e=new n(s),e._$AT(s,i,r)),r!==void 0?(i._$Co??=[])[r]=e:i._$Cl=e),e!==void 0&&(t=v(s,e._$AS(s,t.values),e,r)),t}class q{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:i},parts:r}=this._$AD,e=(t?.creationScope??y).importNode(i,!0);m.currentNode=e;let n=m.nextNode(),o=0,h=0,l=r[0];for(;l!==void 0;){if(o===l.index){let a;l.type===2?a=new b(n,n.nextSibling,this,t):l.type===1?a=new l.ctor(n,l.name,l.strings,this,t):l.type===6&&(a=new Q(n,this,t)),this._$AV.push(a),l=r[++h]}o!==l?.index&&(n=m.nextNode(),o++)}return m.currentNode=y,e}p(t){let i=0;for(const r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(t,r,i),i+=r.strings.length-2):r._$AI(t[i])),i++}}class b{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,i,r,e){this.type=2,this._$AH=p,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=r,this.options=e,this._$Cv=e?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return i!==void 0&&t?.nodeType===11&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=v(this,t,i),H(t)?t===p||t==null||t===""?(this._$AH!==p&&this._$AR(),this._$AH=p):t!==this._$AH&&t!==g&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):F(t)?this.k(t):this._(t)}S(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.S(t))}_(t){this._$AH!==p&&H(this._$AH)?this._$AA.nextSibling.data=t:this.T(y.createTextNode(t)),this._$AH=t}$(t){const{values:i,_$litType$:r}=t,e=typeof r=="number"?this._$AC(t):(r.el===void 0&&(r.el=P.createElement(z(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===e)this._$AH.p(i);else{const n=new q(e,this),o=n.u(this.options);n.p(i),this.T(o),this._$AH=n}}_$AC(t){let i=V.get(t.strings);return i===void 0&&V.set(t.strings,i=new P(t)),i}k(t){W(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let r,e=0;for(const n of t)e===i.length?i.push(r=new b(this.S(E()),this.S(E()),this,this.options)):r=i[e],r._$AI(n),e++;e2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=p}_$AI(t,i=this,r,e){const n=this.strings;let o=!1;if(n===void 0)t=v(this,t,i,0),o=!H(t)||t!==this._$AH&&t!==g,o&&(this._$AH=t);else{const h=t;let l,a;for(t=n[0],l=0;l{const r=i?.renderBefore??t;let e=r._$litPart$;if(e===void 0){const n=i?.renderBefore??null;r._$litPart$=e=new b(t.insertBefore(E(),n),n,void 0,i??{})}return e._$AI(s),e};/** + */const O=globalThis,C=O.trustedTypes,U=C?C.createPolicy("lit-html",{createHTML:s=>s}):void 0,M="$lit$",A=`lit$${Math.random().toFixed(9).slice(2)}$`,L="?"+A,tt=`<${L}>`,g=document,w=()=>g.createComment(""),H=s=>s===null||typeof s!="object"&&typeof s!="function",k=Array.isArray,F=s=>k(s)||typeof s?.[Symbol.iterator]=="function",R=`[ +\f\r]`,x=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,B=/-->/g,D=/>/g,_=RegExp(`>|${R}(?:([^\\s"'>=/]+)(${R}*=${R}*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`,"g"),j=/'/g,V=/"/g,G=/^(?:script|style|textarea|title)$/i,y=Symbol.for("lit-noChange"),p=Symbol.for("lit-nothing"),W=new WeakMap,m=g.createTreeWalker(g,129);function z(s,t){if(!Array.isArray(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return U!==void 0?U.createHTML(t):t}const Z=(s,t)=>{const i=s.length-1,r=[];let e,n=t===2?"":"",o=x;for(let h=0;h"?(o=e??x,c=-1):d[1]===void 0?c=-2:(c=o.lastIndex-d[2].length,a=d[1],o=d[3]===void 0?_:d[3]==='"'?V:j):o===V||o===j?o=_:o===B||o===D?o=x:(o=_,e=void 0);const f=o===_&&s[h+1].startsWith("/>")?" ":"";n+=o===x?l+tt:c>=0?(r.push(a),l.slice(0,c)+M+l.slice(c)+A+f):l+A+(c===-2?h:f)}return[z(s,n+(s[i]||"")+(t===2?"":"")),r]};class P{constructor({strings:t,_$litType$:i},r){let e;this.parts=[];let n=0,o=0;const h=t.length-1,l=this.parts,[a,d]=Z(t,i);if(this.el=P.createElement(a,r),m.currentNode=this.el.content,i===2){const c=this.el.content.firstChild;c.replaceWith(...c.childNodes)}for(;(e=m.nextNode())!==null&&l.length0){e.textContent=C?C.emptyScript:"";for(let f=0;f<$;f++)e.append(c[f],w()),m.nextNode(),l.push({type:2,index:++n});e.append(c[$],w())}}}else if(e.nodeType===8)if(e.data===L)l.push({type:2,index:n});else{let c=-1;for(;(c=e.data.indexOf(A,c+1))!==-1;)l.push({type:7,index:n}),c+=A.length-1}n++}}static createElement(t,i){const r=g.createElement("template");return r.innerHTML=t,r}}function v(s,t,i=s,r){if(t===y)return t;let e=r!==void 0?i._$Co?.[r]:i._$Cl;const n=H(t)?void 0:t._$litDirective$;return e?.constructor!==n&&(e?._$AO?.(!1),n===void 0?e=void 0:(e=new n(s),e._$AT(s,i,r)),r!==void 0?(i._$Co??=[])[r]=e:i._$Cl=e),e!==void 0&&(t=v(s,e._$AS(s,t.values),e,r)),t}class Y{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:i},parts:r}=this._$AD,e=(t?.creationScope??g).importNode(i,!0);m.currentNode=e;let n=m.nextNode(),o=0,h=0,l=r[0];for(;l!==void 0;){if(o===l.index){let a;l.type===2?a=new b(n,n.nextSibling,this,t):l.type===1?a=new l.ctor(n,l.name,l.strings,this,t):l.type===6&&(a=new Q(n,this,t)),this._$AV.push(a),l=r[++h]}o!==l?.index&&(n=m.nextNode(),o++)}return m.currentNode=g,e}p(t){let i=0;for(const r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(t,r,i),i+=r.strings.length-2):r._$AI(t[i])),i++}}class b{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,i,r,e){this.type=2,this._$AH=p,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=r,this.options=e,this._$Cv=e?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return i!==void 0&&t?.nodeType===11&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=v(this,t,i),H(t)?t===p||t==null||t===""?(this._$AH!==p&&this._$AR(),this._$AH=p):t!==this._$AH&&t!==y&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):F(t)?this.k(t):this._(t)}S(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.S(t))}_(t){this._$AH!==p&&H(this._$AH)?this._$AA.nextSibling.data=t:this.T(g.createTextNode(t)),this._$AH=t}$(t){const{values:i,_$litType$:r}=t,e=typeof r=="number"?this._$AC(t):(r.el===void 0&&(r.el=P.createElement(z(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===e)this._$AH.p(i);else{const n=new Y(e,this),o=n.u(this.options);n.p(i),this.T(o),this._$AH=n}}_$AC(t){let i=W.get(t.strings);return i===void 0&&W.set(t.strings,i=new P(t)),i}k(t){k(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let r,e=0;for(const n of t)e===i.length?i.push(r=new b(this.S(w()),this.S(w()),this,this.options)):r=i[e],r._$AI(n),e++;e2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=p}_$AI(t,i=this,r,e){const n=this.strings;let o=!1;if(n===void 0)t=v(this,t,i,0),o=!H(t)||t!==this._$AH&&t!==y,o&&(this._$AH=t);else{const h=t;let l,a;for(t=n[0],l=0;l{const r=i?.renderBefore??t;let e=r._$litPart$;if(e===void 0){const n=i?.renderBefore??null;r._$litPart$=e=new b(t.insertBefore(w(),n),n,void 0,i??{})}return e._$AI(s),e};/** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */let S=null;const it={boundAttributeSuffix:u.P,marker:u.A,markerMatch:u.C,HTML_RESULT:u.M,getTemplateHtml:u.L,overrideDirectiveResolve:(s,t)=>class extends s{_$AS(i,r){return t(this,r)}},patchDirectiveResolve:(s,t)=>{if(s.prototype._$AS!==t){S??=s.prototype._$AS.name;for(let i=s.prototype;i!==Object.prototype;i=Object.getPrototypeOf(i))if(i.hasOwnProperty(S))return void(i[S]=t);throw Error("Internal error: It is possible that both dev mode and production mode Lit was mixed together during SSR. Please comment on the issue: https://github.com/lit/lit/issues/4527")}},setDirectiveClass(s,t){s._$litDirective$=t},getAttributePartCommittedValue:(s,t,i)=>{let r=g;return s.j=e=>r=e,s._$AI(t,s,i),r},connectedDisconnectable:s=>({...s,_$AU:!0}),resolveDirective:u.V,AttributePart:u.H,PropertyPart:u.B,BooleanAttributePart:u.N,EventPart:u.U,ElementPart:u.F,TemplateInstance:u.R,isIterable:u.D,ChildPart:u.I};/** + */let S=null;const it={boundAttributeSuffix:u.P,marker:u.A,markerMatch:u.C,HTML_RESULT:u.M,getTemplateHtml:u.L,overrideDirectiveResolve:(s,t)=>class extends s{_$AS(i,r){return t(this,r)}},patchDirectiveResolve:(s,t)=>{if(s.prototype._$AS!==t){S??=s.prototype._$AS.name;for(let i=s.prototype;i!==Object.prototype;i=Object.getPrototypeOf(i))if(i.hasOwnProperty(S))return void(i[S]=t);throw Error("Internal error: It is possible that both dev mode and production mode Lit was mixed together during SSR. Please comment on the issue: https://github.com/lit/lit/issues/4527")}},setDirectiveClass(s,t){s._$litDirective$=t},getAttributePartCommittedValue:(s,t,i)=>{let r=y;return s.j=e=>r=e,s._$AI(t,s,i),r},connectedDisconnectable:s=>({...s,_$AU:!0}),resolveDirective:u.V,AttributePart:u.H,PropertyPart:u.B,BooleanAttributePart:u.N,EventPart:u.U,ElementPart:u.F,TemplateInstance:u.R,isIterable:u.D,ChildPart:u.I};/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const w={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6};/** + */const T={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6};/** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const nt=s=>s===null||typeof s!="object"&&typeof s!="function",ot=(s,t)=>s?._$litType$!==void 0,st=s=>s?._$litType$?.h!=null,lt=s=>s.strings===void 0;/** + */const nt=s=>s===null||typeof s!="object"&&typeof s!="function",st=(s,t)=>s?._$litType$!==void 0,ot=s=>s?._$litType$?.h!=null,lt=s=>s.strings===void 0;/** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const{TemplateInstance:at,isIterable:ht,resolveDirective:X,ChildPart:T,ElementPart:ct}=it,dt=(s,t,i={})=>{if(t._$litPart$!==void 0)throw Error("container already contains a live render");let r,e,n;const o=[],h=document.createTreeWalker(t,NodeFilter.SHOW_COMMENT);let l;for(;(l=h.nextNode())!==null;){const a=l.data;if(a.startsWith("lit-part")){if(o.length===0&&r!==void 0)throw Error(`There must be only one root part per container. Found a part marker (${l}) when we already have a root part marker (${e})`);n=pt(s,l,o,i),r===void 0&&(r=n),e??=l}else if(a.startsWith("lit-node"))$t(l,o,i);else if(a.startsWith("/lit-part")){if(o.length===1&&n!==r)throw Error("internal error");n=ut(l,n,o)}}if(r===void 0){const a=t instanceof ShadowRoot?"{container.host.localName}'s shadow root":t instanceof DocumentFragment?"DocumentFragment":t.localName;console.error(`There should be exactly one root part in a render container, but we didn't find any in ${a}.`)}t._$litPart$=r},pt=(s,t,i,r)=>{let e,n;if(i.length===0)n=new T(t,null,void 0,r),e=s;else{const o=i[i.length-1];if(o.type==="template-instance")n=new T(t,null,o.instance,r),o.instance._$AV.push(n),e=o.result.values[o.instancePartIndex++],o.templatePartIndex++;else if(o.type==="iterable"){n=new T(t,null,o.part,r);const h=o.iterator.next();if(h.done)throw e=void 0,o.done=!0,Error("Unhandled shorter than expected iterable");e=h.value,o.part._$AH.push(n)}else n=new T(t,null,o.part,r)}if(e=X(n,e),e===g)i.push({part:n,type:"leaf"});else if(nt(e))i.push({part:n,type:"leaf"}),n._$AH=e;else if(ot(e)){if(st(e))throw Error("compiled templates are not supported");const o="lit-part "+At(e);if(t.data!==o)throw Error("Hydration value mismatch: Unexpected TemplateResult rendered to part");{const h=T.prototype._$AC(e),l=new at(h,n);i.push({type:"template-instance",instance:l,part:n,templatePartIndex:0,instancePartIndex:0,result:e}),n._$AH=l}}else ht(e)?(i.push({part:n,type:"iterable",value:e,iterator:e[Symbol.iterator](),done:!1}),n._$AH=[]):(i.push({part:n,type:"leaf"}),n._$AH=e??"");return n},ut=(s,t,i)=>{if(t===void 0)throw Error("unbalanced part marker");t._$AB=s;const r=i.pop();if(r.type==="iterable"&&!r.iterator.next().done)throw Error("unexpected longer than expected iterable");if(i.length>0)return i[i.length-1].part},$t=(s,t,i)=>{const r=/lit-node (\d+)/.exec(s.data),e=parseInt(r[1]),n=s.nextElementSibling;if(n===null)throw Error("could not find node for attribute parts");n.removeAttribute("defer-hydration");const o=t[t.length-1];if(o.type!=="template-instance")throw Error("Hydration value mismatch: Primitive found where TemplateResult expected. This usually occurs due to conditional rendering that resulted in a different value or template being rendered between the server and client.");{const h=o.instance;for(;;){const l=h._$AD.parts[o.templatePartIndex];if(l===void 0||l.type!==w.ATTRIBUTE&&l.type!==w.ELEMENT||l.index!==e)break;if(l.type===w.ATTRIBUTE){const a=new l.ctor(n,l.name,l.strings,o.instance,i),d=lt(a)?o.result.values[o.instancePartIndex]:o.result.values,c=!(a.type===w.EVENT||a.type===w.PROPERTY);a._$AI(d,a,o.instancePartIndex,c),o.instancePartIndex+=l.strings.length-1,h._$AV.push(a)}else{const a=new ct(n,o.instance,i);X(a,o.result.values[o.instancePartIndex++]),h._$AV.push(a)}o.templatePartIndex++}}},At=s=>{const t=new Uint32Array(2).fill(5381);for(const r of s.strings)for(let e=0;e{const t=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(s),"observedAttributes").get;Object.defineProperty(s,"observedAttributes",{get(){return[...t.call(this),"defer-hydration"]}});const i=s.prototype.attributeChangedCallback;s.prototype.attributeChangedCallback=function(o,h,l){o==="defer-hydration"&&l===null&&r.call(this),i.call(this,o,h,l)};const r=s.prototype.connectedCallback;s.prototype.connectedCallback=function(){this.hasAttribute("defer-hydration")||r.call(this)};const e=s.prototype.createRenderRoot;s.prototype.createRenderRoot=function(){return this.shadowRoot?(this._$AG=!0,this.shadowRoot):e.call(this)};const n=Object.getPrototypeOf(s.prototype).update;s.prototype.update=function(o){const h=this.render();if(n.call(this,o),this._$AG){this._$AG=!1;for(let l=0;l{const e=r,n=e.getAttribute("shadowroot")||"open",o=e.parentNode.attachShadow({mode:n});o.appendChild(e.content),e.remove(),t(o)})}(document)}console.log("Global client scripts!");export{ft as c}; + */const{TemplateInstance:at,isIterable:ht,resolveDirective:X,ChildPart:E,ElementPart:ct}=it,dt=(s,t,i={})=>{if(t._$litPart$!==void 0)throw Error("container already contains a live render");let r,e,n;const o=[],h=document.createTreeWalker(t,NodeFilter.SHOW_COMMENT);let l;for(;(l=h.nextNode())!==null;){const a=l.data;if(a.startsWith("lit-part")){if(o.length===0&&r!==void 0)throw Error(`There must be only one root part per container. Found a part marker (${l}) when we already have a root part marker (${e})`);n=pt(s,l,o,i),r===void 0&&(r=n),e??=l}else if(a.startsWith("lit-node"))$t(l,o,i);else if(a.startsWith("/lit-part")){if(o.length===1&&n!==r)throw Error("internal error");n=ut(l,n,o)}}if(r===void 0){const a=t instanceof ShadowRoot?"{container.host.localName}'s shadow root":t instanceof DocumentFragment?"DocumentFragment":t.localName;console.error(`There should be exactly one root part in a render container, but we didn't find any in ${a}.`)}t._$litPart$=r},pt=(s,t,i,r)=>{let e,n;if(i.length===0)n=new E(t,null,void 0,r),e=s;else{const o=i[i.length-1];if(o.type==="template-instance")n=new E(t,null,o.instance,r),o.instance._$AV.push(n),e=o.result.values[o.instancePartIndex++],o.templatePartIndex++;else if(o.type==="iterable"){n=new E(t,null,o.part,r);const h=o.iterator.next();if(h.done)throw e=void 0,o.done=!0,Error("Unhandled shorter than expected iterable");e=h.value,o.part._$AH.push(n)}else n=new E(t,null,o.part,r)}if(e=X(n,e),e===y)i.push({part:n,type:"leaf"});else if(nt(e))i.push({part:n,type:"leaf"}),n._$AH=e;else if(st(e)){if(ot(e))throw Error("compiled templates are not supported");const o="lit-part "+At(e);if(t.data!==o)throw Error("Hydration value mismatch: Unexpected TemplateResult rendered to part");{const h=E.prototype._$AC(e),l=new at(h,n);i.push({type:"template-instance",instance:l,part:n,templatePartIndex:0,instancePartIndex:0,result:e}),n._$AH=l}}else ht(e)?(i.push({part:n,type:"iterable",value:e,iterator:e[Symbol.iterator](),done:!1}),n._$AH=[]):(i.push({part:n,type:"leaf"}),n._$AH=e??"");return n},ut=(s,t,i)=>{if(t===void 0)throw Error("unbalanced part marker");t._$AB=s;const r=i.pop();if(r.type==="iterable"&&!r.iterator.next().done)throw Error("unexpected longer than expected iterable");if(i.length>0)return i[i.length-1].part},$t=(s,t,i)=>{const r=/lit-node (\d+)/.exec(s.data),e=parseInt(r[1]),n=s.nextElementSibling;if(n===null)throw Error("could not find node for attribute parts");n.removeAttribute("defer-hydration");const o=t[t.length-1];if(o.type!=="template-instance")throw Error("Hydration value mismatch: Primitive found where TemplateResult expected. This usually occurs due to conditional rendering that resulted in a different value or template being rendered between the server and client.");{const h=o.instance;for(;;){const l=h._$AD.parts[o.templatePartIndex];if(l===void 0||l.type!==T.ATTRIBUTE&&l.type!==T.ELEMENT||l.index!==e)break;if(l.type===T.ATTRIBUTE){const a=new l.ctor(n,l.name,l.strings,o.instance,i),d=lt(a)?o.result.values[o.instancePartIndex]:o.result.values,c=!(a.type===T.EVENT||a.type===T.PROPERTY);a._$AI(d,a,o.instancePartIndex,c),o.instancePartIndex+=l.strings.length-1,h._$AV.push(a)}else{const a=new ct(n,o.instance,i);X(a,o.result.values[o.instancePartIndex++]),h._$AV.push(a)}o.templatePartIndex++}}},At=s=>{const t=new Uint32Array(2).fill(5381);for(const r of s.strings)for(let e=0;e{const t=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(s),"observedAttributes").get;Object.defineProperty(s,"observedAttributes",{get(){return[...t.call(this),"defer-hydration"]}});const i=s.prototype.attributeChangedCallback;s.prototype.attributeChangedCallback=function(o,h,l){o==="defer-hydration"&&l===null&&r.call(this),i.call(this,o,h,l)};const r=s.prototype.connectedCallback;s.prototype.connectedCallback=function(){this.hasAttribute("defer-hydration")||r.call(this)};const e=s.prototype.createRenderRoot;s.prototype.createRenderRoot=function(){return this.shadowRoot?(this._$AG=!0,this.shadowRoot):e.call(this)};const n=Object.getPrototypeOf(s.prototype).update;s.prototype.update=function(o){const h=this.render();if(n.call(this,o),this._$AG){this._$AG=!1;for(let l=0;l - - + diff --git a/integration/__fixtures__/server-express/dist_expected/server/entrypoint.js b/integration/__fixtures__/server-express/dist_expected/server/entrypoint.js index b8f6177..53d6331 100644 --- a/integration/__fixtures__/server-express/dist_expected/server/entrypoint.js +++ b/integration/__fixtures__/server-express/dist_expected/server/entrypoint.js @@ -140,11 +140,11 @@ const routeImports = new Map( const routeAssets = new Map([ [ "/404.html", - "\t\n\n\t\n\n\t\n" + "\t\n\n\t\n" ], [ "/about/", - "\t\n\n\t\n\n\t\n" + "\t\n\n\t\n" ], [ "/api/:path*/", @@ -156,23 +156,23 @@ const routeAssets = new Map([ ], [ "/assets-methods/", - "\t\n\n\t\n\n\t\n" + "\t\n\n\t\n" ], [ "/contact/", - "\t\n\n\t\n\n\t\n" + "\t\n\n\t\n" ], [ "/foo/bar/", - "\t\n\n\t\n\n\t\n" + "\t\n\n\t\n\n\t\n" ], [ "/", - "\t\n\n\t\n\n\t\n\n\t\n" + "\t\n\n\t\n\n\t\n\n\t\n" ], [ "/private/", - "\t\n\n\t\n\n\t\n" + "\t\n\n\t\n" ], [ "/redirect/", @@ -180,11 +180,11 @@ const routeAssets = new Map([ ], [ "/response-init/", - "\t\n\n\t\n\n\t\n" + "\t\n\n\t\n" ], [ "/throws/", - "\t\n\n\t\n\n\t\n" + "\t\n\n\t\n" ] ]); diff --git a/integration/__fixtures__/server-express/src/routes/_404_dev_expected._html b/integration/__fixtures__/server-express/src/routes/_404_dev_expected._html index 871376c..ce2fe6f 100644 --- a/integration/__fixtures__/server-express/src/routes/_404_dev_expected._html +++ b/integration/__fixtures__/server-express/src/routes/_404_dev_expected._html @@ -19,11 +19,6 @@ - - - - - + src="/assets/document.client-CMOVr55R.js" + > diff --git a/integration/__fixtures__/server-express/src/routes/_assets-methods_dev_expected._html b/integration/__fixtures__/server-express/src/routes/_assets-methods_dev_expected._html index 3252837..c5c7079 100644 --- a/integration/__fixtures__/server-express/src/routes/_assets-methods_dev_expected._html +++ b/integration/__fixtures__/server-express/src/routes/_assets-methods_dev_expected._html @@ -19,11 +19,6 @@ - - - - + src="/assets/document.client-CMOVr55R.js" + > diff --git a/integration/__fixtures__/server-express/src/routes/_contact_dev_expected._html b/integration/__fixtures__/server-express/src/routes/_contact_dev_expected._html index 3d1bdd5..5e64fc4 100644 --- a/integration/__fixtures__/server-express/src/routes/_contact_dev_expected._html +++ b/integration/__fixtures__/server-express/src/routes/_contact_dev_expected._html @@ -19,11 +19,6 @@ - - - + src="/assets/document.client-CMOVr55R.js" + > diff --git a/integration/__fixtures__/server-express/src/routes/_home_dev_expected._html b/integration/__fixtures__/server-express/src/routes/_home_dev_expected._html index a1c43bd..c17790a 100644 --- a/integration/__fixtures__/server-express/src/routes/_home_dev_expected._html +++ b/integration/__fixtures__/server-express/src/routes/_home_dev_expected._html @@ -19,11 +19,6 @@ - - + diff --git a/integration/__fixtures__/static-site/dist_expected/04-polyfills/00-polyfills/index.html b/integration/__fixtures__/static-site/dist_expected/04-polyfills/00-polyfills/index.html index 489ee0b..a1227e2 100644 --- a/integration/__fixtures__/static-site/dist_expected/04-polyfills/00-polyfills/index.html +++ b/integration/__fixtures__/static-site/dist_expected/04-polyfills/00-polyfills/index.html @@ -5,9 +5,6 @@ Document - With polyfills - - - @@ -45,7 +42,7 @@ - + diff --git a/integration/__fixtures__/static-site/dist_expected/assets/index-B-fhizYj.js b/integration/__fixtures__/static-site/dist_expected/assets/index-B-fhizYj.js new file mode 100644 index 0000000..677c6cb --- /dev/null +++ b/integration/__fixtures__/static-site/dist_expected/assets/index-B-fhizYj.js @@ -0,0 +1 @@ +import"./modulepreload-polyfill-B5Qt9EMX.js";requestIdleCallback(()=>{console.log("REQUEST IDLE CALLBACK PLEASE!")}); diff --git a/integration/__fixtures__/static-site/dist_expected/assets/index-d4VDqEN4.js b/integration/__fixtures__/static-site/dist_expected/assets/index-d4VDqEN4.js deleted file mode 100644 index bd46a39..0000000 --- a/integration/__fixtures__/static-site/dist_expected/assets/index-d4VDqEN4.js +++ /dev/null @@ -1 +0,0 @@ -import"./modulepreload-polyfill-B5Qt9EMX.js";function d(){function e(){return HTMLTemplateElement.prototype.hasOwnProperty("shadowRoot")}e()||function a(n){n.querySelectorAll("template[shadowroot]").forEach(c=>{const o=c,r=o.getAttribute("shadowroot")||"open",t=o.parentNode.attachShadow({mode:r});t.appendChild(o.content),o.remove(),a(t)})}(document)}d();requestIdleCallback(()=>{console.log("REQUEST IDLE CALLBACK PLEASE!")}); diff --git a/integration/__fixtures__/static-site/src/routes/04-polyfills/_00-polyfills_expected.html b/integration/__fixtures__/static-site/src/routes/04-polyfills/_00-polyfills_expected.html index d90880c..db1e80f 100644 --- a/integration/__fixtures__/static-site/src/routes/04-polyfills/_00-polyfills_expected.html +++ b/integration/__fixtures__/static-site/src/routes/04-polyfills/_00-polyfills_expected.html @@ -6,13 +6,6 @@ Document - With polyfills - - - - - `, - requestIdleCallback: html` ${unsafeHTML(`