@qwik.dev/core 2.0.0-beta.34 → 2.0.0-beta.36

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.
@@ -1,5 +1,5 @@
1
- const QWIK_BACKPATCH_EXECUTOR_MINIFIED = "const t='script[type=\"qwik/backpatch\"]';function e(e,n){const o=n||e.querySelector(\"[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])\");if(o){const n=o.querySelector(t);if(n){const t=JSON.parse(n.textContent||\"[]\"),r=e.createTreeWalker(o,NodeFilter.SHOW_ELEMENT);let c=r.currentNode,i=c.hasAttribute(\":\")?0:-1;for(let e=0;e<t.length;e+=3){const n=t[e],o=t[e+1];let s=t[e+2];for(;i<n&&(c=r.nextNode(),c);)c.hasAttribute(\":\")&&i++;const a=c;null==s||!1===s?a.removeAttribute(o):(\"boolean\"==typeof s&&(s=\"\"),a.setAttribute(o,s))}}}}const n=document.currentScript;if(n){const t=n.closest(\"[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])\");t&&e(document,t)}";
2
- const QWIK_BACKPATCH_EXECUTOR_DEBUG = "const BACKPATCH_DATA_SELECTOR = 'script[type=\"qwik/backpatch\"]';\nfunction executeBackpatch(doc, containerElement) {\n const container = containerElement || doc.querySelector(\"[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])\");\n if (container) {\n const script = container.querySelector(BACKPATCH_DATA_SELECTOR);\n if (script) {\n const data = JSON.parse(script.textContent || \"[]\");\n const walker = doc.createTreeWalker(container, NodeFilter.SHOW_ELEMENT);\n let currentNode = walker.currentNode;\n let currentNodeIdx = currentNode.hasAttribute(\":\") ? 0 : -1;\n for (let i = 0; i < data.length; i += 3) {\n const elementIdx = data[i];\n const attrName = data[i + 1];\n let value = data[i + 2];\n while (currentNodeIdx < elementIdx) {\n currentNode = walker.nextNode();\n if (!currentNode) {\n break;\n }\n if (currentNode.hasAttribute(\":\")) {\n currentNodeIdx++;\n }\n }\n const element = currentNode;\n if (value == null || value === false) {\n element.removeAttribute(attrName);\n } else {\n if (typeof value === \"boolean\") {\n value = \"\";\n }\n element.setAttribute(attrName, value);\n }\n }\n }\n }\n}\nconst executorScript = document.currentScript;\nif (executorScript) {\n const container = executorScript.closest(\n \"[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])\"\n );\n if (container) {\n executeBackpatch(document, container);\n }\n}";
1
+ const QWIK_BACKPATCH_EXECUTOR_MINIFIED = "const t='script[type=\"qwik/backpatch\"]';function e(e,n){const o=n||e.querySelector(\"[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])\");if(o){const n=o.querySelectorAll(t),r=n[n.length-1];if(r){const t=JSON.parse(r.textContent||\"[]\"),n=e.createTreeWalker(o,NodeFilter.SHOW_ELEMENT);let c=n.currentNode,i=c.hasAttribute(\":\")?0:-1;for(let e=0;e<t.length;e+=3){const o=t[e],r=t[e+1];let l=t[e+2];for(;i<o&&(c=n.nextNode(),c);)c.hasAttribute(\":\")&&i++;const s=c;null==l||!1===l?s.removeAttribute(r):(\"boolean\"==typeof l&&(l=\"\"),s.setAttribute(r,l))}}}}const n=document.currentScript;if(n){const t=n.closest(\"[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])\");t&&e(document,t)}";
2
+ const QWIK_BACKPATCH_EXECUTOR_DEBUG = "const BACKPATCH_DATA_SELECTOR = 'script[type=\"qwik/backpatch\"]';\nfunction executeBackpatch(doc, containerElement) {\n const container = containerElement || doc.querySelector(\"[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])\");\n if (container) {\n const scripts = container.querySelectorAll(BACKPATCH_DATA_SELECTOR);\n const script = scripts[scripts.length - 1];\n if (script) {\n const data = JSON.parse(script.textContent || \"[]\");\n const walker = doc.createTreeWalker(container, NodeFilter.SHOW_ELEMENT);\n let currentNode = walker.currentNode;\n let currentNodeIdx = currentNode.hasAttribute(\":\") ? 0 : -1;\n for (let i = 0; i < data.length; i += 3) {\n const elementIdx = data[i];\n const attrName = data[i + 1];\n let value = data[i + 2];\n while (currentNodeIdx < elementIdx) {\n currentNode = walker.nextNode();\n if (!currentNode) {\n break;\n }\n if (currentNode.hasAttribute(\":\")) {\n currentNodeIdx++;\n }\n }\n const element = currentNode;\n if (value == null || value === false) {\n element.removeAttribute(attrName);\n } else {\n if (typeof value === \"boolean\") {\n value = \"\";\n }\n element.setAttribute(attrName, value);\n }\n }\n }\n }\n}\nconst executorScript = document.currentScript;\nif (executorScript) {\n const container = executorScript.closest(\n \"[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])\"\n );\n if (container) {\n executeBackpatch(document, container);\n }\n}";
3
3
  globalThis.QWIK_BACKPATCH_EXECUTOR_MINIFIED = QWIK_BACKPATCH_EXECUTOR_MINIFIED;
4
4
  globalThis.QWIK_BACKPATCH_EXECUTOR_DEBUG = QWIK_BACKPATCH_EXECUTOR_DEBUG;
5
5
  export { QWIK_BACKPATCH_EXECUTOR_MINIFIED, QWIK_BACKPATCH_EXECUTOR_DEBUG };
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qwik.dev/core/backpatch",
3
- "version": "2.0.0-beta.34-dev+8b055bb",
3
+ "version": "2.0.0-beta.36-dev+3268fab",
4
4
  "main": "index.mjs",
5
5
  "types": "index.d.ts",
6
6
  "private": true,
@@ -2,7 +2,8 @@ const BACKPATCH_DATA_SELECTOR = 'script[type="qwik/backpatch"]';
2
2
  function executeBackpatch(doc, containerElement) {
3
3
  const container = containerElement || doc.querySelector("[q\\:container]:not([q\\:container=html]):not([q\\:container=text])");
4
4
  if (container) {
5
- const script = container.querySelector(BACKPATCH_DATA_SELECTOR);
5
+ const scripts = container.querySelectorAll(BACKPATCH_DATA_SELECTOR);
6
+ const script = scripts[scripts.length - 1];
6
7
  if (script) {
7
8
  const data = JSON.parse(script.textContent || "[]");
8
9
  const walker = doc.createTreeWalker(container, NodeFilter.SHOW_ELEMENT);
@@ -1 +1 @@
1
- const t='script[type="qwik/backpatch"]';function e(e,n){const o=n||e.querySelector("[q\\:container]:not([q\\:container=html]):not([q\\:container=text])");if(o){const n=o.querySelector(t);if(n){const t=JSON.parse(n.textContent||"[]"),r=e.createTreeWalker(o,NodeFilter.SHOW_ELEMENT);let c=r.currentNode,i=c.hasAttribute(":")?0:-1;for(let e=0;e<t.length;e+=3){const n=t[e],o=t[e+1];let s=t[e+2];for(;i<n&&(c=r.nextNode(),c);)c.hasAttribute(":")&&i++;const a=c;null==s||!1===s?a.removeAttribute(o):("boolean"==typeof s&&(s=""),a.setAttribute(o,s))}}}}const n=document.currentScript;if(n){const t=n.closest("[q\\:container]:not([q\\:container=html]):not([q\\:container=text])");t&&e(document,t)}
1
+ const t='script[type="qwik/backpatch"]';function e(e,n){const o=n||e.querySelector("[q\\:container]:not([q\\:container=html]):not([q\\:container=text])");if(o){const n=o.querySelectorAll(t),r=n[n.length-1];if(r){const t=JSON.parse(r.textContent||"[]"),n=e.createTreeWalker(o,NodeFilter.SHOW_ELEMENT);let c=n.currentNode,i=c.hasAttribute(":")?0:-1;for(let e=0;e<t.length;e+=3){const o=t[e],r=t[e+1];let l=t[e+2];for(;i<o&&(c=n.nextNode(),c);)c.hasAttribute(":")&&i++;const s=c;null==l||!1===l?s.removeAttribute(r):("boolean"==typeof l&&(l=""),s.setAttribute(r,l))}}}}const n=document.currentScript;if(n){const t=n.closest("[q\\:container]:not([q\\:container=html]):not([q\\:container=text])");t&&e(document,t)}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qwik.dev/core/build",
3
- "version": "2.0.0-beta.34-dev+8b055bb",
3
+ "version": "2.0.0-beta.36-dev+3268fab",
4
4
  "main": "index.mjs",
5
5
  "types": "index.d.ts",
6
6
  "private": true,
package/dist/cli.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * @qwik.dev/core/cli 2.0.0-beta.34-dev+8b055bb
3
+ * @qwik.dev/core/cli 2.0.0-beta.36-dev+3268fab
4
4
  * Copyright QwikDev. All Rights Reserved.
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://github.com/QwikDev/qwik/blob/main/LICENSE
@@ -11964,6 +11964,25 @@ async function runBuildCommand(app) {
11964
11964
  }
11965
11965
  console.log(``);
11966
11966
  let typecheck = null;
11967
+ const buildTypesCmd = buildTypes ? buildTypes.includes("--pretty") ? buildTypes : (
11968
+ // ensures colors flow throw when we console log the stdout
11969
+ `${buildTypes} --pretty`
11970
+ ) : null;
11971
+ const runTypecheck = () => execaCommand(buildTypesCmd, {
11972
+ stdout: "inherit",
11973
+ stderr: "inherit",
11974
+ cwd: app.rootDir
11975
+ }).then(() => ({
11976
+ title: "Type checked"
11977
+ })).catch((e2) => {
11978
+ let out = e2.stdout || "";
11979
+ if (out.startsWith("tsc")) {
11980
+ out = out.slice(3);
11981
+ }
11982
+ console.log("\n" + out);
11983
+ process.exitCode = 1;
11984
+ throw new Error(`Type check failed: ${out}`);
11985
+ });
11967
11986
  for (let i2 = 0; i2 < prebuildScripts.length; i2++) {
11968
11987
  const script = prebuildScripts[i2];
11969
11988
  try {
@@ -11981,26 +12000,8 @@ async function runBuildCommand(app) {
11981
12000
  throw e2;
11982
12001
  }
11983
12002
  }
11984
- if (buildTypes) {
11985
- let copyScript = buildTypes;
11986
- if (!copyScript.includes("--pretty")) {
11987
- copyScript += " --pretty";
11988
- }
11989
- typecheck = execaCommand(copyScript, {
11990
- stdout: "inherit",
11991
- stderr: "inherit",
11992
- cwd: app.rootDir
11993
- }).then(() => ({
11994
- title: "Type checked"
11995
- })).catch((e2) => {
11996
- let out = e2.stdout || "";
11997
- if (out.startsWith("tsc")) {
11998
- out = out.slice(3);
11999
- }
12000
- console.log("\n" + out);
12001
- process.exitCode = 1;
12002
- throw new Error(`Type check failed: ${out}`);
12003
- });
12003
+ if (buildTypesCmd && !buildLibScript) {
12004
+ typecheck = runTypecheck();
12004
12005
  }
12005
12006
  if (buildClientScript) {
12006
12007
  const script = attachArg(buildClientScript, "mode", mode);
@@ -12040,6 +12041,9 @@ async function runBuildCommand(app) {
12040
12041
  throw e2;
12041
12042
  });
12042
12043
  step2.push(libBuild);
12044
+ if (buildTypesCmd) {
12045
+ step2.push(libBuild.then(() => runTypecheck()));
12046
+ }
12043
12047
  }
12044
12048
  if (buildPreviewScript) {
12045
12049
  const script = attachArg(buildPreviewScript, "mode", mode);
@@ -12953,7 +12957,7 @@ async function printHelp(app) {
12953
12957
  await runCommand2(Object.assign(app, { task: args[0], args }));
12954
12958
  }
12955
12959
  function printVersion() {
12956
- console.log("2.0.0-beta.34-dev+8b055bb");
12960
+ console.log("2.0.0-beta.36-dev+3268fab");
12957
12961
  }
12958
12962
  export {
12959
12963
  runCli,
@@ -1,8 +1,10 @@
1
+ import type { AsyncLocalStorage } from 'node:async_hooks';
1
2
  import type * as CSS_2 from 'csstype';
2
3
  import { isBrowser } from './build';
3
4
  import { isDev } from './build';
4
5
  import { isServer } from './build';
5
6
  import { ResolvedManifest } from './optimizer';
7
+ import type { ServerQwikManifest } from './optimizer';
6
8
 
7
9
  /**
8
10
  * Qwik Optimizer marker function.
@@ -714,13 +716,14 @@ declare const enum ChoreBits {
714
716
  TASKS = 1,
715
717
  NODE_DIFF = 2,
716
718
  COMPONENT = 4,
717
- NODE_PROPS = 8,
718
- COMPUTE = 16,
719
- CHILDREN = 32,
720
- CLEANUP = 64,
721
- RECONCILE = 128,
722
- ERROR_WRAP = 256,
723
- DIRTY_MASK = 511
719
+ INLINE_COMPONENT = 8,
720
+ NODE_PROPS = 16,
721
+ COMPUTE = 32,
722
+ CHILDREN = 64,
723
+ CLEANUP = 128,
724
+ RECONCILE = 256,
725
+ ERROR_WRAP = 512,
726
+ DIRTY_MASK = 1023
724
727
  }
725
728
 
726
729
  /**
@@ -743,8 +746,10 @@ export declare interface ClientContainer extends _Container {
743
746
  $locale$: string;
744
747
  qManifestHash: string;
745
748
  rootVNode: _ElementVNode;
746
- $forwardRefs$: Array<number> | null;
749
+ $forwardRefs$: Array<number | string> | null;
750
+ vNodeLocate(id: string | Element): _VNode;
747
751
  parseQRL<T = unknown>(qrl: string): QRL<T>;
752
+ $getForwardRef$(id: number): number | string | undefined;
748
753
  $setRawState$(id: number, vParent: _ElementVNode | _VirtualVNode): void;
749
754
  }
750
755
 
@@ -901,9 +906,12 @@ declare type Consumer = Task | _VNode | SignalImpl | ISsrNode;
901
906
  export declare interface _Container {
902
907
  readonly $version$: string;
903
908
  readonly $storeProxyMap$: ObjToProxyMap;
909
+ $rootContainer$: _Container | null;
910
+ $isOutOfOrderSegment$: boolean;
904
911
  readonly $locale$: string;
905
912
  readonly $getObjectById$: (id: number | string) => any;
906
913
  readonly $serverData$: Record<string, any>;
914
+ readonly $instanceHash$: string | null;
907
915
  $currentUniqueId$: number;
908
916
  $buildBase$: string | null;
909
917
  $renderPromise$: Promise<void> | null;
@@ -954,6 +962,8 @@ export declare interface _ContainerElement extends HTMLElement {
954
962
  qVNodeRefs?: Map<number, Element | _ElementVNode>;
955
963
  /** String from `<script type="qwik/vnode">` tag. */
956
964
  qVnodeData?: string;
965
+ /** Segment-local strings from `<script type="qwik/vnode" q:r="...">` tags. */
966
+ qSegmentVnodeData?: Map<string, string>;
957
967
  }
958
968
 
959
969
  /**
@@ -1162,6 +1172,9 @@ export declare const createComputedQrl: <T>(qrl: QRL<() => T>, options?: Compute
1162
1172
  */
1163
1173
  export declare const createContextId: <STATE = unknown>(name: string) => ContextId<STATE>;
1164
1174
 
1175
+ /** @internal */
1176
+ export declare function _createDeserializeContainer(stateData: unknown[]): DeserializeContainer;
1177
+
1165
1178
  /**
1166
1179
  * Creates a QRL instance to represent a lazily loaded value. Normally this is a function, but it
1167
1180
  * can be any value.
@@ -1239,11 +1252,12 @@ export declare function _deserialize<T>(rawStateData: string): T;
1239
1252
 
1240
1253
  declare interface DeserializeContainer {
1241
1254
  $getObjectById$: (id: number | string) => unknown;
1255
+ $getForwardRef$: (id: number) => number | string | undefined;
1242
1256
  element: HTMLElement | null;
1243
1257
  getSyncFn: (id: number) => (...args: unknown[]) => unknown;
1244
1258
  $state$?: unknown[];
1245
1259
  $storeProxyMap$: ObjToProxyMap;
1246
- $forwardRefs$: Array<number> | null;
1260
+ $forwardRefs$: Array<number | string> | null;
1247
1261
  }
1248
1262
 
1249
1263
  /** @public */
@@ -1273,14 +1287,17 @@ declare class DomContainer extends _SharedContainer implements ClientContainer {
1273
1287
  $storeProxyMap$: ObjToProxyMap;
1274
1288
  $qFuncs$: Array<(...args: unknown[]) => unknown>;
1275
1289
  $instanceHash$: string;
1276
- $forwardRefs$: Array<number> | null;
1290
+ $forwardRefs$: Array<number | string> | null;
1277
1291
  vNodeLocate: (id: string | Element) => _VNode;
1278
1292
  private $rawStateData$;
1279
1293
  private $stateData$;
1294
+ private $rootForwardRefs$;
1280
1295
  private $styleIds$;
1281
1296
  constructor(element: _ContainerElement);
1282
1297
  /** Tear down this container so stale references fail gracefully. */
1283
1298
  $destroy$(): void;
1299
+ private $processRootStateScript$;
1300
+ private $stateScriptSelector$;
1284
1301
  /**
1285
1302
  * The first time we render we need to hoist the styles. (Meaning we need to move all styles from
1286
1303
  * component inline to <head>)
@@ -1300,6 +1317,7 @@ declare class DomContainer extends _SharedContainer implements ClientContainer {
1300
1317
  getHostProp<T>(host: HostElement, name: string): T | null;
1301
1318
  ensureProjectionResolved(vNode: _VirtualVNode): void;
1302
1319
  $getObjectById$: (id: number | string) => unknown;
1320
+ $getForwardRef$(id: number): number | string | undefined;
1303
1321
  getSyncFn(id: number): (...args: unknown[]) => unknown;
1304
1322
  $appendStyle$(content: string, styleId: string, host: _VirtualVNode, scoped: boolean): void;
1305
1323
  /** Set the server data for the Qwik Router. */
@@ -1309,7 +1327,7 @@ export { DomContainer }
1309
1327
  export { DomContainer as _DomContainer }
1310
1328
 
1311
1329
  declare type DomRef = {
1312
- $ssrNode$: SsrNode;
1330
+ $ssrNode$: ISsrNode;
1313
1331
  };
1314
1332
 
1315
1333
  /** @internal */
@@ -1470,6 +1488,17 @@ export declare type FunctionComponent<P = unknown> = {
1470
1488
  renderFn(props: P, key: string | null, flags: number, dev?: DevJSX): JSXOutput;
1471
1489
  }['renderFn'];
1472
1490
 
1491
+ /** @internal */
1492
+ export declare const _getAsyncLocalStorage: () => (new <T>() => AsyncLocalStorage<T>) | undefined;
1493
+
1494
+ /**
1495
+ * Returns the client build manifest, which includes the mappings from symbols to bundles, the
1496
+ * bundlegraph etc.
1497
+ *
1498
+ * @public
1499
+ */
1500
+ export declare const getClientManifest: () => ServerQwikManifest | undefined;
1501
+
1473
1502
  /** Used by the optimizer for spread props operations @internal */
1474
1503
  export declare const _getConstProps: (props: PropsProxy | Record<string, unknown> | null | undefined) => Props | null;
1475
1504
 
@@ -1679,6 +1708,16 @@ declare class InsertOrMoveOperation {
1679
1708
  constructor(target: Element | Text, parent: Element, beforeTarget: Element | Text | null);
1680
1709
  }
1681
1710
 
1711
+ /** @internal */
1712
+ declare type InternalServerComponent<PROPS = unknown> = FunctionComponent<PROPS> & {
1713
+ [InternalServerComponentSymbol]: InternalServerComponentHandler;
1714
+ };
1715
+
1716
+ /** @internal */
1717
+ declare type InternalServerComponentHandler = (ssr: SSRContainer, jsx: JSXNodeInternal, options: SSRRenderJSXOptions, enqueue: (value: StackValue) => void) => ValueOrPromise<void>;
1718
+
1719
+ declare const InternalServerComponentSymbol: unique symbol;
1720
+
1682
1721
  /**
1683
1722
  * These are the HTML tags with handlers allowing plain callbacks, to be used for the JSX interface
1684
1723
  *
@@ -1753,8 +1792,10 @@ declare interface ISsrNode {
1753
1792
  flags: SsrNodeFlags;
1754
1793
  dirty: ChoreBits;
1755
1794
  parentComponent: ISsrNode | null;
1795
+ children: ISsrNode[] | null;
1756
1796
  vnodeData: VNodeData;
1757
1797
  currentFile: string | null;
1798
+ readonly [_EFFECT_BACK_REF]: Map<EffectProperty | string, EffectSubscription> | null;
1758
1799
  setProp(name: string, value: any): void;
1759
1800
  getProp(name: string): any;
1760
1801
  removeProp(name: string): void;
@@ -2046,6 +2087,9 @@ export declare const _mapArray_get: <T>(array: (T | null)[], key: string, start:
2046
2087
  /** @internal */
2047
2088
  export declare const _mapArray_set: <T>(array: (T | null)[], key: string, value: T | null, start: number, allowNullValue?: boolean) => void;
2048
2089
 
2090
+ declare class MaybeAsyncSignal {
2091
+ }
2092
+
2049
2093
  declare type MediaSpecialAttrs = {
2050
2094
  crossOrigin?: HTMLCrossOriginAttribute;
2051
2095
  };
@@ -2162,6 +2206,26 @@ export declare interface OnVisibleTaskOptions {
2162
2206
  strategy?: VisibleTaskStrategy;
2163
2207
  }
2164
2208
 
2209
+ /** @internal */
2210
+ declare type OutOfOrderRevealBoundary = {
2211
+ attrs: string;
2212
+ showFallback: boolean;
2213
+ resolve: () => void;
2214
+ };
2215
+
2216
+ /** @internal */
2217
+ declare class OutOfOrderRevealCoordinator<ITEM extends RevealItemLike = RevealItemLike> {
2218
+ private id;
2219
+ private collapsed;
2220
+ private count;
2221
+ private pendingItems;
2222
+ private orderCode;
2223
+ constructor(id: number, order: RevealOrder, collapsed: boolean);
2224
+ register(registration: RevealRegistrationLike<ITEM>): OutOfOrderRevealBoundary;
2225
+ canReveal(registration: RevealRegistrationLike<ITEM>): boolean;
2226
+ script(): string;
2227
+ }
2228
+
2165
2229
  /** @internal */
2166
2230
  declare const _OWNER: unique symbol;
2167
2231
 
@@ -2258,7 +2322,7 @@ export declare const PrefetchServiceWorker: (opts: {
2258
2322
  * @returns The preprocessed state data
2259
2323
  * @internal
2260
2324
  */
2261
- export declare function _preprocessState(data: unknown[], container: DeserializeContainer): void;
2325
+ export declare function _preprocessState(data: unknown[], container: DeserializeContainer, segmentId?: string, startIndex?: number): void;
2262
2326
 
2263
2327
  declare type Prettify<T> = {} & {
2264
2328
  [K in keyof T]: T[K];
@@ -2335,6 +2399,12 @@ export declare type PublicProps<PROPS> = (PROPS extends Record<any, any> ? Omit<
2335
2399
  /** @internal */
2336
2400
  export declare interface _QDocument extends Document {
2337
2401
  qVNodeData: WeakMap<Element, string>;
2402
+ /** True once the root document VNode data has been fully processed. */
2403
+ qVNodeDataProcessed?: boolean;
2404
+ /** Processes one vnode patch script. */
2405
+ qProcessVNodeDataPatch?: (script: Element | null) => void;
2406
+ /** Processes an out-of-order Suspense segment after its resolved HTML is swapped in. */
2407
+ qProcessOOOS?: (boundaryId: number, content: Element | null) => void;
2338
2408
  }
2339
2409
 
2340
2410
  /**
@@ -2565,6 +2635,12 @@ export declare function _qrlToString(serializationContext: SerializationContext,
2565
2635
  /** @internal */
2566
2636
  export declare function _qrlToString(serializationContext: SerializationContext, qrl: _QRLInternal | SyncQRLInternal, raw: true): [string, string, string | null];
2567
2637
 
2638
+ /** @internal */
2639
+ export declare const _qrlWithChunk: <T = any>(chunk: string, importer: () => Promise<any>, symbol: string, lexicalScopeCapture?: Readonly<unknown[]>) => QRL<T>;
2640
+
2641
+ /** @internal */
2642
+ export declare const _qrlWithChunkDEV: <T = any>(chunk: string, importer: () => Promise<any>, symbol: string, opts: QRLDev, lexicalScopeCapture?: Readonly<unknown[]>) => QRL<T>;
2643
+
2568
2644
  /** @public @deprecated Use `AnimationEvent` and use the second argument to the handler function for the current event target */
2569
2645
  export declare type QwikAnimationEvent<T = Element> = NativeAnimationEvent;
2570
2646
 
@@ -2757,6 +2833,12 @@ export declare interface ReadonlySignal<T = unknown> {
2757
2833
  readonly value: T;
2758
2834
  }
2759
2835
 
2836
+ /** @internal */
2837
+ export declare const _reC: (props: RevealProps) => JSXNodeInternal<InternalServerComponent<SSRRevealSlotProps>> | JSXNodeInternal<FunctionComponent< {
2838
+ name?: string;
2839
+ children?: JSXChildren;
2840
+ }>>;
2841
+
2760
2842
  /**
2761
2843
  * A ref can be either a signal or a function. Note that the type of Signal is Element so that it
2762
2844
  * can accept more specialized elements too
@@ -2838,6 +2920,9 @@ export declare interface RenderSSROptions {
2838
2920
  manifestHash: string;
2839
2921
  }
2840
2922
 
2923
+ /** @internal */
2924
+ export declare const _reR: () => boolean;
2925
+
2841
2926
  /**
2842
2927
  * Resumes selected state (e.g. polling AsyncSignals) by deserializing captures. Used for
2843
2928
  * document:onQIdle to resume async signals with active polling.
@@ -2943,6 +3028,37 @@ declare interface ResourceReturnInternal<T> {
2943
3028
  /** @internal */
2944
3029
  export declare const _restProps: (props: PropsProxy, omit?: string[], target?: Props) => Props;
2945
3030
 
3031
+ /** @internal */
3032
+ export declare const _reT: ({ cleanup }: TaskCtx) => void;
3033
+
3034
+ /** @public @experimental */
3035
+ export declare const Reveal: typeof _reC;
3036
+
3037
+ declare interface RevealItemLike {
3038
+ boundary: {
3039
+ pending: {
3040
+ untrackedValue: number;
3041
+ };
3042
+ };
3043
+ }
3044
+
3045
+ /** @public @experimental */
3046
+ export declare type RevealOrder = 'parallel' | 'sequential' | 'reverse' | 'together';
3047
+
3048
+ /** @public @experimental */
3049
+ export declare type RevealProps = {
3050
+ order?: RevealOrder;
3051
+ collapsed?: boolean;
3052
+ };
3053
+
3054
+ declare interface RevealRegistrationLike<ITEM extends RevealItemLike = RevealItemLike> {
3055
+ reveal: {
3056
+ order: RevealOrder;
3057
+ items: ITEM[];
3058
+ };
3059
+ item: ITEM;
3060
+ }
3061
+
2946
3062
  /**
2947
3063
  * The resource function wrapper
2948
3064
  *
@@ -2965,8 +3081,15 @@ declare type SeenRef = {
2965
3081
  $parent$?: SeenRef | null;
2966
3082
  };
2967
3083
 
3084
+ declare interface SegmentRenderContext {
3085
+ container: SSRSegmentContainer;
3086
+ writer: SSRInternalStreamWriter;
3087
+ htmlChunks: SSRSegmentWriteChunk[];
3088
+ }
3089
+
2968
3090
  declare interface SerializationContext {
2969
3091
  $serialize$: () => ValueOrPromise<void>;
3092
+ $serializePatch$: (rootStart: number, rootIds: number[], extraRootId?: number | string | number[], streamedRootLimit?: number) => ValueOrPromise<void>;
2970
3093
  $symbolToChunkResolver$: SymbolToChunkResolver;
2971
3094
  /**
2972
3095
  * Map from object to parent and index reference.
@@ -2989,14 +3112,26 @@ declare interface SerializationContext {
2989
3112
  * Returns the index of the root object.
2990
3113
  */
2991
3114
  $addRoot$: AddRootFn;
3115
+ $addDuplicateRoot$: (obj: unknown) => SeenRef;
3116
+ $commitRoot$: (root: unknown, obj: unknown) => number;
2992
3117
  /** Mark an object as seen during serialization. This is used to handle backreferences and cycles */
2993
3118
  $markSeen$: (obj: unknown, parent: SeenRef | undefined, index: number) => SeenRef;
2994
3119
  $roots$: unknown[];
2995
- $promoteToRoot$: (ref: SeenRef, index?: number) => void;
3120
+ $rootObjs$: unknown[];
3121
+ $onAddRoot$?: (id: number, root: unknown, obj: unknown) => void;
3122
+ $forwardRefOffset$: number;
3123
+ $serializedRootCount$: number;
3124
+ $serializedForwardRefCount$: number;
3125
+ $rootStateRootCount$: number;
3126
+ $hasRootStateForwardRefs$: boolean;
3127
+ $promoteToRoot$: (ref: SeenRef, obj: unknown, index?: number) => void;
2996
3128
  $addSyncFn$($funcStr$: string | null, argsCount: number, fn: Function): number;
2997
- $isSsrNode$: (obj: unknown) => obj is SsrNode;
3129
+ $setSyncFnOffset$(offset: number, existingFns?: string[]): void;
3130
+ $isSsrNode$: (obj: unknown) => obj is ISsrNode;
2998
3131
  $isDomRef$: (obj: unknown) => obj is DomRef;
2999
- $writer$: StreamWriter;
3132
+ $markSsrNodeForSerialization$: (node: ISsrNode, flags: number) => void;
3133
+ $writer$: SSRInternalStreamWriter;
3134
+ $setWriter$(writer: SSRInternalStreamWriter): void;
3000
3135
  $syncFns$: string[];
3001
3136
  $eventQrls$: Set<QRL>;
3002
3137
  $eventNames$: Set<string>;
@@ -3131,7 +3266,7 @@ declare class SetAttributeOperation {
3131
3266
  }
3132
3267
 
3133
3268
  /** @internal */
3134
- export declare function _setEvent(serializationCtx: SerializationContext, key: string, rawValue: unknown, hasMovedCaptures: boolean): string | null;
3269
+ export declare function _setEvent(serializationCtx: SerializationContext, key: string, rawValue: unknown, hasMovedCaptures: boolean): string | SSRWriteChunk[] | null;
3135
3270
 
3136
3271
  /**
3137
3272
  * Sets the `CorePlatform`.
@@ -3165,6 +3300,8 @@ declare class SetTextOperation {
3165
3300
  export declare abstract class _SharedContainer implements _Container {
3166
3301
  readonly $version$: string;
3167
3302
  readonly $storeProxyMap$: ObjToProxyMap;
3303
+ $rootContainer$: _Container | null;
3304
+ $isOutOfOrderSegment$: boolean;
3168
3305
  readonly $locale$: string;
3169
3306
  readonly $getObjectById$: (id: number | string) => any;
3170
3307
  $serverData$: Record<string, any>;
@@ -3522,14 +3659,21 @@ declare interface SSRContainer extends _Container {
3522
3659
  readonly tag: string;
3523
3660
  readonly isHtml: boolean;
3524
3661
  readonly size: number;
3525
- readonly writer: StreamWriter;
3662
+ readonly writer: SSRInternalStreamWriter;
3526
3663
  readonly streamHandler: IStreamHandler;
3527
3664
  readonly serializationCtx: SerializationContext;
3528
3665
  readonly symbolToChunkResolver: SymbolToChunkResolver;
3529
3666
  readonly resolvedManifest: ResolvedManifest;
3667
+ readonly outOfOrderStreaming: boolean;
3530
3668
  additionalHeadNodes: Array<JSXNodeInternal>;
3531
3669
  additionalBodyNodes: Array<JSXNodeInternal>;
3532
3670
  $noScriptHere$: number;
3671
+ /**
3672
+ * Lets the container place a root-level `useOn` placeholder `<script>` itself when injecting it
3673
+ * inline would put it at an illegal position. Returns `true` if the container took the node, in
3674
+ * which case the caller must not inject it into the component's JSX.
3675
+ */
3676
+ $deferRootPlaceholder$(scriptNode: JSXNodeInternal<string>): boolean;
3533
3677
  write(text: string): void;
3534
3678
  openContainer(): void;
3535
3679
  closeContainer(): ValueOrPromise<void>;
@@ -3546,18 +3690,24 @@ declare interface SSRContainer extends _Container {
3546
3690
  textNode(text: string): void;
3547
3691
  htmlNode(rawHtml: string): void;
3548
3692
  commentNode(text: string): void;
3549
- addRoot(obj: any): number | undefined;
3693
+ addRoot(obj: any): number | string | undefined;
3550
3694
  getOrCreateLastNode(): ISsrNode;
3551
3695
  addUnclaimedProjection(frame: ISsrComponentFrame, name: string, children: JSXChildren): void;
3552
3696
  isStatic(): boolean;
3553
3697
  render(jsx: JSXOutput): Promise<void>;
3554
- renderJSX(jsx: JSXOutput, options: {
3555
- currentStyleScoped: string | null;
3556
- parentComponentFrame: ISsrComponentFrame | null;
3557
- }): Promise<void>;
3698
+ renderJSX(jsx: JSXOutput, options: SSRRenderJSXOptions): Promise<void>;
3699
+ $runQueuedRender$<T>(render: () => ValueOrPromise<T>): ValueOrPromise<T>;
3700
+ nextOutOfOrderId(): number;
3701
+ emitOutOfOrderSegmentScripts(scripts: string): void;
3702
+ segment(segmentId: string, jsx: JSXOutput, options: SSRRenderJSXOptions): Promise<SSROutOfOrderSegment>;
3703
+ queueOutOfOrderSegment(segment: Promise<void>): void;
3704
+ emitOutOfOrderExecutorIfNeeded(): void;
3705
+ emitInlineScript(script: string): void;
3706
+ writeScript(attrs: Props, body?: string): void;
3558
3707
  emitPreloaderPre(): void;
3559
3708
  emitQwikLoaderAtTopIfNeeded(): void;
3560
3709
  emitPatchDataIfNeeded(): void;
3710
+ emitBackpatchDataAndExecutorIfNeeded(): void;
3561
3711
  addBackpatchEntry(ssrNodeId: string, attrName: string, serializedValue: string | boolean | null): void;
3562
3712
  }
3563
3713
 
@@ -3566,23 +3716,56 @@ export declare type SSRHintProps = {
3566
3716
  dynamic?: boolean;
3567
3717
  };
3568
3718
 
3569
- /** A selection of attributes of the real thing */
3570
- declare type SsrNode = {
3571
- id: string;
3572
- children: ISsrNode[] | null;
3573
- vnodeData: VNodeData;
3574
- [_EFFECT_BACK_REF]: Map<EffectProperty | string, EffectSubscription> | null;
3575
- };
3719
+ /** @internal */
3720
+ declare interface SSRInternalStreamWriter extends StreamWriter {
3721
+ writeRootRef(id: number): ValueOrPromise<void>;
3722
+ writeRootRefPath(path: number[]): ValueOrPromise<void>;
3723
+ toString(remap?: number[]): string;
3724
+ }
3576
3725
 
3577
3726
  declare const enum SsrNodeFlags {
3578
3727
  Updatable = 1
3579
3728
  }
3580
3729
 
3730
+ declare type SSROutOfOrderSegment = SegmentRenderContext;
3731
+
3581
3732
  /** @public */
3582
3733
  export declare const SSRRaw: FunctionComponent<{
3583
3734
  data: string;
3584
3735
  }>;
3585
3736
 
3737
+ declare interface SSRRenderJSXOptions {
3738
+ currentStyleScoped: string | null;
3739
+ parentComponentFrame: ISsrComponentFrame | null;
3740
+ }
3741
+
3742
+ declare type SSRRevealSlotProps = {
3743
+ coordinator: OutOfOrderRevealCoordinator;
3744
+ };
3745
+
3746
+ /** @internal */
3747
+ declare interface SSRRootRefPathChunk {
3748
+ readonly path: number[];
3749
+ }
3750
+
3751
+ declare interface SSRSegmentContainer extends SSRContainer {
3752
+ $rootContainer$: SSRContainer;
3753
+ $recordExternalRootEffect$(producer: unknown, effect: EffectSubscription, prop: string | symbol | null, sourceEffects?: Map<string | symbol, Set<EffectSubscription>>): void;
3754
+ $finalizeOutOfOrderSegment$(segmentId: string, segment: SSROutOfOrderSegment): Promise<{
3755
+ html: string;
3756
+ scripts: string;
3757
+ }>;
3758
+ }
3759
+
3760
+ /** @internal */
3761
+ declare type SSRSegmentWriteChunk = string | {
3762
+ readonly type: 'root-ref';
3763
+ readonly localId: number;
3764
+ } | {
3765
+ readonly type: 'root-ref-path';
3766
+ readonly localPath: number[];
3767
+ };
3768
+
3586
3769
  /** @public */
3587
3770
  export declare const SSRStream: FunctionComponent<SSRStreamProps>;
3588
3771
 
@@ -3604,6 +3787,13 @@ export declare interface SSRStreamWriter {
3604
3787
  write(chunk: JSXOutput): void;
3605
3788
  }
3606
3789
 
3790
+ /** @internal */
3791
+ declare type SSRWriteChunk = string | number | SSRRootRefPathChunk;
3792
+
3793
+ declare type StackFn = () => ValueOrPromise<void>;
3794
+
3795
+ declare type StackValue = ValueOrPromise<JSXOutput | StackFn | Promise<JSXOutput> | typeof Promise | AsyncGenerator | typeof MaybeAsyncSignal>;
3796
+
3607
3797
  declare type StopPropagation = {
3608
3798
  [K in keyof HTMLElementEventMap as `stoppropagation:${K}`]?: boolean;
3609
3799
  };
@@ -3626,6 +3816,29 @@ export declare class _SubscriptionData {
3626
3816
  constructor(data: NodePropData);
3627
3817
  }
3628
3818
 
3819
+ /** @internal */
3820
+ export declare class _SubscriptionPatch {
3821
+ rootId: number;
3822
+ subscriptions: Set<EffectSubscription> | Map<string | symbol, Set<EffectSubscription>>;
3823
+ constructor(rootId?: number, subscriptions?: Set<EffectSubscription> | Map<string | symbol, Set<EffectSubscription>>);
3824
+ }
3825
+
3826
+ /** @internal */
3827
+ export declare const _suC: (props: SuspenseProps) => JSXNodeInternal<string>[];
3828
+
3829
+ /** @public @experimental */
3830
+ export declare const Suspense: typeof _suC;
3831
+
3832
+ /** @public @experimental */
3833
+ export declare type SuspenseProps = {
3834
+ fallback?: JSXOutput;
3835
+ showStale?: boolean;
3836
+ delay?: number;
3837
+ };
3838
+
3839
+ /** @internal */
3840
+ export declare const _suT: ({ track, cleanup }: TaskCtx) => void;
3841
+
3629
3842
  /**
3630
3843
  * The TS types don't include the SVG attributes so we have to define them ourselves
3631
3844
  *
@@ -4776,7 +4989,7 @@ export declare const _VAR_PROPS: unique symbol;
4776
4989
  export declare const _verifySerializable: <T>(value: T, preMessage?: string) => T;
4777
4990
 
4778
4991
  /**
4779
- * 2.0.0-beta.34-dev+8b055bb
4992
+ * 2.0.0-beta.36-dev+3268fab
4780
4993
  *
4781
4994
  * @public
4782
4995
  */
@@ -4947,10 +5160,7 @@ declare type VNodeOperation = DeleteOperation | RemoveAllChildrenOperation | Set
4947
5160
  export declare const _waitUntilRendered: (container: _Container) => Promise<void>;
4948
5161
 
4949
5162
  /** @internal */
4950
- export declare function _walkJSX(ssr: SSRContainer, value: JSXOutput, options: {
4951
- currentStyleScoped: string | null;
4952
- parentComponentFrame: ISsrComponentFrame | null;
4953
- }): Promise<void>;
5163
+ export declare function _walkJSX(ssr: SSRContainer, value: JSXOutput, options: SSRRenderJSXOptions): Promise<void>;
4954
5164
 
4955
5165
  /**
4956
5166
  * Override the `getLocale` with `lang` within the `fn` execution.