@qwik.dev/core 2.0.0-beta.10 → 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 (68) 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 +199 -175
  14. package/dist/core.cjs +9262 -8793
  15. package/dist/core.cjs.map +1 -1
  16. package/dist/core.min.mjs +1 -1
  17. package/dist/core.mjs +9259 -8788
  18. package/dist/core.mjs.map +1 -1
  19. package/dist/core.prod.cjs +4825 -4514
  20. package/dist/core.prod.mjs +5165 -4831
  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 +41 -29
  25. package/dist/optimizer.d.ts +4 -1
  26. package/dist/optimizer.mjs +1001 -938
  27. package/dist/qwikloader.debug.js +9 -8
  28. package/dist/qwikloader.js +1 -1
  29. package/dist/server.cjs +487 -402
  30. package/dist/server.d.ts +21 -13
  31. package/dist/server.mjs +468 -387
  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 +4690 -4068
  61. package/dist/testing/index.d.ts +129 -103
  62. package/dist/testing/index.mjs +4509 -3898
  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/server.d.ts +2 -0
  68. /package/dist/starters/features/csr/{vite.config.mts → vite.config.ts} +0 -0
@@ -3,8 +3,8 @@ 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
- import type { StreamWriter as StreamWriter_2 } from '.';
8
8
 
9
9
  /**
10
10
  * Qwik Optimizer marker function.
@@ -82,6 +82,11 @@ import type { StreamWriter as StreamWriter_2 } from '.';
82
82
  */
83
83
  export declare const $: <T>(expression: T) => QRL<T>;
84
84
 
85
+ declare interface AddRootFn {
86
+ (obj: unknown, returnRef?: never): number;
87
+ (obj: unknown, returnRef: true): SeenRef;
88
+ }
89
+
85
90
  declare type AllEventKeys = keyof AllEventsMap;
86
91
 
87
92
  declare type AllEventMapRaw = HTMLElementEventMap & DocumentEventMap & WindowEventHandlersEventMap & {
@@ -370,6 +375,7 @@ export declare interface AsyncComputedReadonlySignal<T = unknown> extends Comput
370
375
  loading: boolean;
371
376
  /** The error that occurred while computing the signal. */
372
377
  error: Error | null;
378
+ resolve(): Promise<T>;
373
379
  }
374
380
 
375
381
  /** @public */
@@ -403,6 +409,7 @@ declare class AsyncComputedSignalImpl<T> extends ComputedSignalImpl<T, AsyncComp
403
409
  set untrackedError(value: Error | null);
404
410
  get untrackedError(): Error | null;
405
411
  invalidate(): void;
412
+ resolve(): Promise<T>;
406
413
  $computeIfNeeded$(): boolean | undefined;
407
414
  }
408
415
 
@@ -434,6 +441,13 @@ declare type BivariantQrlFn<ARGS extends any[], RETURN> = {
434
441
  /** @public */
435
442
  declare type Booleanish = boolean | `${boolean}`;
436
443
 
444
+ /**
445
+ * Handles events for bind:checked
446
+ *
447
+ * @internal
448
+ */
449
+ export declare const _chk: (_: any, element: HTMLInputElement) => void;
450
+
437
451
  declare interface Chore<T extends ChoreType = ChoreType> {
438
452
  $type$: T;
439
453
  $idx$: number | string;
@@ -441,7 +455,7 @@ declare interface Chore<T extends ChoreType = ChoreType> {
441
455
  $target$: ChoreTarget | null;
442
456
  $payload$: unknown;
443
457
  $state$: ChoreState;
444
- $blockedChores$: Chore[] | null;
458
+ $blockedChores$: ChoreArray | null;
445
459
  $startTime$: number | undefined;
446
460
  $endTime$: number | undefined;
447
461
  $resolve$: ((value: any) => void) | undefined;
@@ -449,6 +463,11 @@ declare interface Chore<T extends ChoreType = ChoreType> {
449
463
  $returnValue$: ValueOrPromise<ChoreReturnValue<T>>;
450
464
  }
451
465
 
466
+ declare class ChoreArray extends Array<Chore> {
467
+ add(value: Chore): number;
468
+ delete(value: Chore): number;
469
+ }
470
+
452
471
  declare type ChoreReturnValue<T extends ChoreType = ChoreType> = T extends ChoreType.RECOMPUTE_AND_SCHEDULE_EFFECTS | ChoreType.WAIT_FOR_QUEUE | ChoreType.NODE_PROP ? void : T extends ChoreType.NODE_DIFF | ChoreType.COMPONENT ? JSXOutput : unknown;
453
472
 
454
473
  declare enum ChoreState {
@@ -935,10 +954,10 @@ export declare const createComputedQrl: <T>(qrl: QRL<() => T>, options?: Compute
935
954
  */
936
955
  export declare const createContextId: <STATE = unknown>(name: string) => ContextId<STATE>;
937
956
 
938
- declare const createScheduler: (container: Container, journalFlush: () => void, choreQueue?: Chore[], blockedChores?: Set<Chore>, runningChores?: Set<Chore>) => {
957
+ declare const createScheduler: (container: Container, journalFlush: () => void, choreQueue: ChoreArray, blockedChores: Set<Chore>, runningChores: Set<Chore>) => {
939
958
  (type: ChoreType.QRL_RESOLVE, ignore: null, target: ComputeQRL<any> | AsyncComputeQRL<any>): Chore<ChoreType.QRL_RESOLVE>;
940
959
  (type: ChoreType.WAIT_FOR_QUEUE): Chore<ChoreType.WAIT_FOR_QUEUE>;
941
- (type: ChoreType.RECOMPUTE_AND_SCHEDULE_EFFECTS, host: HostElement | null, target: Signal | StoreHandler, effects: Set<EffectSubscription> | null): Chore<ChoreType.RECOMPUTE_AND_SCHEDULE_EFFECTS>;
960
+ (type: ChoreType.RECOMPUTE_AND_SCHEDULE_EFFECTS, host: HostElement | null, target: Signal<unknown> | StoreTarget, effects: Set<EffectSubscription> | null): Chore<ChoreType.RECOMPUTE_AND_SCHEDULE_EFFECTS>;
942
961
  (type: ChoreType.TASK | ChoreType.VISIBLE, task: Task): Chore<ChoreType.TASK | ChoreType.VISIBLE>;
943
962
  (type: ChoreType.RUN_QRL, host: HostElement, target: QRLInternal<(...args: unknown[]) => unknown>, args: unknown[]): Chore<ChoreType.RUN_QRL>;
944
963
  (type: ChoreType.COMPONENT, host: HostElement, qrl: QRLInternal<OnRenderFn<unknown>>, props: Props | null): Chore<ChoreType.COMPONENT>;
@@ -1011,7 +1030,6 @@ declare interface DeserializeContainer {
1011
1030
  $state$?: unknown[];
1012
1031
  $storeProxyMap$: ObjToProxyMap;
1013
1032
  $forwardRefs$: Array<number> | null;
1014
- $initialQRLs$: Array<string> | null;
1015
1033
  readonly $scheduler$: Scheduler | null;
1016
1034
  }
1017
1035
 
@@ -1045,17 +1063,16 @@ declare class DomContainer extends _SharedContainer implements ClientContainer {
1045
1063
  $qFuncs$: Array<(...args: unknown[]) => unknown>;
1046
1064
  $instanceHash$: string;
1047
1065
  $forwardRefs$: Array<number> | null;
1048
- $initialQRLs$: Array<string> | null;
1049
1066
  vNodeLocate: (id: string | Element) => _VNode;
1050
1067
  private $stateData$;
1051
1068
  private $styleIds$;
1052
1069
  constructor(element: _ContainerElement);
1053
1070
  $setRawState$(id: number, vParent: _ElementVNode | _VirtualVNode): void;
1054
1071
  parseQRL<T = unknown>(qrl: string): QRL<T>;
1055
- handleError(err: any, host: HostElement | null): void;
1056
- setContext<T>(host: HostElement, context: ContextId<T>, value: T): void;
1057
- resolveContext<T>(host: HostElement, contextId: ContextId<T>): T | undefined;
1058
- getParentHost(host: HostElement): HostElement | null;
1072
+ handleError(err: any, host: _VNode | null): void;
1073
+ setContext<T>(host: _VNode, context: ContextId<T>, value: T): void;
1074
+ resolveContext<T>(host: _VNode, contextId: ContextId<T>): T | undefined;
1075
+ getParentHost(host: _VNode): _VNode | null;
1059
1076
  setHostProp<T>(host: HostElement, name: string, value: T): void;
1060
1077
  getHostProp<T>(host: HostElement, name: string): T | null;
1061
1078
  ensureProjectionResolved(vNode: _VirtualVNode): void;
@@ -1064,24 +1081,6 @@ declare class DomContainer extends _SharedContainer implements ClientContainer {
1064
1081
  $appendStyle$(content: string, styleId: string, host: _VirtualVNode, scoped: boolean): void;
1065
1082
  /** Set the server data for the Qwik Router. */
1066
1083
  private $setServerData$;
1067
- /**
1068
- * Schedule the initial QRLs to be resolved.
1069
- *
1070
- * Schedules the QRLs that are defined in the state data as `PreloadQRL`.
1071
- *
1072
- * This is done because when computed and custom serializer QRLs are called they need QRL to work.
1073
- * If the QRL is not resolved at this point, it will be resolved by throwing a promise and
1074
- * rerunning the whole wrapping function again. We want to avoid that, because it means that the
1075
- * function can execute twice.
1076
- *
1077
- * ```ts
1078
- * useVisibleTask$(() => {
1079
- * runHeavyLogic(); // This will be called again if the QRL of `computedOrCustomSerializer` is not resolved.
1080
- * console.log(computedOrCustomSerializer.value); // Throw a promise if QRL not resolved and execute visible task again.
1081
- * });
1082
- * ```
1083
- */
1084
- private $scheduleInitialQRLs$;
1085
1084
  }
1086
1085
  export { DomContainer }
1087
1086
  export { DomContainer as _DomContainer }
@@ -1148,25 +1147,13 @@ _SubscriptionData | null
1148
1147
  ];
1149
1148
 
1150
1149
  /** @internal */
1151
- export declare type _ElementVNode = [
1152
- _VNodeFlags.Element,
1153
- ////////////// 0 - Flags
1154
- _VNode | null,
1155
- /////////////// 1 - Parent
1156
- _VNode | null,
1157
- /////////////// 2 - Previous sibling
1158
- _VNode | null,
1159
- /////////////// 3 - Next sibling
1160
- _VNode | null | undefined,
1161
- /// 4 - First child - undefined if children need to be materialize
1162
- _VNode | null | undefined,
1163
- Element,
1164
- //////////////////// 6 - Element
1165
- string | undefined,
1166
- (string | null)[]
1167
- ] & {
1168
- __brand__: 'ElementVNode';
1169
- };
1150
+ export declare class _ElementVNode extends _VNode {
1151
+ firstChild: _VNode | null | undefined;
1152
+ lastChild: _VNode | null | undefined;
1153
+ element: QElement;
1154
+ 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);
1156
+ }
1170
1157
 
1171
1158
  /** @internal */
1172
1159
  export declare const _EMPTY_ARRAY: any[];
@@ -1243,8 +1230,8 @@ export declare type FunctionComponent<P = unknown> = {
1243
1230
  renderFn(props: P, key: string | null, flags: number, dev?: DevJSX): JSXOutput;
1244
1231
  }['renderFn'];
1245
1232
 
1246
- /** @internal */
1247
- 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;
1248
1235
 
1249
1236
  /** @internal */
1250
1237
  export declare const _getContextContainer: () => ClientContainer | undefined;
@@ -1287,8 +1274,8 @@ export declare const getPlatform: () => CorePlatform;
1287
1274
  /** @internal */
1288
1275
  export declare function _getQContainerElement(element: Element | _VNode): Element | null;
1289
1276
 
1290
- /** @internal */
1291
- 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;
1292
1279
 
1293
1280
  /** @public */
1294
1281
  declare interface GlobalInjections {
@@ -1300,10 +1287,8 @@ declare interface GlobalInjections {
1300
1287
  }
1301
1288
 
1302
1289
  /**
1303
- * The legacy transform, used in special cases like `<div {...props} key="key" />`. Note that the
1304
- * children are spread arguments, instead of a prop like in jsx() calls.
1305
- *
1306
- * 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()`.
1307
1292
  *
1308
1293
  * @public
1309
1294
  */
@@ -1439,8 +1424,16 @@ export declare const _IMMUTABLE: unique symbol;
1439
1424
  */
1440
1425
  export declare const implicit$FirstArg: <FIRST, REST extends any[], RET>(fn: (qrl: QRL<FIRST>, ...rest: REST) => RET) => ((qrl: FIRST, ...rest: REST) => RET);
1441
1426
 
1442
- /** @internal */
1443
- 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>;
1444
1437
 
1445
1438
  /** @internal */
1446
1439
  export declare const inlinedQrlDEV: <T = any>(symbol: T, symbolName: string, opts: QRLDev, lexicalScopeCapture?: any[]) => QRL<T>;
@@ -1476,8 +1469,6 @@ declare type IntrinsicSVGElements = {
1476
1469
  /** The shared state during an invoke() call */
1477
1470
  declare interface InvokeContext {
1478
1471
  $url$: URL | undefined;
1479
- /** The next available index for the sequentialScope array */
1480
- $i$: number;
1481
1472
  /** The Virtual parent component for the current component code */
1482
1473
  $hostElement$: HostElement | undefined;
1483
1474
  /** The current DOM element */
@@ -1551,25 +1542,33 @@ export declare function _isStringifiable(value: unknown): value is _Stringifiabl
1551
1542
  export declare const _isTask: (value: any) => value is Task;
1552
1543
 
1553
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
+ *
1554
1553
  * @public
1555
- * Used by the JSX transpilers to create a JSXNode.
1556
- * Note that the optimizer will not use this, instead using _jsxSplit and _jsxSorted directly.
1557
1554
  */
1558
- declare const jsx: <T extends string | FunctionComponent<any>>(type: T, props: T extends FunctionComponent<infer PROPS> ? PROPS : Props, key?: string | number | null) => JSXNode<T>;
1559
- export { jsx }
1560
- 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>;
1561
1556
 
1562
1557
  /** @internal */
1563
1558
  export declare const _jsxBranch: <T>(input?: T) => T | undefined;
1564
1559
 
1565
1560
  /** @internal @deprecated v1 compat */
1566
- 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>;
1567
1562
 
1568
1563
  /** @public */
1569
1564
  export declare type JSXChildren = string | number | boolean | null | undefined | Function | RegExp | JSXChildren[] | Promise<JSXChildren> | Signal<JSXChildren> | JSXNode;
1570
1565
 
1571
- /** @public */
1572
- 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>;
1573
1572
 
1574
1573
  declare interface JsxDevOpts {
1575
1574
  fileName: string;
@@ -1596,9 +1595,38 @@ export declare interface JSXNode<T extends string | FunctionComponent | unknown
1596
1595
  * @internal
1597
1596
  */
1598
1597
  export declare interface JSXNodeInternal<T extends string | FunctionComponent | unknown = unknown> extends JSXNode<T> {
1599
- varProps: Record<any, unknown>;
1600
- constProps: Record<any, unknown> | null;
1601
- 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
+ };
1602
1630
  }
1603
1631
 
1604
1632
  /**
@@ -1609,10 +1637,17 @@ export declare interface JSXNodeInternal<T extends string | FunctionComponent |
1609
1637
  export declare type JSXOutput = JSXNode | string | number | boolean | null | undefined | JSXOutput[];
1610
1638
 
1611
1639
  /** @internal @deprecated v1 compat */
1612
- 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>;
1613
1641
 
1614
1642
  /** @internal @deprecated v1 compat */
1615
- 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>;
1616
1651
 
1617
1652
  /**
1618
1653
  * Create a JSXNode with the properties fully split into variable and constant parts, and children
@@ -1624,7 +1659,7 @@ export declare const _jsxS: (type: any, mutable: any, immutable: any, _flags: an
1624
1659
  * still update the attribute on the vnode.
1625
1660
  *
1626
1661
  * @param type - The JSX type
1627
- * @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
1628
1663
  * @param constProps - The properties of the tag that are known to be constant references and don't
1629
1664
  * need checking for changes on re-render
1630
1665
  * @param children - JSX children. Any `children` in the props objects are ignored.
@@ -1634,13 +1669,13 @@ export declare const _jsxSorted: <T>(type: T, varProps: Props | null, constProps
1634
1669
 
1635
1670
  /**
1636
1671
  * Create a JSXNode, with the properties split into variable and constant parts, but the variable
1637
- * 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`.
1638
1673
  *
1639
- * The constant parts are expected to be the same on every render, and are not checked for changes.
1640
- * This means that they are constant scalars or refs. When the ref is a signal or a store, it can
1641
- * 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.
1642
1677
  *
1643
- * 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.
1644
1679
  *
1645
1680
  * @param type - The tag type
1646
1681
  * @param varProps - The properties of the tag that could change, including children
@@ -1648,7 +1683,7 @@ export declare const _jsxSorted: <T>(type: T, varProps: Props | null, constProps
1648
1683
  * for changes on re-render
1649
1684
  * @internal
1650
1685
  */
1651
- 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>;
1652
1687
 
1653
1688
  /** @public */
1654
1689
  export declare type JSXTagName = keyof HTMLElementTagNameMap | Omit<string, keyof HTMLElementTagNameMap>;
@@ -1829,6 +1864,9 @@ export declare interface OnVisibleTaskOptions {
1829
1864
  strategy?: VisibleTaskStrategy;
1830
1865
  }
1831
1866
 
1867
+ /** @internal */
1868
+ declare const _OWNER: unique symbol;
1869
+
1832
1870
  /**
1833
1871
  * Capitalized multi-word names of some known events so we have nicer qwik attributes. For example,
1834
1872
  * instead of `oncompositionEnd$` we can use `onCompositionEnd$`. Note that any capitalization
@@ -1968,8 +2006,11 @@ export declare type PropsOf<COMP> = COMP extends string ? COMP extends keyof Qwi
1968
2006
  declare type PropsProxy = {
1969
2007
  [_VAR_PROPS]: Props;
1970
2008
  [_CONST_PROPS]: Props | null;
2009
+ [_OWNER]: JSXNodeInternal;
1971
2010
  };
1972
2011
 
2012
+ declare type PropType<T extends object, P extends keyof T> = P extends keyof T ? T[P] : 'value' extends keyof T ? T['value'] : never;
2013
+
1973
2014
  /**
1974
2015
  * Extends the defined component PROPS, adding the default ones (children and q:slot) and allowing
1975
2016
  * plain functions to QRL arguments.
@@ -1983,6 +2024,11 @@ export declare interface _QDocument extends Document {
1983
2024
  qVNodeData: WeakMap<Element, string>;
1984
2025
  }
1985
2026
 
2027
+ declare interface QElement extends Element {
2028
+ qDispatchEvent?: (event: Event, scope: QwikLoaderEventScope) => boolean;
2029
+ vNode?: _VNode;
2030
+ }
2031
+
1986
2032
  /**
1987
2033
  * The `QRL` type represents a lazy-loadable AND serializable resource.
1988
2034
  *
@@ -2337,6 +2383,8 @@ declare type QwikKnownEventsPlain<EL> = {
2337
2383
  [K in keyof AllPascalEventMaps as `${'document:' | 'window:' | ''}on${K}$`]?: QRLEventHandlerMulti<AllPascalEventMaps[K], EL> | EventHandler<AllPascalEventMaps[K], EL>;
2338
2384
  };
2339
2385
 
2386
+ declare type QwikLoaderEventScope = '-document' | '-window' | '';
2387
+
2340
2388
  /**
2341
2389
  * The metadata of the build. One of its uses is storing where QRL symbols are located.
2342
2390
  *
@@ -2478,7 +2526,12 @@ declare type RefFnInterface<EL> = {
2478
2526
  (el: EL): void;
2479
2527
  };
2480
2528
 
2481
- /** @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
+ */
2482
2535
  export declare const _regSymbol: (symbol: any, hash: string) => any;
2483
2536
 
2484
2537
  /**
@@ -2504,6 +2557,8 @@ export declare const RenderOnce: FunctionComponent<{
2504
2557
  key?: string | number | null | undefined;
2505
2558
  }>;
2506
2559
 
2560
+ /** @internal */
2561
+ /** @internal */
2507
2562
  /** @public */
2508
2563
  export declare interface RenderOptions {
2509
2564
  serverData?: Record<string, any>;
@@ -2662,7 +2717,7 @@ declare interface ResourceReturnInternal<T> {
2662
2717
  export declare const _restProps: (props: PropsProxy, omit?: string[], target?: Props) => Props;
2663
2718
 
2664
2719
  /**
2665
- * 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.
2666
2721
  *
2667
2722
  * @internal
2668
2723
  */
@@ -2670,10 +2725,10 @@ export declare const _run: (...args: unknown[]) => ValueOrPromise<unknown>;
2670
2725
 
2671
2726
  declare type Scheduler = ReturnType<typeof createScheduler>;
2672
2727
 
2728
+ /** Stores the location of an object. If no parent, it's a root. */
2673
2729
  declare type SeenRef = {
2674
- $parent$: unknown | null;
2675
2730
  $index$: number;
2676
- $rootIndex$: number;
2731
+ $parent$?: SeenRef | null;
2677
2732
  };
2678
2733
 
2679
2734
  /** @public */
@@ -2695,32 +2750,25 @@ declare interface SerializationContext {
2695
2750
  * - `{ parent, index }` - The parent object and the index within that parent.
2696
2751
  * - `undefined` - Object has not been seen yet.
2697
2752
  */
2698
- $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. */
2699
2755
  $hasRootId$: (obj: unknown) => number | undefined;
2700
2756
  /**
2701
2757
  * Root objects which need to be serialized.
2702
2758
  *
2703
2759
  * Roots are entry points into the object graph. Typically the roots are held by the listeners.
2704
2760
  *
2705
- * Returns a path string representing the path from roots through all parents to the object.
2706
- * Format: "3 2 0" where each number is the index within its parent, from root to leaf.
2707
- */
2708
- $addRoot$: (obj: unknown, parent?: unknown) => number;
2709
- /**
2710
- * Get root path of the object without creating a new root.
2711
- *
2712
- * This is used during serialization, as new roots can't be created during serialization.
2713
- *
2714
- * The function throws if the root was not found.
2761
+ * Returns the index of the root object.
2715
2762
  */
2716
- $addRootPath$: (obj: any) => string | number;
2717
- $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;
2718
2766
  $roots$: unknown[];
2719
- $objectPathStringCache$: Map<unknown, string | number>;
2767
+ $promoteToRoot$: (ref: SeenRef, index?: number) => void;
2720
2768
  $addSyncFn$($funcStr$: string | null, argsCount: number, fn: Function): number;
2721
2769
  $isSsrNode$: (obj: unknown) => obj is SsrNode;
2722
2770
  $isDomRef$: (obj: unknown) => obj is DomRef;
2723
- $writer$: StreamWriter_2;
2771
+ $writer$: StreamWriter;
2724
2772
  $syncFns$: string[];
2725
2773
  $eventQrls$: Set<QRL>;
2726
2774
  $eventNames$: Set<string>;
@@ -2739,14 +2787,6 @@ declare const enum SerializationSignalFlags {
2739
2787
  /** @public */
2740
2788
  export declare type SerializationStrategy = 'never' | 'always';
2741
2789
 
2742
- declare class SerializationWeakRef {
2743
- $obj$: unknown;
2744
- constructor($obj$: unknown);
2745
- }
2746
-
2747
- /** @internal */
2748
- export declare const _serializationWeakRef: (obj: unknown) => SerializationWeakRef;
2749
-
2750
2790
  /**
2751
2791
  * Serialize data to string using SerializationContext.
2752
2792
  *
@@ -2917,6 +2957,7 @@ declare class SignalImpl<T = any> implements Signal<T> {
2917
2957
  /** Store a list of effects which are dependent on this signal. */
2918
2958
  $effects$: null | Set<EffectSubscription>;
2919
2959
  $container$: Container | null;
2960
+ $wrappedSignal$: WrappedSignalImpl<T> | null;
2920
2961
  constructor(container: Container | null, value: T);
2921
2962
  /**
2922
2963
  * Use this to force running subscribers, for example when the calculated value has mutated but
@@ -3213,7 +3254,7 @@ declare type SsrAttrKey = string;
3213
3254
 
3214
3255
  declare type SsrAttrs = Array<SsrAttrKey | SsrAttrValue>;
3215
3256
 
3216
- declare type SsrAttrValue = string | Signal<any> | boolean | object | null;
3257
+ declare type SsrAttrValue = string | Signal<any> | Promise<any> | boolean | object | null;
3217
3258
 
3218
3259
  /** @public */
3219
3260
  export declare const SSRComment: FunctionComponent<{
@@ -3223,6 +3264,7 @@ export declare const SSRComment: FunctionComponent<{
3223
3264
  declare interface SSRContainer extends Container {
3224
3265
  readonly tag: string;
3225
3266
  readonly isHtml: boolean;
3267
+ readonly size: number;
3226
3268
  readonly writer: StreamWriter;
3227
3269
  readonly serializationCtx: SerializationContext;
3228
3270
  readonly symbolToChunkResolver: SymbolToChunkResolver;
@@ -3230,6 +3272,7 @@ declare interface SSRContainer extends Container {
3230
3272
  additionalHeadNodes: Array<JSXNodeInternal>;
3231
3273
  additionalBodyNodes: Array<JSXNodeInternal>;
3232
3274
  unclaimedProjectionComponentFrameQueue: ISsrComponentFrame[];
3275
+ write(text: string): void;
3233
3276
  openContainer(): void;
3234
3277
  closeContainer(): ValueOrPromise<void>;
3235
3278
  openElement(elementName: string, varAttrs: SsrAttrs | null, constAttrs?: SsrAttrs | null, currentFile?: string | null): string | undefined;
@@ -3303,28 +3346,6 @@ declare type StopPropagation = {
3303
3346
  [K in keyof HTMLElementEventMap as `stoppropagation:${K}`]?: boolean;
3304
3347
  };
3305
3348
 
3306
- declare const enum StoreFlags {
3307
- NONE = 0,
3308
- RECURSIVE = 1,
3309
- IMMUTABLE = 2
3310
- }
3311
-
3312
- declare class StoreHandler implements ProxyHandler<StoreTarget> {
3313
- $flags$: StoreFlags;
3314
- $container$: Container | null;
3315
- $effects$: null | Map<string | symbol, Set<EffectSubscription>>;
3316
- constructor($flags$: StoreFlags, $container$: Container | null);
3317
- toString(): string;
3318
- force(prop: keyof StoreTarget): void;
3319
- get(target: StoreTarget, prop: string | symbol): any;
3320
- /** In the case of oldValue and value are the same, the effects are not triggered. */
3321
- set(target: StoreTarget, prop: string | symbol, value: any): boolean;
3322
- deleteProperty(target: StoreTarget, prop: string | symbol): boolean;
3323
- has(target: StoreTarget, prop: string | symbol): boolean;
3324
- ownKeys(target: StoreTarget): ArrayLike<string | symbol>;
3325
- getOwnPropertyDescriptor(target: StoreTarget, prop: string | symbol): PropertyDescriptor | undefined;
3326
- }
3327
-
3328
3349
  declare type StoreTarget = Record<string | symbol, any>;
3329
3350
 
3330
3351
  /** @internal */
@@ -3680,20 +3701,11 @@ declare const TaskEvent = "qTask";
3680
3701
  export declare type TaskFn = (ctx: TaskCtx) => ValueOrPromise<void | (() => void)>;
3681
3702
 
3682
3703
  /** @internal */
3683
- export declare type _TextVNode = [
3684
- _VNodeFlags.Text | _VNodeFlags.Inflated,
3685
- // 0 - Flags
3686
- _VNode | null,
3687
- ///////////////// 1 - Parent
3688
- _VNode | null,
3689
- ///////////////// 2 - Previous sibling
3690
- _VNode | null,
3691
- ///////////////// 3 - Next sibling
3692
- Text | null | undefined,
3693
- string
3694
- ] & {
3695
- __brand__: 'TextVNode';
3696
- };
3704
+ export declare class _TextVNode extends _VNode {
3705
+ textNode: Text | null;
3706
+ text: string | undefined;
3707
+ constructor(flags: _VNodeFlags, parent: _ElementVNode | _VirtualVNode | null, previousSibling: _VNode | null | undefined, nextSibling: _VNode | null | undefined, textNode: Text | null, text: string | undefined);
3708
+ }
3697
3709
 
3698
3710
  /**
3699
3711
  * Used to signal to Qwik which state should be watched for changes.
@@ -3971,6 +3983,8 @@ export declare const useLexicalScope: <VARS extends any[]>() => VARS;
3971
3983
  * Used to programmatically add event listeners. Useful from custom `use*` methods, which do not
3972
3984
  * have access to the JSX. Otherwise, it's adding a JSX listener in the `<div>` is a better idea.
3973
3985
  *
3986
+ * Events are case sensitive.
3987
+ *
3974
3988
  * @public
3975
3989
  * @see `useOn`, `useOnWindow`, `useOnDocument`.
3976
3990
  */
@@ -3982,6 +3996,8 @@ export declare const useOn: <T extends KnownEventNames>(event: T | T[], eventQrl
3982
3996
  * Used to programmatically add event listeners. Useful from custom `use*` methods, which do not
3983
3997
  * have access to the JSX.
3984
3998
  *
3999
+ * Events are case sensitive.
4000
+ *
3985
4001
  * @public
3986
4002
  * @see `useOn`, `useOnWindow`, `useOnDocument`.
3987
4003
  *
@@ -4009,6 +4025,8 @@ export declare const useOnDocument: <T extends KnownEventNames>(event: T | T[],
4009
4025
  * Used to programmatically add event listeners. Useful from custom `use*` methods, which do not
4010
4026
  * have access to the JSX.
4011
4027
  *
4028
+ * Events are case sensitive.
4029
+ *
4012
4030
  * @public
4013
4031
  * @see `useOn`, `useOnWindow`, `useOnDocument`.
4014
4032
  *
@@ -4388,6 +4406,13 @@ export declare const useVisibleTask$: (fn: TaskFn, opts?: OnVisibleTaskOptions)
4388
4406
  /** @internal */
4389
4407
  export declare const useVisibleTaskQrl: (qrl: QRL<TaskFn>, opts?: OnVisibleTaskOptions) => void;
4390
4408
 
4409
+ /**
4410
+ * Handles events for bind:value
4411
+ *
4412
+ * @internal
4413
+ */
4414
+ export declare const _val: (_: any, element: HTMLInputElement) => void;
4415
+
4391
4416
  /**
4392
4417
  * Type representing a value which is either resolve or a promise.
4393
4418
  *
@@ -4402,42 +4427,43 @@ export declare const _VAR_PROPS: unique symbol;
4402
4427
  export declare const _verifySerializable: <T>(value: T, preMessage?: string) => T;
4403
4428
 
4404
4429
  /**
4405
- * 2.0.0-beta.10-dev+4669425
4430
+ * 2.0.0-beta.13-dev+cb19ff7
4406
4431
  *
4407
4432
  * @public
4408
4433
  */
4409
4434
  export declare const version: string;
4410
4435
 
4411
4436
  /** @internal */
4412
- export declare type _VirtualVNode = [
4413
- _VNodeFlags.Virtual,
4414
- ///////////// 0 - Flags
4415
- _VNode | null,
4416
- /////////////// 1 - Parent
4417
- _VNode | null,
4418
- /////////////// 2 - Previous sibling
4419
- _VNode | null,
4420
- /////////////// 3 - Next sibling
4421
- _VNode | null,
4422
- /////////////// 4 - First child
4423
- _VNode | null,
4424
- (string | null | boolean)[]
4425
- ] & {
4426
- __brand__: 'FragmentNode' & 'HostElement';
4427
- };
4437
+ export declare class _VirtualVNode extends _VNode {
4438
+ firstChild: _VNode | null | undefined;
4439
+ lastChild: _VNode | null | undefined;
4440
+ constructor(flags: _VNodeFlags, parent: _ElementVNode | _VirtualVNode | null, previousSibling: _VNode | null | undefined, nextSibling: _VNode | null | undefined, firstChild: _VNode | null | undefined, lastChild: _VNode | null | undefined);
4441
+ }
4428
4442
 
4429
4443
  /** @public */
4430
4444
  export declare type VisibleTaskStrategy = 'intersection-observer' | 'document-ready' | 'document-idle';
4431
4445
 
4432
4446
  /** @internal */
4433
- export declare type _VNode = _ElementVNode | _TextVNode | _VirtualVNode;
4447
+ export declare abstract class _VNode extends BackRef {
4448
+ flags: _VNodeFlags;
4449
+ parent: _ElementVNode | _VirtualVNode | null;
4450
+ previousSibling: _VNode | null | undefined;
4451
+ nextSibling: _VNode | null | undefined;
4452
+ props: unknown[] | null;
4453
+ slotParent: _VNode | null;
4454
+ chores: ChoreArray | null;
4455
+ blockedChores: ChoreArray | null;
4456
+ constructor(flags: _VNodeFlags, parent: _ElementVNode | _VirtualVNode | null, previousSibling: _VNode | null | undefined, nextSibling: _VNode | null | undefined);
4457
+ getProp<T>(key: string, getObject: ((id: string) => any) | null): T | null;
4458
+ setProp(key: string, value: any): void;
4459
+ getAttr(key: string): string | null;
4460
+ setAttr(key: string, value: string | null | boolean, journal: VNodeJournal | null): void;
4461
+ toString(): string;
4462
+ }
4434
4463
 
4435
4464
  /** @internal */
4436
4465
  export declare const _vnode_ensureElementInflated: (vnode: _VNode) => void;
4437
4466
 
4438
- /** @internal */
4439
- export declare const _vnode_getAttr: (vnode: _VNode, key: string) => string | null;
4440
-
4441
4467
  /** @internal */
4442
4468
  export declare const _vnode_getAttrKeys: (vnode: _ElementVNode | _VirtualVNode) => string[];
4443
4469
 
@@ -4445,13 +4471,7 @@ export declare const _vnode_getAttrKeys: (vnode: _ElementVNode | _VirtualVNode)
4445
4471
  export declare const _vnode_getFirstChild: (vnode: _VNode) => _VNode | null;
4446
4472
 
4447
4473
  /** @internal */
4448
- export declare const _vnode_getNextSibling: (vnode: _VNode) => _VNode | null;
4449
-
4450
- /** @internal */
4451
- export declare const _vnode_getProps: (vnode: _VNode) => unknown[];
4452
-
4453
- /** @internal */
4454
- export declare const _vnode_getPropStartIndex: (vnode: _VNode) => number;
4474
+ export declare const _vnode_getProps: (vnode: _ElementVNode | _VirtualVNode) => unknown[];
4455
4475
 
4456
4476
  /** @internal */
4457
4477
  export declare const _vnode_isMaterialized: (vNode: _VNode) => boolean;
@@ -4559,8 +4579,9 @@ declare const enum VNodeJournalOpCode {
4559
4579
  SetText = 1,// ------ [SetAttribute, target, text]
4560
4580
  SetAttribute = 2,// - [SetAttribute, target, ...(key, values)]]
4561
4581
  HoistStyles = 3,// -- [HoistStyles, document]
4562
- Remove = 4,// ------- [Insert, target(parent), ...nodes]
4563
- Insert = 5
4582
+ Remove = 4,// ------- [Remove, target(parent), ...nodes]
4583
+ RemoveAll = 5,// ------- [RemoveAll, target(parent)]
4584
+ Insert = 6
4564
4585
  }
4565
4586
 
4566
4587
  /** @internal */
@@ -4579,6 +4600,8 @@ export declare function _walkJSX(ssr: SSRContainer, value: JSXOutput, options: {
4579
4600
  */
4580
4601
  export declare function withLocale<T>(locale: string, fn: () => T): T;
4581
4602
 
4603
+ declare type WrappedProp<T extends object, P extends keyof T> = T extends Signal ? WrappedSignalImpl<PropType<T, P>> : PropType<T, P>;
4604
+
4582
4605
  declare const enum WrappedSignalFlags {
4583
4606
  UNWRAP = 4
4584
4607
  }
@@ -4599,6 +4622,7 @@ declare class WrappedSignalImpl<T> extends SignalImpl<T> implements BackRef {
4599
4622
  force(): void;
4600
4623
  get untrackedValue(): T;
4601
4624
  $computeIfNeeded$(): void;
4625
+ $unwrapIfSignal$(): SignalImpl<T> | WrappedSignalImpl<T>;
4602
4626
  set value(_: any);
4603
4627
  get value(): any;
4604
4628
  }
@@ -4614,9 +4638,9 @@ declare class WrappedSignalImpl<T> extends SignalImpl<T> implements BackRef {
4614
4638
  *
4615
4639
  * @internal
4616
4640
  */
4617
- export declare const _wrapProp: <T extends Record<any, any>, P extends keyof T>(...args: [T, P?]) => any;
4641
+ export declare const _wrapProp: <T extends object, P extends keyof T>(...args: [T, P?]) => WrappedProp<T, P>;
4618
4642
 
4619
4643
  /** @internal @deprecated v1 compat */
4620
- export declare const _wrapSignal: <T extends Record<any, any>, P extends keyof T>(obj: T, prop: P) => any;
4644
+ export declare const _wrapSignal: <T extends object, P extends keyof T>(obj: T, prop: P) => T[P] | WrappedProp<T, P>;
4621
4645
 
4622
4646
  export { }