@qwik.dev/core 2.0.0-beta.4 → 2.0.0-beta.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. package/dist/backpatch/index.d.ts +2 -0
  2. package/dist/backpatch/index.mjs +5 -0
  3. package/dist/backpatch/package.json +8 -0
  4. package/dist/backpatch-executor.debug.js +59 -0
  5. package/dist/backpatch-executor.js +1 -0
  6. package/dist/build/package.json +1 -1
  7. package/dist/cli.mjs +12974 -0
  8. package/dist/core-internal.d.ts +1579 -818
  9. package/dist/core.min.mjs +9 -1
  10. package/dist/core.mjs +14777 -9194
  11. package/dist/core.mjs.map +1 -1
  12. package/dist/core.prod.mjs +10480 -5372
  13. package/dist/insights/index.qwik.mjs +82 -71
  14. package/dist/insights/vite/index.mjs +79 -81
  15. package/dist/loader/index.mjs +2 -2
  16. package/dist/loader/package.json +1 -1
  17. package/dist/optimizer.d.ts +78 -295
  18. package/dist/optimizer.mjs +2948 -4088
  19. package/dist/out-of-order-executor.debug.js +140 -0
  20. package/dist/out-of-order-executor.js +1 -0
  21. package/dist/preloader.mjs +172 -192
  22. package/dist/qwikloader.debug.js +403 -244
  23. package/dist/qwikloader.js +1 -1
  24. package/dist/server-modules.d.ts +1 -0
  25. package/dist/server.d.ts +54 -249
  26. package/dist/server.mjs +2332 -1407
  27. package/dist/server.prod.mjs +3844 -0
  28. package/dist/starters/adapters/aws-lambda/adapters/aws-lambda/{vite.config.mts → vite.config.ts} +3 -3
  29. package/dist/starters/adapters/aws-lambda/package.json +3 -2
  30. package/dist/starters/adapters/aws-lambda/src/entry_aws-lambda.tsx +2 -6
  31. package/dist/starters/adapters/azure-swa/adapters/azure-swa/{vite.config.mts → vite.config.ts} +3 -3
  32. package/dist/starters/adapters/azure-swa/package.json +3 -2
  33. package/dist/starters/adapters/azure-swa/src/entry.azure-swa.tsx +2 -3
  34. package/dist/starters/adapters/bun/adapters/bun/{vite.config.mts → vite.config.ts} +4 -4
  35. package/dist/starters/adapters/bun/package.json +3 -2
  36. package/dist/starters/adapters/bun/src/entry.bun.ts +37 -10
  37. package/dist/starters/adapters/cloud-run/adapters/cloud-run/{vite.config.mts → vite.config.ts} +3 -3
  38. package/dist/starters/adapters/cloud-run/package.json +3 -2
  39. package/dist/starters/adapters/cloud-run/src/entry.cloud-run.tsx +23 -7
  40. package/dist/starters/adapters/cloudflare-pages/adapters/cloudflare-pages/{vite.config.mts → vite.config.ts} +3 -3
  41. package/dist/starters/adapters/cloudflare-pages/package.json +3 -2
  42. package/dist/starters/adapters/cloudflare-pages/src/entry.cloudflare-pages.tsx +2 -3
  43. package/dist/starters/adapters/cloudflare-workers/README.md +52 -0
  44. package/dist/starters/adapters/cloudflare-workers/adapters/cloudflare-workers/vite.config.ts +15 -0
  45. package/dist/starters/adapters/cloudflare-workers/gitignore +3 -0
  46. package/dist/starters/adapters/cloudflare-workers/package.json +31 -0
  47. package/dist/starters/adapters/cloudflare-workers/public/.assetsignore +4 -0
  48. package/dist/starters/adapters/cloudflare-workers/public/_headers +11 -0
  49. package/dist/starters/adapters/cloudflare-workers/public/_redirects +1 -0
  50. package/dist/starters/adapters/cloudflare-workers/src/entry.cloudflare-pages.tsx +22 -0
  51. package/dist/starters/adapters/cloudflare-workers/worker-configuration.d.ts +5 -0
  52. package/dist/starters/adapters/cloudflare-workers/wrangler.jsonc +41 -0
  53. package/dist/starters/adapters/deno/adapters/deno/{vite.config.mts → vite.config.ts} +3 -3
  54. package/dist/starters/adapters/deno/package.json +3 -2
  55. package/dist/starters/adapters/deno/src/entry.deno.ts +43 -10
  56. package/dist/starters/adapters/express/adapters/express/{vite.config.mts → vite.config.ts} +3 -3
  57. package/dist/starters/adapters/express/package.json +4 -3
  58. package/dist/starters/adapters/express/src/entry.express.tsx +22 -7
  59. package/dist/starters/adapters/fastify/adapters/fastify/{vite.config.mts → vite.config.ts} +3 -3
  60. package/dist/starters/adapters/fastify/package.json +5 -4
  61. package/dist/starters/adapters/fastify/src/entry.fastify.tsx +21 -1
  62. package/dist/starters/adapters/fastify/src/plugins/fastify-qwik.ts +11 -4
  63. package/dist/starters/adapters/firebase/adapters/firebase/{vite.config.mts → vite.config.ts} +3 -3
  64. package/dist/starters/adapters/firebase/package.json +3 -2
  65. package/dist/starters/adapters/firebase/src/entry-firebase.tsx +2 -3
  66. package/dist/starters/adapters/netlify-edge/adapters/netlify-edge/{vite.config.mts → vite.config.ts} +3 -3
  67. package/dist/starters/adapters/netlify-edge/package.json +5 -4
  68. package/dist/starters/adapters/netlify-edge/src/entry.netlify-edge.tsx +2 -3
  69. package/dist/starters/adapters/node-server/adapters/node-server/{vite.config.mts → vite.config.ts} +3 -3
  70. package/dist/starters/adapters/node-server/package.json +3 -2
  71. package/dist/starters/adapters/node-server/src/entry.node-server.tsx +22 -6
  72. package/dist/starters/adapters/{static/adapters/static/vite.config.mts → ssg/adapters/ssg/vite.config.ts} +4 -4
  73. package/dist/starters/adapters/ssg/package.json +20 -0
  74. package/dist/starters/adapters/vercel-edge/README.md +2 -2
  75. package/dist/starters/adapters/vercel-edge/adapters/vercel-edge/{vite.config.mts → vite.config.ts} +3 -3
  76. package/dist/starters/adapters/vercel-edge/package.json +3 -2
  77. package/dist/starters/adapters/vercel-edge/src/entry.vercel-edge.tsx +2 -3
  78. package/dist/starters/adapters/vercel-edge/vercel.json +1 -1
  79. package/dist/starters/features/auth/package.json +1 -1
  80. package/dist/starters/features/compiled-i18n/package.json +37 -0
  81. package/dist/starters/features/compiled-i18n/src/components/locale-selector/locale-selector.tsx +30 -0
  82. package/dist/starters/features/compiled-i18n/src/entry.ssr.tsx +31 -0
  83. package/dist/starters/features/compiled-i18n/src/routes/plugin@compiled-i18n.ts +28 -0
  84. package/dist/starters/features/csr/index.html +27 -0
  85. package/dist/starters/features/csr/package.json +29 -0
  86. package/dist/starters/features/csr/src/root.tsx +15 -0
  87. package/dist/starters/features/csr/vite.config.ts +13 -0
  88. package/dist/starters/features/cypress/src/actions/example.action.ts +5 -0
  89. package/dist/starters/features/cypress/src/components/example/example.cy.tsx +50 -8
  90. package/dist/starters/features/cypress/src/components/example/example.tsx +13 -3
  91. package/dist/starters/features/cypress/src/loaders/example.loader.ts +5 -0
  92. package/dist/starters/features/drizzle/package.json +1 -1
  93. package/dist/starters/features/pandacss/package.json +1 -1
  94. package/dist/starters/features/postcss/postcss.config.js +1 -1
  95. package/dist/starters/features/storybook/.storybook/tsconfig.json +0 -1
  96. package/dist/starters/features/styled-vanilla-extract/package.json +2 -1
  97. package/dist/starters/features/tailwind/package.json +2 -2
  98. package/dist/starters/features/tailwind/prettier.config.js +10 -0
  99. package/dist/starters/features/tailwind-v3/package.json +1 -1
  100. package/dist/starters/features/tailwind-v3/prettier.config.js +10 -0
  101. package/dist/starters/features/vitest/package.json +1 -1
  102. package/dist/testing/index.d.ts +1000 -7
  103. package/dist/testing/index.mjs +16487 -11656
  104. package/dist/testing/package.json +1 -1
  105. package/dist/worker/index.d.mts +21 -0
  106. package/dist/worker/index.mjs +251 -0
  107. package/dist/worker/package.json +9 -0
  108. package/dist/worker/worker.js +13 -0
  109. package/dist/worker/worker.node.js +15 -0
  110. package/dist/worker/worker.shared.js +63 -0
  111. package/handlers.mjs +21 -1
  112. package/package.json +40 -56
  113. package/public.d.ts +12 -2
  114. package/{qwik-cli.cjs → qwik-cli.mjs} +1 -1
  115. package/server.d.ts +2 -0
  116. package/worker.d.ts +2 -0
  117. package/bindings/qwik.darwin-arm64.node +0 -0
  118. package/bindings/qwik.darwin-x64.node +0 -0
  119. package/bindings/qwik.linux-x64-gnu.node +0 -0
  120. package/bindings/qwik.wasm.cjs +0 -471
  121. package/bindings/qwik.wasm.mjs +0 -464
  122. package/bindings/qwik.win32-x64-msvc.node +0 -0
  123. package/bindings/qwik_wasm_bg.wasm +0 -0
  124. package/dist/build/index.cjs +0 -35
  125. package/dist/build/index.cjs.map +0 -7
  126. package/dist/build/index.dev.cjs +0 -37
  127. package/dist/build/index.dev.cjs.map +0 -7
  128. package/dist/build/index.prod.cjs +0 -37
  129. package/dist/build/index.prod.cjs.map +0 -7
  130. package/dist/cli.cjs +0 -5545
  131. package/dist/core.cjs +0 -11870
  132. package/dist/core.cjs.map +0 -1
  133. package/dist/core.prod.cjs +0 -5723
  134. package/dist/insights/index.qwik.cjs +0 -1
  135. package/dist/insights/vite/index.cjs +0 -1
  136. package/dist/loader/index.cjs +0 -4
  137. package/dist/optimizer.cjs +0 -4020
  138. package/dist/preloader.cjs +0 -269
  139. package/dist/server.cjs +0 -3040
  140. package/dist/starters/adapters/static/package.json +0 -19
  141. package/dist/starters/features/localize/package.json +0 -37
  142. package/dist/starters/features/localize/src/entry.ssr.tsx +0 -30
  143. package/dist/starters/features/localize/src/locales/message.en.json +0 -8
  144. package/dist/starters/features/localize/src/locales/message.it.json +0 -8
  145. package/dist/starters/features/localize/src/routes/[locale]/i18n-utils.ts +0 -94
  146. package/dist/starters/features/localize/src/routes/[locale]/index.tsx +0 -52
  147. package/dist/starters/features/localize/src/routes/[locale]/layout.tsx +0 -12
  148. package/dist/starters/features/playwright/playwright-report/index.html +0 -22026
  149. package/dist/starters/features/tailwind/.prettierrc.js +0 -3
  150. package/dist/testing/index.cjs +0 -33388
  151. /package/dist/starters/adapters/{static → ssg}/README.md +0 -0
@@ -1 +1 @@
1
- const t=document,e=window,n=new Set,o=new Set([t]);let r;const s=(t,e)=>Array.from(t.querySelectorAll(e)),i=t=>{const e=[];return o.forEach(n=>e.push(...s(n,t))),e},a=t=>{v(t),s(t,"[q\\:shadowroot]").forEach(t=>{const e=t.shadowRoot;e&&a(e)})},c=t=>t&&"function"==typeof t.then;let l=!0;const f=(t,e,n=e.type)=>{let o=l;i("[on"+t+"\\:"+n+"]").forEach(r=>{o=!0,b(r,t,e,n)}),o||window[t.slice(1)].removeEventListener(n,"-window"===t?d:_)},p=e=>{if(void 0===e._qwikjson_){let n=(e===t.documentElement?t.body:e).lastElementChild;for(;n;){if("SCRIPT"===n.tagName&&"qwik/json"===n.getAttribute("type")){e._qwikjson_=JSON.parse(n.textContent.replace(/\\x3C(\/?script)/gi,"<$1"));break}n=n.previousElementSibling}}},u=(t,e)=>new CustomEvent(t,{detail:e}),b=async(e,n,o,r=o.type)=>{const s="on"+n+":"+r;e.hasAttribute("preventdefault:"+r)&&o.preventDefault(),e.hasAttribute("stoppropagation:"+r)&&o.stopPropagation();const i=e._qc_,a=i&&i.li.filter(t=>t[0]===s);if(a&&a.length>0){for(const t of a){const n=t[1].getFn([e,o],()=>e.isConnected)(o,e),r=o.cancelBubble;c(n)&&await n,r&&o.stopPropagation()}return}const l=e.getAttribute(s),f=e.qDispatchEvent;if(f)return f(o,n);if(l){const n=e.closest("[q\\:container]:not([q\\:container=html]):not([q\\:container=text])"),r=n.getAttribute("q:base"),s=n.getAttribute("q:version")||"unknown",i=n.getAttribute("q:manifest-hash")||"dev",a=new URL(r,t.baseURI);for(const f of l.split("\n")){const l=new URL(f,a),u=l.href,b=l.hash.replace(/^#?([^?[|]*).*$/,"$1")||"default",h=performance.now();let _,d,w;const m=f.startsWith("#"),y={qBase:r,qManifest:i,qVersion:s,href:u,symbol:b,element:e,reqTime:h};if(m){const e=n.getAttribute("q:instance");_=(t["qFuncs_"+e]||[])[Number.parseInt(b)],_||(d="sync",w=Error("sym:"+b))}else{q("qsymbol",y);const t=l.href.split("#")[0];try{const e=import(t);p(n),_=(await e)[b],_||(d="no-symbol",w=Error(`${b} not in ${t}`))}catch(t){d||(d="async"),w=t}}if(!_){q("qerror",{importError:d,error:w,...y}),console.error(w);break}const v=t.__q_context__;if(e.isConnected)try{t.__q_context__=[e,o,l];const n=_(o,e);c(n)&&await n}catch(t){q("qerror",{error:t,...y})}finally{t.__q_context__=v}}}},q=(e,n)=>{t.dispatchEvent(u(e,n))},h=t=>t.replace(/([A-Z])/g,t=>"-"+t.toLowerCase()),_=async t=>{let e=h(t.type),n=t.target;for(f("-document",t,e);n&&n.getAttribute;){const o=b(n,"",t,e);let r=t.cancelBubble;c(o)&&await o,r||(r=r||t.cancelBubble||n.hasAttribute("stoppropagation:"+t.type)),n=t.bubbles&&!0!==r?n.parentElement:null}},d=t=>{f("-window",t,h(t.type))},w=()=>{var s;const c=t.readyState;if(!r&&("interactive"==c||"complete"==c)&&(o.forEach(a),r=1,q("qinit"),(null!=(s=e.requestIdleCallback)?s:e.setTimeout).bind(e)(()=>q("qidle")),n.has("qvisible"))){const t=i("[on\\:qvisible]"),e=new IntersectionObserver(t=>{for(const n of t)n.isIntersecting&&(e.unobserve(n.target),b(n.target,"",u("qvisible",n)))});t.forEach(t=>e.observe(t))}},m=(t,e,n,o=!1)=>{t.addEventListener(e,n,{capture:o,passive:!1})};let y;const v=(...t)=>{l=!0,clearTimeout(y),y=setTimeout(()=>l=!1,2e4);for(const r of t)"string"==typeof r?n.has(r)||(o.forEach(t=>m(t,r,_,!0)),m(e,r,d,!0),n.add(r)):o.has(r)||(n.forEach(t=>m(r,t,_,!0)),o.add(r))};if(!("__q_context__"in t)){t.__q_context__=0;const r=e.qwikevents;r&&(Array.isArray(r)?v(...r):v("click","input")),e.qwikevents={events:n,roots:o,push:v},m(t,"readystatechange",w),w()}
1
+ var e,t,n,r=document,o=window,s="w",i="wp",a="d",c="dp",l="e",p="ep",u="capture:",d="readystatechange",f=0,h=new Set,q=new Set([r]),b=new Map,g={},m=(e,t)=>Array.from(e.querySelectorAll(t)),v=e=>{const t=[];return q.forEach(n=>t.push(...m(n,e))),t},w=(e,t,n,r=!1,o=!1)=>e.addEventListener(t,n,{capture:r,passive:o}),y=e=>{H(e);const t=m(e,"[q\\:shadowroot]");for(let e=0;e<t.length;e++){const n=t[e].shadowRoot;n&&y(n)}},A=e=>e&&"function"==typeof e.then,E=async e=>{for(let t=0;t<e.length;t++)await e[t]()},S=e=>{if(e.length){const t=()=>E(e);n=n?n.then(t,t):t()}},C=e=>{if(void 0===e._qwikjson_){let t=(e===r.documentElement?r.body:e).lastElementChild;for(;t;){if("SCRIPT"===t.tagName&&"qwik/json"===t.getAttribute("type")){e._qwikjson_=JSON.parse(t.textContent.replace(/\\x3C(\/?script)/gi,"<$1"));break}t=t.previousElementSibling}}},_=e=>{g[e]=1,I(d)},k=e=>{const t=e.getAttribute("q:instance");return"paused"===e.getAttribute("q:container")&&"loading"===r.readyState&&!g[t]&&new Promise(e=>{w(r,d,()=>{("loading"!==r.readyState||g[t])&&e()})})},$=(e,t)=>new CustomEvent(e,{detail:t}),I=(e,t)=>{r.dispatchEvent($(e,t))},N=e=>e.replace(/([A-Z-])/g,e=>"-"+e.toLowerCase()),R=e=>e.replace(/-./g,e=>e[1].toUpperCase()),T=e=>{const t=e.indexOf(":");return{scope:e.slice(0,t),eventName:R(e.slice(t+1))}},x=e=>2===e.length,B=e=>e.charAt(0),L=e=>!!e&&1===e.nodeType,U=(e,t,n)=>e.hasAttribute(n)&&(!!e._qDispatch?.[t]||e.hasAttribute("q-"+t)),j=(e,t,n,o,s,i,a,c=!0)=>{const l={qBase:n,symbol:i,element:t,reqTime:a};if(!s){const t=(r["qFuncs_"+e.getAttribute("q:instance")]||[])[+i];if(!t&&c){const e=Error("sym:"+i);I("qerror",{importError:"sync",error:e,...l}),console.error(e)}return t}const p=`${i}|${n}|${s}`,u=b.get(p);if(u)return u;const d=new URL(s,o).href,f=import(d);return C(e),f.then(e=>{const t=e[i];if(t)b.set(p,t),I("qsymbol",l);else{const e=Error(`${i} not in ${d}`);I("qerror",{importError:"no-symbol",error:e,...l}),console.error(e)}return t},e=>{I("qerror",{importError:"async",error:e,...l}),console.error(e)})},D=(e,t,n,o,s,i=!0)=>{let a=!1;s&&(i&&e.hasAttribute("preventdefault:"+s)&&t.preventDefault(),e.hasAttribute("stoppropagation:"+s)&&t.stopPropagation());const c=e._qDispatch?.[n];if(c){if("function"==typeof c){const n=()=>c(t,e);if(a)o.push(async()=>{const e=n();A(e)&&await e});else{const e=n();A(e)&&(a=!0,o.push(()=>e))}}else if(c.length)for(let n=0;n<c.length;n++){const r=c[n];if(r){const n=()=>r(t,e);if(a)o.push(async()=>{const e=n();A(e)&&await e});else{const e=n();A(e)&&(a=!0,o.push(()=>e))}}}return}const l=e.getAttribute("q-"+n);if(l){const n=e.closest("[q\\:container]:not([q\\:container=html]):not([q\\:container=text])"),s=n.getAttribute("q:base"),i=new URL(s,r.baseURI),c=l.split("|"),p=k(n);for(let r=0;r<c.length;r++){const l=c[r],u=performance.now(),[d,f,h]=l.split("#"),q=n=>{if(n&&e.isConnected){const r=t=>{I("qerror",{error:t,qBase:s,symbol:f,element:e,reqTime:u})};try{const o=n.call(h,t,e);if(A(o))return o.catch(r)}catch(e){return r(e)}}},b=(t=!0)=>j(n,e,s,i,d,f,u,t),g=p?void 0:b();if(p)a=!0,o.push(async()=>{await p,await q(await b(!1)||await b())});else if(A(g))a=!0,o.push(()=>g.then(q));else if(a)a=!0,o.push(async()=>{await q(g||await b())});else{const e=q(g);A(e)&&(a=!0,o.push(()=>e))}}}},O=(e,t=l,n=!0)=>{const r=N(e.type),o=t+":"+r,s=u+r,i=[],a=[],c=[];let p=e.target;for(;p;)L(p)?(i.push(p),a.push(U(p,o,s)),p=p.parentElement):p=p.parentElement;for(let t=i.length-1;t>=0;t--)if(a[t]&&(D(i[t],e,o,c,r,n),e.cancelBubble))return void S(c);for(let t=0;t<i.length;t++)if(!a[t]&&(D(i[t],e,o,c,r,n),!e.bubbles||e.cancelBubble))return void S(c);S(c)},P=e=>O(e,p,!1),F=(e,t,n=!0)=>{const r=N(t.type),o=e+":"+r,s=v("[q-"+CSS.escape(o)+"]"),i=[];for(let e=0;e<s.length;e++){const a=s[e];D(a,t,o,i,r,n)}S(i)},J=e=>{F(a,e)},M=e=>{F(c,e,!1)},Z=e=>{F(s,e)},z=e=>{F(i,e,!1)},G=()=>{const n=r.readyState;if("interactive"==n||"complete"==n){if(t=1,q.forEach(y),h.has("d:qinit")){h.delete("d:qinit");const e=$("qinit"),t=v("[q-d\\:qinit]"),n=[];for(let r=0;r<t.length;r++){const o=t[r];D(o,e,"d:qinit",n),o.removeAttribute("q-d:qinit")}S(n)}if(h.has("d:qidle")&&(h.delete("d:qidle"),(o.requestIdleCallback??o.setTimeout).bind(o)(()=>{const e=$("qidle"),t=v("[q-d\\:qidle]"),n=[];for(let r=0;r<t.length;r++){const o=t[r];D(o,e,"d:qidle",n),o.removeAttribute("q-d:qidle")}S(n)})),h.has("e:qvisible")){e||(e=new IntersectionObserver(t=>{const n=[];for(let r=0;r<t.length;r++){const o=t[r];o.isIntersecting&&(e.unobserve(o.target),D(o.target,$("qvisible",o),"e:qvisible",n))}S(n)}));const t=v("[q-e\\:qvisible]:not([q\\:observed])");for(let n=0;n<t.length;n++){const r=t[n];e.observe(r),r.setAttribute("q:observed","true")}}}},H=(...e)=>{for(let n=0;n<e.length;n++){const r=e[n];if(r===f)_(e[++n]);else if("string"==typeof r){if(!h.has(r)){h.add(r);const{scope:e,eventName:n}=T(r),i=x(e),c=B(e);c===s?w(o,n,i?z:Z,!0,i):q.forEach(e=>w(e,n,c===a?i?M:J:i?P:O,!0,i)),1!==t||"e:qvisible"!==r&&"d:qinit"!==r&&"d:qidle"!==r||G()}}else q.has(r)||(h.forEach(e=>{const{scope:t,eventName:n}=T(e),o=x(t),i=B(t);i!==s&&w(r,n,i===a?o?M:J:o?P:O,!0,o)}),q.add(r))}},K=o._qwikEv;K?.roots||(Array.isArray(K)?H(...K):H("e:click","e:input"),o._qwikEv={events:h,roots:q,push:H},w(r,d,G),G());
@@ -1,5 +1,6 @@
1
1
  /// <reference types="./server" />
2
2
  declare module '@qwik-client-manifest' {
3
+ /** @deprecated Use `getClientManifest()` instead */
3
4
  const manifest: import('./optimizer').QwikManifest;
4
5
  export { manifest };
5
6
  }
package/dist/server.d.ts CHANGED
@@ -1,18 +1,12 @@
1
1
  /// <reference path="./server-modules.d.ts" />
2
2
 
3
3
  import type { QwikManifest } from './optimizer';
4
- import type { ResolvedManifest } from './optimizer';
4
+ import { ResolvedManifest } from './optimizer';
5
5
  import type { ServerQwikManifest } from './optimizer';
6
6
  import type { SnapshotResult } from '.';
7
- import type { StreamWriter } from '.';
7
+ import type { StreamWriter } from './internal';
8
8
  import type { SymbolMapperFn } from './optimizer';
9
9
 
10
- /** @public */
11
- declare interface ComponentEntryStrategy {
12
- type: 'component';
13
- manual?: Record<string, string>;
14
- }
15
-
16
10
  /** @public */
17
11
  declare interface DevJSX {
18
12
  fileName: string;
@@ -21,9 +15,6 @@ declare interface DevJSX {
21
15
  stack?: string;
22
16
  }
23
17
 
24
- /** @public */
25
- declare type EntryStrategy = InlineEntryStrategy | HoistEntryStrategy | SingleEntryStrategy | HookEntryStrategy | SegmentEntryStrategy | ComponentEntryStrategy | SmartEntryStrategy;
26
-
27
18
  /**
28
19
  * Any function taking a props object that returns JSXOutput.
29
20
  *
@@ -35,6 +26,15 @@ declare type FunctionComponent<P = unknown> = {
35
26
  renderFn(props: P, key: string | null, flags: number, dev?: DevJSX): JSXOutput;
36
27
  }['renderFn'];
37
28
 
29
+ /**
30
+ * Provides the `backpatch-executor.js` executor script as a string.
31
+ *
32
+ * @public
33
+ */
34
+ export declare function getQwikBackpatchExecutorScript(opts?: {
35
+ debug?: boolean;
36
+ }): string;
37
+
38
38
  /**
39
39
  * Provides the `qwikloader.js` file as a string. Useful for tooling to inline the qwikloader script
40
40
  * into HTML.
@@ -55,31 +55,6 @@ export declare function getQwikPrefetchWorkerScript(opts?: {
55
55
  debug?: boolean;
56
56
  }): string;
57
57
 
58
- /** @public */
59
- declare interface GlobalInjections {
60
- tag: string;
61
- attributes?: {
62
- [key: string]: string;
63
- };
64
- location: 'head' | 'body';
65
- }
66
-
67
- /** @public */
68
- declare interface HoistEntryStrategy {
69
- type: 'hoist';
70
- }
71
-
72
- /** @deprecated Use SegmentStrategy instead */
73
- declare interface HookEntryStrategy {
74
- type: 'hook';
75
- manual?: Record<string, string>;
76
- }
77
-
78
- /** @public */
79
- declare interface InlineEntryStrategy {
80
- type: 'inline';
81
- }
82
-
83
58
  /** @public */
84
59
  export declare interface InOrderAuto {
85
60
  strategy: 'auto';
@@ -123,19 +98,8 @@ declare interface JSXNode<T extends string | FunctionComponent | unknown = unkno
123
98
  */
124
99
  declare type JSXOutput = JSXNode | string | number | boolean | null | undefined | JSXOutput[];
125
100
 
126
- /** @public @deprecated Use `preloader` instead */
127
- export declare interface PrefetchImplementation {
128
- /** @deprecated No longer used. */
129
- linkRel?: 'prefetch' | 'preload' | 'modulepreload' | null;
130
- /** @deprecated No longer used. */
131
- linkFetchPriority?: 'auto' | 'low' | 'high' | null;
132
- /** @deprecated No longer used. */
133
- linkInsert?: 'js-append' | 'html-append' | null;
134
- /** @deprecated No longer used. */
135
- workerFetchInsert?: 'always' | 'no-link-support' | null;
136
- /** @deprecated No longer used. */
137
- prefetchEvent?: 'always' | null;
138
- }
101
+ /** @public */
102
+ export declare type OutOfOrderStreaming = boolean;
139
103
 
140
104
  /** @public */
141
105
  export declare interface PrefetchResource {
@@ -143,12 +107,6 @@ export declare interface PrefetchResource {
143
107
  imports: PrefetchResource[];
144
108
  }
145
109
 
146
- /** @public */
147
- export declare interface PrefetchStrategy {
148
- implementation?: PrefetchImplementation;
149
- symbolsToPrefetch?: SymbolsToPrefetch;
150
- }
151
-
152
110
  /** @public */
153
111
  export declare interface PreloaderOptions {
154
112
  /**
@@ -162,18 +120,6 @@ export declare interface PreloaderOptions {
162
120
  * Defaults to `5`
163
121
  */
164
122
  ssrPreloads?: number;
165
- /**
166
- * The minimum probability for a bundle to be added as a preload link during SSR.
167
- *
168
- * Defaults to `0.7` (70% probability)
169
- */
170
- ssrPreloadProbability?: number;
171
- /**
172
- * Log preloader debug information to the console.
173
- *
174
- * Defaults to `false`
175
- */
176
- debug?: boolean;
177
123
  /**
178
124
  * Maximum number of simultaneous preload links that the preloader will maintain. If you set this
179
125
  * higher, the browser will have all JS files in memory sooner, but it will contend with other
@@ -186,141 +132,15 @@ export declare interface PreloaderOptions {
186
132
  * Defaults to `25`
187
133
  */
188
134
  maxIdlePreloads?: number;
189
- /**
190
- * The minimum probability for a bundle to be added to the preload queue.
191
- *
192
- * Defaults to `0.35` (35% probability)
193
- */
194
- preloadProbability?: number;
195
135
  }
196
136
 
197
137
  /** @public */
198
- declare interface QwikAsset {
199
- /** Name of the asset */
200
- name: string | undefined;
201
- /** Size of the asset */
202
- size: number;
203
- }
204
-
205
- /** @public */
206
- declare interface QwikBundle {
207
- /** Size of the bundle */
208
- size: number;
209
- /** Total size of this bundle's static import graph */
210
- total: number;
211
- /** Interactivity score of the bundle */
212
- interactivity?: number;
213
- /** Symbols in the bundle */
214
- symbols?: string[];
215
- /** Direct imports */
216
- imports?: string[];
217
- /** Dynamic imports */
218
- dynamicImports?: string[];
219
- /** Source files of the bundle */
220
- origins?: string[];
221
- }
222
-
223
- /**
224
- * Bundle graph.
225
- *
226
- * Format: [ 'bundle-a.js', 3, 5 // Depends on 'bundle-b.js' and 'bundle-c.js' 'bundle-b.js', 5, //
227
- * Depends on 'bundle-c.js' 'bundle-c.js', ]
228
- *
229
- * @public
230
- */
231
- declare type QwikBundleGraph = Array<string | number>;
232
-
233
- /** @public */
234
- export declare interface QwikLoaderOptions {
235
- /**
236
- * Whether to include the qwikloader script in the document. Normally you don't need to worry
237
- * about this, but in case of multi-container apps using different Qwik versions, you might want
238
- * to only enable it on one of the containers.
239
- *
240
- * Defaults to `'auto'`.
241
- */
138
+ export declare type QwikLoaderOptions = 'module' | 'inline' | 'never' | {
139
+ /** @deprecated No longer used. */
242
140
  include?: 'always' | 'never' | 'auto';
243
- /** @deprecated No longer used, the qwikloader is always loaded as soon as possible */
141
+ /** @deprecated No longer used. */
244
142
  position?: 'top' | 'bottom';
245
- }
246
-
247
- /**
248
- * The metadata of the build. One of its uses is storing where QRL symbols are located.
249
- *
250
- * @public
251
- */
252
- declare interface QwikManifest_2 {
253
- /** Content hash of the manifest, if this changes, the code changed */
254
- manifestHash: string;
255
- /** QRL symbols */
256
- symbols: {
257
- [symbolName: string]: QwikSymbol;
258
- };
259
- /** Where QRLs are located. The key is the symbol name, the value is the bundle fileName */
260
- mapping: {
261
- [symbolName: string]: string;
262
- };
263
- /**
264
- * All code bundles, used to know the import graph. The key is the bundle fileName relative to
265
- * "build/"
266
- */
267
- bundles: {
268
- [fileName: string]: QwikBundle;
269
- };
270
- /** All assets. The key is the fileName relative to the rootDir */
271
- assets?: {
272
- [fileName: string]: QwikAsset;
273
- };
274
- /** All bundles in a compact graph format with probabilities */
275
- bundleGraph?: QwikBundleGraph;
276
- /** The bundle graph fileName */
277
- bundleGraphAsset?: string;
278
- /** The preloader bundle fileName */
279
- preloader?: string;
280
- /** The Qwik core bundle fileName */
281
- core?: string;
282
- /** The Qwik loader bundle fileName */
283
- qwikLoader?: string;
284
- /** CSS etc to inject in the document head */
285
- injections?: GlobalInjections[];
286
- /** The version of the manifest */
287
- version: string;
288
- /** The options used to build the manifest */
289
- options?: {
290
- target?: string;
291
- buildMode?: string;
292
- entryStrategy?: {
293
- type: EntryStrategy['type'];
294
- };
295
- };
296
- /** The platform used to build the manifest */
297
- platform?: {
298
- [name: string]: string;
299
- };
300
- }
301
-
302
- /** @public */
303
- declare interface QwikSymbol {
304
- origin: string;
305
- displayName: string;
306
- hash: string;
307
- canonicalFilename: string;
308
- ctxKind: 'function' | 'eventHandler';
309
- ctxName: string;
310
- /** Whether the symbol captures a variable */
311
- captures: boolean;
312
- parent: string | null;
313
- loc: [number, number];
314
- /** The parameter names if it's a function with parameters */
315
- paramNames?: string[];
316
- /** The transformed names of scoped variables, if any */
317
- captureNames?: string[];
318
- }
319
-
320
- /** @public */
321
- declare interface ReadonlySignal<T = unknown> {
322
- readonly value: T;
323
- }
143
+ };
324
144
 
325
145
  /** @public */
326
146
  export declare type Render = RenderToString | RenderToStream;
@@ -337,26 +157,47 @@ export declare interface RenderOptions extends SerializeDocumentOptions {
337
157
  /** Language to use when rendering the document. */
338
158
  locale?: string | ((options: RenderOptions) => string);
339
159
  /**
340
- * Specifies if the Qwik Loader script is added to the document or not.
160
+ * Specifies how the Qwik Loader is included in the document. This enables interactivity and lazy
161
+ * loading.
162
+ *
163
+ * `module`: Use a `<script>` tag to load the Qwik Loader. Subsequent page loads will have the
164
+ * script cached and instantly running.
165
+ *
166
+ * `inline`: This embeds the Qwik Loader script directly in the document. This adds about 3kB
167
+ * before compression, which typically is reduced to about 1.6kB with gzip.
168
+ *
169
+ * `never`: Do not include the Qwik Loader script. This is mostly useful when embedding multiple
170
+ * containers on the same page.
171
+ *
172
+ * Defaults to `module`.
341
173
  *
342
- * Defaults to `{ include: true }`.
174
+ * Note that the Qwik Loader is absolutely required for Qwik to work. There must be an instance of
175
+ * it loaded for any interactivity to happen.
343
176
  */
344
177
  qwikLoader?: QwikLoaderOptions;
178
+ /** Specifies how preloading is handled. This ensures that code is instantly available when needed. */
345
179
  preloader?: PreloaderOptions | false;
346
- /** @deprecated Use `preloader` instead */
347
- prefetchStrategy?: PrefetchStrategy | null;
180
+ /**
181
+ * Root-count threshold for eager yielded state prewarm during client resume.
182
+ *
183
+ * Defaults to `false`, keeping state fully lazy. Set to a number to enable eager prewarm when
184
+ * serialized state has at least that many roots.
185
+ */
186
+ statePrewarm?: number | false;
348
187
  /**
349
188
  * When set, the app is serialized into a fragment. And the returned html is not a complete
350
189
  * document. Defaults to `html`
351
190
  */
352
191
  containerTagName?: string;
353
192
  containerAttributes?: Record<string, string>;
193
+ /** Metadata that can be retrieved during SSR with `useServerData()`. */
354
194
  serverData?: Record<string, any>;
355
195
  }
356
196
 
357
197
  /** @public */
358
198
  export declare interface RenderResult {
359
- snapshotResult: SnapshotResult | undefined;
199
+ /** @deprecated Not longer used in v2 */
200
+ snapshotResult?: SnapshotResult | undefined;
360
201
  isStatic: boolean;
361
202
  manifest?: ServerQwikManifest;
362
203
  }
@@ -414,26 +255,12 @@ export declare interface RenderToStringResult extends RenderResult {
414
255
  };
415
256
  }
416
257
 
417
- /** @public */
418
- declare interface ResolvedManifest_2 {
419
- mapper: SymbolMapper;
420
- manifest: ServerQwikManifest_2;
421
- injections?: GlobalInjections[];
422
- bundleGraph?: QwikBundleGraph;
423
- }
424
-
425
258
  /**
426
259
  * Merges a given manifest with the built manifest and provides mappings for symbols.
427
260
  *
428
261
  * @public
429
262
  */
430
- export declare function resolveManifest(manifest?: Partial<QwikManifest | ResolvedManifest_2> | undefined): ResolvedManifest_2 | undefined;
431
-
432
- /** @public */
433
- declare interface SegmentEntryStrategy {
434
- type: 'segment';
435
- manual?: Record<string, string>;
436
- }
263
+ export declare function resolveManifest(manifest?: Partial<QwikManifest | ResolvedManifest> | undefined): ResolvedManifest | undefined;
437
264
 
438
265
  /** @public */
439
266
  export declare interface SerializeDocumentOptions {
@@ -442,13 +269,6 @@ export declare interface SerializeDocumentOptions {
442
269
  debug?: boolean;
443
270
  }
444
271
 
445
- /**
446
- * The manifest values that are needed for SSR.
447
- *
448
- * @public
449
- */
450
- declare type ServerQwikManifest_2 = Pick<QwikManifest_2, 'manifestHash' | 'injections' | 'bundleGraph' | 'bundleGraphAsset' | 'mapping' | 'preloader' | 'core' | 'qwikLoader'>;
451
-
452
272
  /** @public */
453
273
  export declare function setServerPlatform(manifest?: Partial<QwikManifest | ResolvedManifest>): Promise<void>;
454
274
 
@@ -464,39 +284,24 @@ export declare function setServerPlatform(manifest?: Partial<QwikManifest | Reso
464
284
  *
465
285
  * @public
466
286
  */
467
- declare interface Signal<T = any> extends ReadonlySignal<T> {
287
+ declare interface Signal<T = any> {
288
+ /** Reading from this subscribes to updates; writing to this triggers updates. */
468
289
  value: T;
469
- }
470
-
471
- /** @public */
472
- declare interface SingleEntryStrategy {
473
- type: 'single';
474
- manual?: Record<string, string>;
475
- }
476
-
477
- /** @public */
478
- declare interface SmartEntryStrategy {
479
- type: 'smart';
480
- manual?: Record<string, string>;
290
+ /** Reading from this does not subscribe to updates; writing to this does not trigger updates. */
291
+ untrackedValue: T;
292
+ /**
293
+ * Use this to trigger running subscribers, for example when the value mutated but remained the
294
+ * same object.
295
+ */
296
+ trigger(): void;
481
297
  }
482
298
 
483
299
  /** @public */
484
300
  export declare interface StreamingOptions {
485
301
  inOrder?: InOrderStreaming;
302
+ outOfOrder?: OutOfOrderStreaming;
486
303
  }
487
304
 
488
- /** @public */
489
- declare type SymbolMapper = Record<string, readonly [symbol: string, chunk: string]>;
490
-
491
- /**
492
- * Auto: Prefetch all possible QRLs used by the document. Default
493
- *
494
- * @public
495
- */
496
- export declare type SymbolsToPrefetch = 'auto' | ((opts: {
497
- manifest: ServerQwikManifest;
498
- }) => PrefetchResource[]);
499
-
500
305
  /** @public */
501
306
  export declare const versions: {
502
307
  readonly qwik: string;