@qwik.dev/core 2.0.0-beta.11 → 2.0.0-beta.13

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 (67) hide show
  1. package/bindings/qwik.darwin-arm64.node +0 -0
  2. package/bindings/qwik.darwin-x64.node +0 -0
  3. package/bindings/qwik.linux-x64-gnu.node +0 -0
  4. package/bindings/qwik.win32-x64-msvc.node +0 -0
  5. package/bindings/qwik_wasm_bg.wasm +0 -0
  6. package/dist/backpatch/index.cjs +2 -2
  7. package/dist/backpatch/index.mjs +2 -2
  8. package/dist/backpatch/package.json +1 -1
  9. package/dist/backpatch-executor.debug.js +7 -2
  10. package/dist/backpatch-executor.js +1 -1
  11. package/dist/build/package.json +1 -1
  12. package/dist/cli.cjs +6484 -1341
  13. package/dist/core-internal.d.ts +147 -77
  14. package/dist/core.cjs +9358 -8994
  15. package/dist/core.cjs.map +1 -1
  16. package/dist/core.min.mjs +1 -1
  17. package/dist/core.mjs +9356 -8994
  18. package/dist/core.mjs.map +1 -1
  19. package/dist/core.prod.cjs +4738 -4472
  20. package/dist/core.prod.mjs +5143 -4862
  21. package/dist/loader/index.cjs +2 -2
  22. package/dist/loader/index.mjs +2 -2
  23. package/dist/loader/package.json +1 -1
  24. package/dist/optimizer.cjs +34 -29
  25. package/dist/optimizer.d.ts +3 -0
  26. package/dist/optimizer.mjs +945 -935
  27. package/dist/qwikloader.debug.js +9 -8
  28. package/dist/qwikloader.js +1 -1
  29. package/dist/server.cjs +471 -386
  30. package/dist/server.d.ts +20 -12
  31. package/dist/server.mjs +466 -381
  32. package/dist/starters/adapters/aws-lambda/adapters/aws-lambda/{vite.config.mts → vite.config.ts} +1 -1
  33. package/dist/starters/adapters/aws-lambda/package.json +1 -1
  34. package/dist/starters/adapters/azure-swa/adapters/azure-swa/{vite.config.mts → vite.config.ts} +1 -1
  35. package/dist/starters/adapters/azure-swa/package.json +1 -1
  36. package/dist/starters/adapters/bun/adapters/bun/{vite.config.mts → vite.config.ts} +1 -1
  37. package/dist/starters/adapters/bun/package.json +1 -1
  38. package/dist/starters/adapters/cloud-run/adapters/cloud-run/{vite.config.mts → vite.config.ts} +1 -1
  39. package/dist/starters/adapters/cloud-run/package.json +1 -1
  40. package/dist/starters/adapters/cloudflare-pages/adapters/cloudflare-pages/{vite.config.mts → vite.config.ts} +1 -1
  41. package/dist/starters/adapters/cloudflare-pages/package.json +1 -1
  42. package/dist/starters/adapters/deno/adapters/deno/{vite.config.mts → vite.config.ts} +1 -1
  43. package/dist/starters/adapters/deno/package.json +1 -1
  44. package/dist/starters/adapters/express/adapters/express/{vite.config.mts → vite.config.ts} +1 -1
  45. package/dist/starters/adapters/express/package.json +1 -1
  46. package/dist/starters/adapters/fastify/adapters/fastify/{vite.config.mts → vite.config.ts} +1 -1
  47. package/dist/starters/adapters/fastify/package.json +1 -1
  48. package/dist/starters/adapters/firebase/adapters/firebase/{vite.config.mts → vite.config.ts} +1 -1
  49. package/dist/starters/adapters/firebase/package.json +1 -1
  50. package/dist/starters/adapters/netlify-edge/adapters/netlify-edge/{vite.config.mts → vite.config.ts} +1 -1
  51. package/dist/starters/adapters/netlify-edge/package.json +1 -1
  52. package/dist/starters/adapters/node-server/adapters/node-server/{vite.config.mts → vite.config.ts} +1 -1
  53. package/dist/starters/adapters/node-server/package.json +1 -1
  54. package/dist/starters/adapters/ssg/adapters/ssg/{vite.config.mts → vite.config.ts} +1 -1
  55. package/dist/starters/adapters/ssg/package.json +2 -2
  56. package/dist/starters/adapters/vercel-edge/README.md +2 -2
  57. package/dist/starters/adapters/vercel-edge/adapters/vercel-edge/{vite.config.mts → vite.config.ts} +1 -1
  58. package/dist/starters/adapters/vercel-edge/package.json +1 -1
  59. package/dist/starters/features/csr/package.json +1 -1
  60. package/dist/testing/index.cjs +2730 -2201
  61. package/dist/testing/index.d.ts +74 -25
  62. package/dist/testing/index.mjs +2664 -2139
  63. package/dist/testing/package.json +1 -1
  64. package/handlers.mjs +1 -1
  65. package/package.json +5 -5
  66. package/public.d.ts +1 -0
  67. /package/dist/starters/features/csr/{vite.config.mts → vite.config.ts} +0 -0
@@ -3,6 +3,7 @@ import * as CSS_2 from 'csstype';
3
3
  import { isBrowser } from './build';
4
4
  import { isDev } from './build';
5
5
  import { isServer } from './build';
6
+ import { JSXNode as JSXNode_2 } from './types/jsx-node';
6
7
  import { QRL as QRL_2 } from './qrl.public';
7
8
 
8
9
  /**
@@ -81,6 +82,11 @@ import { QRL as QRL_2 } from './qrl.public';
81
82
  */
82
83
  export declare const $: <T>(expression: T) => QRL<T>;
83
84
 
85
+ declare interface AddRootFn {
86
+ (obj: unknown, returnRef?: never): number;
87
+ (obj: unknown, returnRef: true): SeenRef;
88
+ }
89
+
84
90
  declare type AllEventKeys = keyof AllEventsMap;
85
91
 
86
92
  declare type AllEventMapRaw = HTMLElementEventMap & DocumentEventMap & WindowEventHandlersEventMap & {
@@ -369,6 +375,7 @@ export declare interface AsyncComputedReadonlySignal<T = unknown> extends Comput
369
375
  loading: boolean;
370
376
  /** The error that occurred while computing the signal. */
371
377
  error: Error | null;
378
+ resolve(): Promise<T>;
372
379
  }
373
380
 
374
381
  /** @public */
@@ -402,6 +409,7 @@ declare class AsyncComputedSignalImpl<T> extends ComputedSignalImpl<T, AsyncComp
402
409
  set untrackedError(value: Error | null);
403
410
  get untrackedError(): Error | null;
404
411
  invalidate(): void;
412
+ resolve(): Promise<T>;
405
413
  $computeIfNeeded$(): boolean | undefined;
406
414
  }
407
415
 
@@ -433,6 +441,13 @@ declare type BivariantQrlFn<ARGS extends any[], RETURN> = {
433
441
  /** @public */
434
442
  declare type Booleanish = boolean | `${boolean}`;
435
443
 
444
+ /**
445
+ * Handles events for bind:checked
446
+ *
447
+ * @internal
448
+ */
449
+ export declare const _chk: (_: any, element: HTMLInputElement) => void;
450
+
436
451
  declare interface Chore<T extends ChoreType = ChoreType> {
437
452
  $type$: T;
438
453
  $idx$: number | string;
@@ -440,7 +455,7 @@ declare interface Chore<T extends ChoreType = ChoreType> {
440
455
  $target$: ChoreTarget | null;
441
456
  $payload$: unknown;
442
457
  $state$: ChoreState;
443
- $blockedChores$: Chore[] | null;
458
+ $blockedChores$: ChoreArray | null;
444
459
  $startTime$: number | undefined;
445
460
  $endTime$: number | undefined;
446
461
  $resolve$: ((value: any) => void) | undefined;
@@ -1015,7 +1030,6 @@ declare interface DeserializeContainer {
1015
1030
  $state$?: unknown[];
1016
1031
  $storeProxyMap$: ObjToProxyMap;
1017
1032
  $forwardRefs$: Array<number> | null;
1018
- $initialQRLs$: Array<string> | null;
1019
1033
  readonly $scheduler$: Scheduler | null;
1020
1034
  }
1021
1035
 
@@ -1049,7 +1063,6 @@ declare class DomContainer extends _SharedContainer implements ClientContainer {
1049
1063
  $qFuncs$: Array<(...args: unknown[]) => unknown>;
1050
1064
  $instanceHash$: string;
1051
1065
  $forwardRefs$: Array<number> | null;
1052
- $initialQRLs$: Array<string> | null;
1053
1066
  vNodeLocate: (id: string | Element) => _VNode;
1054
1067
  private $stateData$;
1055
1068
  private $styleIds$;
@@ -1068,24 +1081,6 @@ declare class DomContainer extends _SharedContainer implements ClientContainer {
1068
1081
  $appendStyle$(content: string, styleId: string, host: _VirtualVNode, scoped: boolean): void;
1069
1082
  /** Set the server data for the Qwik Router. */
1070
1083
  private $setServerData$;
1071
- /**
1072
- * Schedule the initial QRLs to be resolved.
1073
- *
1074
- * Schedules the QRLs that are defined in the state data as `PreloadQRL`.
1075
- *
1076
- * This is done because when computed and custom serializer QRLs are called they need QRL to work.
1077
- * If the QRL is not resolved at this point, it will be resolved by throwing a promise and
1078
- * rerunning the whole wrapping function again. We want to avoid that, because it means that the
1079
- * function can execute twice.
1080
- *
1081
- * ```ts
1082
- * useVisibleTask$(() => {
1083
- * runHeavyLogic(); // This will be called again if the QRL of `computedOrCustomSerializer` is not resolved.
1084
- * console.log(computedOrCustomSerializer.value); // Throw a promise if QRL not resolved and execute visible task again.
1085
- * });
1086
- * ```
1087
- */
1088
- private $scheduleInitialQRLs$;
1089
1084
  }
1090
1085
  export { DomContainer }
1091
1086
  export { DomContainer as _DomContainer }
@@ -1155,9 +1150,9 @@ _SubscriptionData | null
1155
1150
  export declare class _ElementVNode extends _VNode {
1156
1151
  firstChild: _VNode | null | undefined;
1157
1152
  lastChild: _VNode | null | undefined;
1158
- element: Element;
1153
+ element: QElement;
1159
1154
  elementName: string | undefined;
1160
- constructor(flags: _VNodeFlags, parent: _ElementVNode | _VirtualVNode | null, previousSibling: _VNode | null | undefined, nextSibling: _VNode | null | undefined, firstChild: _VNode | null | undefined, lastChild: _VNode | null | undefined, element: Element, elementName: string | undefined);
1155
+ constructor(flags: _VNodeFlags, parent: _ElementVNode | _VirtualVNode | null, previousSibling: _VNode | null | undefined, nextSibling: _VNode | null | undefined, firstChild: _VNode | null | undefined, lastChild: _VNode | null | undefined, element: QElement, elementName: string | undefined);
1161
1156
  }
1162
1157
 
1163
1158
  /** @internal */
@@ -1235,8 +1230,8 @@ export declare type FunctionComponent<P = unknown> = {
1235
1230
  renderFn(props: P, key: string | null, flags: number, dev?: DevJSX): JSXOutput;
1236
1231
  }['renderFn'];
1237
1232
 
1238
- /** @internal */
1239
- export declare const _getConstProps: <T, JSX>(props: PropsProxy | Record<string, unknown> | null | undefined) => Props | null;
1233
+ /** Used by the optimizer for spread props operations @internal */
1234
+ export declare const _getConstProps: (props: PropsProxy | Record<string, unknown> | null | undefined) => Props | null;
1240
1235
 
1241
1236
  /** @internal */
1242
1237
  export declare const _getContextContainer: () => ClientContainer | undefined;
@@ -1279,8 +1274,8 @@ export declare const getPlatform: () => CorePlatform;
1279
1274
  /** @internal */
1280
1275
  export declare function _getQContainerElement(element: Element | _VNode): Element | null;
1281
1276
 
1282
- /** @internal */
1283
- export declare const _getVarProps: <T, JSX>(props: PropsProxy | Record<string, unknown> | null | undefined) => Props | null;
1277
+ /** Used by the optimizer for spread props operations @internal */
1278
+ export declare const _getVarProps: (props: PropsProxy | Record<string, unknown> | null | undefined) => Props | null;
1284
1279
 
1285
1280
  /** @public */
1286
1281
  declare interface GlobalInjections {
@@ -1292,10 +1287,8 @@ declare interface GlobalInjections {
1292
1287
  }
1293
1288
 
1294
1289
  /**
1295
- * The legacy transform, used in special cases like `<div {...props} key="key" />`. Note that the
1296
- * children are spread arguments, instead of a prop like in jsx() calls.
1297
- *
1298
- * Also note that this disables optimizations.
1290
+ * The legacy transform, used by some JSX transpilers. The optimizer normally replaces this with
1291
+ * optimized calls, with the same caveat as `jsx()`.
1299
1292
  *
1300
1293
  * @public
1301
1294
  */
@@ -1431,8 +1424,16 @@ export declare const _IMMUTABLE: unique symbol;
1431
1424
  */
1432
1425
  export declare const implicit$FirstArg: <FIRST, REST extends any[], RET>(fn: (qrl: QRL<FIRST>, ...rest: REST) => RET) => ((qrl: FIRST, ...rest: REST) => RET);
1433
1426
 
1434
- /** @internal */
1435
- export declare const inlinedQrl: <T>(symbol: T, symbolName: string, lexicalScopeCapture?: any[]) => QRL<T>;
1427
+ /**
1428
+ * Create an inlined QRL. This is mostly useful on the server side for serialization.
1429
+ *
1430
+ * @param symbol - The object/function to register, or `null` to retrieve a previously registered
1431
+ * one by hash
1432
+ * @param symbolName - The name of the symbol.
1433
+ * @param lexicalScopeCapture - A set of lexically scoped variables to capture.
1434
+ * @public
1435
+ */
1436
+ export declare const inlinedQrl: <T>(symbol: T | null, symbolName: string, lexicalScopeCapture?: any[]) => QRL<T>;
1436
1437
 
1437
1438
  /** @internal */
1438
1439
  export declare const inlinedQrlDEV: <T = any>(symbol: T, symbolName: string, opts: QRLDev, lexicalScopeCapture?: any[]) => QRL<T>;
@@ -1468,8 +1469,6 @@ declare type IntrinsicSVGElements = {
1468
1469
  /** The shared state during an invoke() call */
1469
1470
  declare interface InvokeContext {
1470
1471
  $url$: URL | undefined;
1471
- /** The next available index for the sequentialScope array */
1472
- $i$: number;
1473
1472
  /** The Virtual parent component for the current component code */
1474
1473
  $hostElement$: HostElement | undefined;
1475
1474
  /** The current DOM element */
@@ -1543,25 +1542,33 @@ export declare function _isStringifiable(value: unknown): value is _Stringifiabl
1543
1542
  export declare const _isTask: (value: any) => value is Task;
1544
1543
 
1545
1544
  /**
1545
+ * Used by the JSX transpilers to create a JSXNode. Note that the optimizer will normally not use
1546
+ * this, instead using _jsxSplit and _jsxSorted directly.
1547
+ *
1548
+ * The optimizer will also replace all `jsx()` calls with the more optimized versions.
1549
+ *
1550
+ * The exception is when the props are not a literal object, which can only happen when the `jsx`
1551
+ * call is written directly.
1552
+ *
1546
1553
  * @public
1547
- * Used by the JSX transpilers to create a JSXNode.
1548
- * Note that the optimizer will not use this, instead using _jsxSplit and _jsxSorted directly.
1549
1554
  */
1550
- declare const jsx: <T extends string | FunctionComponent<any>>(type: T, props: T extends FunctionComponent<infer PROPS> ? PROPS : Props, key?: string | number | null) => JSXNode<T>;
1551
- export { jsx }
1552
- export { jsx as jsxs }
1555
+ export declare const jsx: <T extends string | FunctionComponent<any>>(type: T, props: T extends FunctionComponent<infer PROPS> ? PROPS : Props, key?: string | number | null, _isStatic?: boolean, dev?: JsxDevOpts) => JSXNode<T>;
1553
1556
 
1554
1557
  /** @internal */
1555
1558
  export declare const _jsxBranch: <T>(input?: T) => T | undefined;
1556
1559
 
1557
1560
  /** @internal @deprecated v1 compat */
1558
- export declare const _jsxC: (type: any, mutable: any, _flags: any, key: any) => JSXNode<any>;
1561
+ export declare const _jsxC: (type: any, mutable: any, _flags: any, key: any) => JSXNode_2<any>;
1559
1562
 
1560
1563
  /** @public */
1561
1564
  export declare type JSXChildren = string | number | boolean | null | undefined | Function | RegExp | JSXChildren[] | Promise<JSXChildren> | Signal<JSXChildren> | JSXNode;
1562
1565
 
1563
- /** @public */
1564
- export declare const jsxDEV: <T extends string | FunctionComponent<Props>>(type: T, props: T extends FunctionComponent<infer PROPS> ? PROPS : Props, key: string | number | null | undefined, _isStatic: boolean, opts: JsxDevOpts, _ctx: unknown) => JSXNode<T>;
1566
+ /**
1567
+ * Alias of `jsx` for development purposes.
1568
+ *
1569
+ * @public
1570
+ */
1571
+ export declare const jsxDEV: <T extends string | FunctionComponent<any>>(type: T, props: T extends FunctionComponent<infer PROPS> ? PROPS : Props, key?: string | number | null, _isStatic?: boolean, dev?: JsxDevOpts) => JSXNode<T>;
1565
1572
 
1566
1573
  declare interface JsxDevOpts {
1567
1574
  fileName: string;
@@ -1588,9 +1595,38 @@ export declare interface JSXNode<T extends string | FunctionComponent | unknown
1588
1595
  * @internal
1589
1596
  */
1590
1597
  export declare interface JSXNodeInternal<T extends string | FunctionComponent | unknown = unknown> extends JSXNode<T> {
1591
- varProps: Record<any, unknown>;
1592
- constProps: Record<any, unknown> | null;
1593
- flags: number;
1598
+ /** The type of node */
1599
+ type: T;
1600
+ /** Do the varProps need sorting */
1601
+ toSort: boolean;
1602
+ /** The key property */
1603
+ key: string | null;
1604
+ /**
1605
+ * Props that are not guaranteed shallow equal across runs.
1606
+ *
1607
+ * Any prop that is in `constProps` takes precedence over `varProps`.
1608
+ *
1609
+ * Does not contain `children` or `key`.
1610
+ *
1611
+ * `onEvent$` props are normalized to the html `on:event` version
1612
+ */
1613
+ varProps: Props;
1614
+ /**
1615
+ * Props that will be shallow equal across runs. Does not contain any props that are in varProps.
1616
+ *
1617
+ * Any prop that is in `constProps` takes precedence over `varProps`.
1618
+ *
1619
+ * Does not contain `children` or `key`.
1620
+ *
1621
+ * `onEvent$` props are normalized to the html `on:event` version
1622
+ */
1623
+ constProps: Props | null;
1624
+ /** The children of the node */
1625
+ children: JSXChildren;
1626
+ /** Filename etc for debugging */
1627
+ dev?: DevJSX & {
1628
+ stack: string | undefined;
1629
+ };
1594
1630
  }
1595
1631
 
1596
1632
  /**
@@ -1601,10 +1637,17 @@ export declare interface JSXNodeInternal<T extends string | FunctionComponent |
1601
1637
  export declare type JSXOutput = JSXNode | string | number | boolean | null | undefined | JSXOutput[];
1602
1638
 
1603
1639
  /** @internal @deprecated v1 compat */
1604
- export declare const _jsxQ: (type: any, mutable: any, immutable: any, children: any, _flags: any, key: any) => JSXNode<any>;
1640
+ export declare const _jsxQ: (type: any, mutable: any, immutable: any, children: any, _flags: any, key: any) => JSXNode_2<any>;
1605
1641
 
1606
1642
  /** @internal @deprecated v1 compat */
1607
- export declare const _jsxS: (type: any, mutable: any, immutable: any, _flags: any, key: any) => JSXNode<any>;
1643
+ export declare const _jsxS: (type: any, mutable: any, immutable: any, _flags: any, key: any) => JSXNode_2<any>;
1644
+
1645
+ /**
1646
+ * Alias of `jsx` to support JSX syntax.
1647
+ *
1648
+ * @public
1649
+ */
1650
+ export declare const jsxs: <T extends string | FunctionComponent<any>>(type: T, props: T extends FunctionComponent<infer PROPS> ? PROPS : Props, key?: string | number | null, _isStatic?: boolean, dev?: JsxDevOpts) => JSXNode<T>;
1608
1651
 
1609
1652
  /**
1610
1653
  * Create a JSXNode with the properties fully split into variable and constant parts, and children
@@ -1616,7 +1659,7 @@ export declare const _jsxS: (type: any, mutable: any, immutable: any, _flags: an
1616
1659
  * still update the attribute on the vnode.
1617
1660
  *
1618
1661
  * @param type - The JSX type
1619
- * @param varProps - The properties of the tag, sorted, excluding children, excluding any constProps
1662
+ * @param varProps - The properties of the tag, sorted, excluding children, key and any constProps
1620
1663
  * @param constProps - The properties of the tag that are known to be constant references and don't
1621
1664
  * need checking for changes on re-render
1622
1665
  * @param children - JSX children. Any `children` in the props objects are ignored.
@@ -1626,13 +1669,13 @@ export declare const _jsxSorted: <T>(type: T, varProps: Props | null, constProps
1626
1669
 
1627
1670
  /**
1628
1671
  * Create a JSXNode, with the properties split into variable and constant parts, but the variable
1629
- * parts could include keys from constProps, as well as `key` and `children`.
1672
+ * parts could include keys from `constProps`, as well as `key` and `children`.
1630
1673
  *
1631
- * The constant parts are expected to be the same on every render, and are not checked for changes.
1632
- * This means that they are constant scalars or refs. When the ref is a signal or a store, it can
1633
- * still update the attribute on the vnode.
1674
+ * `constProps` cannot include `key` or `children`. The constant parts are expected to be the same
1675
+ * on every render, and are not checked for changes. This means that they are constant scalars or
1676
+ * refs. When the ref is a signal or a store, it can still update the attribute on the vnode.
1634
1677
  *
1635
- * If `children` is defined, any `children` in the props will be ignored.
1678
+ * If `children` or `key` are defined, any `children`/`key` in the props will be ignored.
1636
1679
  *
1637
1680
  * @param type - The tag type
1638
1681
  * @param varProps - The properties of the tag that could change, including children
@@ -1640,7 +1683,7 @@ export declare const _jsxSorted: <T>(type: T, varProps: Props | null, constProps
1640
1683
  * for changes on re-render
1641
1684
  * @internal
1642
1685
  */
1643
- export declare const _jsxSplit: <T extends string | FunctionComponent<any>>(type: T, varProps: Props | null, constProps: Props | null, children: JSXChildren | null | undefined, flags: number, key: string | number | null, dev?: DevJSX) => JSXNodeInternal<T>;
1686
+ export declare const _jsxSplit: <T extends string | FunctionComponent<any>>(type: T, varProps: Props | null, constProps: Props | null, children: JSXChildren | null | undefined, flags: number, key?: string | number | null, dev?: DevJSX) => JSXNodeInternal<T>;
1644
1687
 
1645
1688
  /** @public */
1646
1689
  export declare type JSXTagName = keyof HTMLElementTagNameMap | Omit<string, keyof HTMLElementTagNameMap>;
@@ -1821,6 +1864,9 @@ export declare interface OnVisibleTaskOptions {
1821
1864
  strategy?: VisibleTaskStrategy;
1822
1865
  }
1823
1866
 
1867
+ /** @internal */
1868
+ declare const _OWNER: unique symbol;
1869
+
1824
1870
  /**
1825
1871
  * Capitalized multi-word names of some known events so we have nicer qwik attributes. For example,
1826
1872
  * instead of `oncompositionEnd$` we can use `onCompositionEnd$`. Note that any capitalization
@@ -1960,6 +2006,7 @@ export declare type PropsOf<COMP> = COMP extends string ? COMP extends keyof Qwi
1960
2006
  declare type PropsProxy = {
1961
2007
  [_VAR_PROPS]: Props;
1962
2008
  [_CONST_PROPS]: Props | null;
2009
+ [_OWNER]: JSXNodeInternal;
1963
2010
  };
1964
2011
 
1965
2012
  declare type PropType<T extends object, P extends keyof T> = P extends keyof T ? T[P] : 'value' extends keyof T ? T['value'] : never;
@@ -1977,6 +2024,11 @@ export declare interface _QDocument extends Document {
1977
2024
  qVNodeData: WeakMap<Element, string>;
1978
2025
  }
1979
2026
 
2027
+ declare interface QElement extends Element {
2028
+ qDispatchEvent?: (event: Event, scope: QwikLoaderEventScope) => boolean;
2029
+ vNode?: _VNode;
2030
+ }
2031
+
1980
2032
  /**
1981
2033
  * The `QRL` type represents a lazy-loadable AND serializable resource.
1982
2034
  *
@@ -2331,6 +2383,8 @@ declare type QwikKnownEventsPlain<EL> = {
2331
2383
  [K in keyof AllPascalEventMaps as `${'document:' | 'window:' | ''}on${K}$`]?: QRLEventHandlerMulti<AllPascalEventMaps[K], EL> | EventHandler<AllPascalEventMaps[K], EL>;
2332
2384
  };
2333
2385
 
2386
+ declare type QwikLoaderEventScope = '-document' | '-window' | '';
2387
+
2334
2388
  /**
2335
2389
  * The metadata of the build. One of its uses is storing where QRL symbols are located.
2336
2390
  *
@@ -2472,7 +2526,12 @@ declare type RefFnInterface<EL> = {
2472
2526
  (el: EL): void;
2473
2527
  };
2474
2528
 
2475
- /** @internal */
2529
+ /**
2530
+ * Register a QRL symbol globally for lookup by its hash. This is used by the optimizer to register
2531
+ * the names passed in `reg_ctx_name`.
2532
+ *
2533
+ * @internal
2534
+ */
2476
2535
  export declare const _regSymbol: (symbol: any, hash: string) => any;
2477
2536
 
2478
2537
  /**
@@ -2658,7 +2717,7 @@ declare interface ResourceReturnInternal<T> {
2658
2717
  export declare const _restProps: (props: PropsProxy, omit?: string[], target?: Props) => Props;
2659
2718
 
2660
2719
  /**
2661
- * This is called by qwik-loader to schedule a QRL. It has to be synchronous.
2720
+ * This is called by qwik-loader to run a QRL. It has to be synchronous.
2662
2721
  *
2663
2722
  * @internal
2664
2723
  */
@@ -2666,10 +2725,10 @@ export declare const _run: (...args: unknown[]) => ValueOrPromise<unknown>;
2666
2725
 
2667
2726
  declare type Scheduler = ReturnType<typeof createScheduler>;
2668
2727
 
2728
+ /** Stores the location of an object. If no parent, it's a root. */
2669
2729
  declare type SeenRef = {
2670
- $parent$: unknown | null;
2671
2730
  $index$: number;
2672
- $rootIndex$: number;
2731
+ $parent$?: SeenRef | null;
2673
2732
  };
2674
2733
 
2675
2734
  /** @public */
@@ -2691,28 +2750,21 @@ declare interface SerializationContext {
2691
2750
  * - `{ parent, index }` - The parent object and the index within that parent.
2692
2751
  * - `undefined` - Object has not been seen yet.
2693
2752
  */
2694
- $wasSeen$: (obj: unknown) => SeenRef | undefined;
2753
+ getSeenRef: (obj: unknown) => SeenRef | undefined;
2754
+ /** Returns the root index of the object, if it is a root. Otherwise returns undefined. */
2695
2755
  $hasRootId$: (obj: unknown) => number | undefined;
2696
2756
  /**
2697
2757
  * Root objects which need to be serialized.
2698
2758
  *
2699
2759
  * Roots are entry points into the object graph. Typically the roots are held by the listeners.
2700
2760
  *
2701
- * Returns a path string representing the path from roots through all parents to the object.
2702
- * Format: "3 2 0" where each number is the index within its parent, from root to leaf.
2703
- */
2704
- $addRoot$: (obj: unknown, parent?: unknown) => number;
2705
- /**
2706
- * Get root path of the object without creating a new root.
2707
- *
2708
- * This is used during serialization, as new roots can't be created during serialization.
2709
- *
2710
- * The function throws if the root was not found.
2761
+ * Returns the index of the root object.
2711
2762
  */
2712
- $addRootPath$: (obj: any) => string | number;
2713
- $seen$: (obj: unknown, parent: unknown | null, index: number) => void;
2763
+ $addRoot$: AddRootFn;
2764
+ /** Mark an object as seen during serialization. This is used to handle backreferences and cycles */
2765
+ $markSeen$: (obj: unknown, parent: SeenRef | undefined, index: number) => SeenRef;
2714
2766
  $roots$: unknown[];
2715
- $objectPathStringCache$: Map<unknown, string | number>;
2767
+ $promoteToRoot$: (ref: SeenRef, index?: number) => void;
2716
2768
  $addSyncFn$($funcStr$: string | null, argsCount: number, fn: Function): number;
2717
2769
  $isSsrNode$: (obj: unknown) => obj is SsrNode;
2718
2770
  $isDomRef$: (obj: unknown) => obj is DomRef;
@@ -2905,6 +2957,7 @@ declare class SignalImpl<T = any> implements Signal<T> {
2905
2957
  /** Store a list of effects which are dependent on this signal. */
2906
2958
  $effects$: null | Set<EffectSubscription>;
2907
2959
  $container$: Container | null;
2960
+ $wrappedSignal$: WrappedSignalImpl<T> | null;
2908
2961
  constructor(container: Container | null, value: T);
2909
2962
  /**
2910
2963
  * Use this to force running subscribers, for example when the calculated value has mutated but
@@ -3201,7 +3254,7 @@ declare type SsrAttrKey = string;
3201
3254
 
3202
3255
  declare type SsrAttrs = Array<SsrAttrKey | SsrAttrValue>;
3203
3256
 
3204
- declare type SsrAttrValue = string | Signal<any> | boolean | object | null;
3257
+ declare type SsrAttrValue = string | Signal<any> | Promise<any> | boolean | object | null;
3205
3258
 
3206
3259
  /** @public */
3207
3260
  export declare const SSRComment: FunctionComponent<{
@@ -3211,6 +3264,7 @@ export declare const SSRComment: FunctionComponent<{
3211
3264
  declare interface SSRContainer extends Container {
3212
3265
  readonly tag: string;
3213
3266
  readonly isHtml: boolean;
3267
+ readonly size: number;
3214
3268
  readonly writer: StreamWriter;
3215
3269
  readonly serializationCtx: SerializationContext;
3216
3270
  readonly symbolToChunkResolver: SymbolToChunkResolver;
@@ -3218,6 +3272,7 @@ declare interface SSRContainer extends Container {
3218
3272
  additionalHeadNodes: Array<JSXNodeInternal>;
3219
3273
  additionalBodyNodes: Array<JSXNodeInternal>;
3220
3274
  unclaimedProjectionComponentFrameQueue: ISsrComponentFrame[];
3275
+ write(text: string): void;
3221
3276
  openContainer(): void;
3222
3277
  closeContainer(): ValueOrPromise<void>;
3223
3278
  openElement(elementName: string, varAttrs: SsrAttrs | null, constAttrs?: SsrAttrs | null, currentFile?: string | null): string | undefined;
@@ -3928,6 +3983,8 @@ export declare const useLexicalScope: <VARS extends any[]>() => VARS;
3928
3983
  * Used to programmatically add event listeners. Useful from custom `use*` methods, which do not
3929
3984
  * have access to the JSX. Otherwise, it's adding a JSX listener in the `<div>` is a better idea.
3930
3985
  *
3986
+ * Events are case sensitive.
3987
+ *
3931
3988
  * @public
3932
3989
  * @see `useOn`, `useOnWindow`, `useOnDocument`.
3933
3990
  */
@@ -3939,6 +3996,8 @@ export declare const useOn: <T extends KnownEventNames>(event: T | T[], eventQrl
3939
3996
  * Used to programmatically add event listeners. Useful from custom `use*` methods, which do not
3940
3997
  * have access to the JSX.
3941
3998
  *
3999
+ * Events are case sensitive.
4000
+ *
3942
4001
  * @public
3943
4002
  * @see `useOn`, `useOnWindow`, `useOnDocument`.
3944
4003
  *
@@ -3966,6 +4025,8 @@ export declare const useOnDocument: <T extends KnownEventNames>(event: T | T[],
3966
4025
  * Used to programmatically add event listeners. Useful from custom `use*` methods, which do not
3967
4026
  * have access to the JSX.
3968
4027
  *
4028
+ * Events are case sensitive.
4029
+ *
3969
4030
  * @public
3970
4031
  * @see `useOn`, `useOnWindow`, `useOnDocument`.
3971
4032
  *
@@ -4345,6 +4406,13 @@ export declare const useVisibleTask$: (fn: TaskFn, opts?: OnVisibleTaskOptions)
4345
4406
  /** @internal */
4346
4407
  export declare const useVisibleTaskQrl: (qrl: QRL<TaskFn>, opts?: OnVisibleTaskOptions) => void;
4347
4408
 
4409
+ /**
4410
+ * Handles events for bind:value
4411
+ *
4412
+ * @internal
4413
+ */
4414
+ export declare const _val: (_: any, element: HTMLInputElement) => void;
4415
+
4348
4416
  /**
4349
4417
  * Type representing a value which is either resolve or a promise.
4350
4418
  *
@@ -4359,7 +4427,7 @@ export declare const _VAR_PROPS: unique symbol;
4359
4427
  export declare const _verifySerializable: <T>(value: T, preMessage?: string) => T;
4360
4428
 
4361
4429
  /**
4362
- * 2.0.0-beta.11-dev+d7daca3
4430
+ * 2.0.0-beta.13-dev+cb19ff7
4363
4431
  *
4364
4432
  * @public
4365
4433
  */
@@ -4511,8 +4579,9 @@ declare const enum VNodeJournalOpCode {
4511
4579
  SetText = 1,// ------ [SetAttribute, target, text]
4512
4580
  SetAttribute = 2,// - [SetAttribute, target, ...(key, values)]]
4513
4581
  HoistStyles = 3,// -- [HoistStyles, document]
4514
- Remove = 4,// ------- [Insert, target(parent), ...nodes]
4515
- Insert = 5
4582
+ Remove = 4,// ------- [Remove, target(parent), ...nodes]
4583
+ RemoveAll = 5,// ------- [RemoveAll, target(parent)]
4584
+ Insert = 6
4516
4585
  }
4517
4586
 
4518
4587
  /** @internal */
@@ -4553,6 +4622,7 @@ declare class WrappedSignalImpl<T> extends SignalImpl<T> implements BackRef {
4553
4622
  force(): void;
4554
4623
  get untrackedValue(): T;
4555
4624
  $computeIfNeeded$(): void;
4625
+ $unwrapIfSignal$(): SignalImpl<T> | WrappedSignalImpl<T>;
4556
4626
  set value(_: any);
4557
4627
  get value(): any;
4558
4628
  }