@qwik.dev/core 2.0.0-beta.1 → 2.0.0-beta.10

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 (99) 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 +6 -0
  7. package/dist/backpatch/index.d.ts +2 -0
  8. package/dist/backpatch/index.mjs +5 -0
  9. package/dist/backpatch/package.json +8 -0
  10. package/dist/backpatch-executor.debug.js +34 -0
  11. package/dist/backpatch-executor.js +1 -0
  12. package/dist/build/package.json +1 -1
  13. package/dist/cli.cjs +3031 -763
  14. package/dist/core-internal.d.ts +253 -78
  15. package/dist/core.cjs +1770 -957
  16. package/dist/core.cjs.map +1 -1
  17. package/dist/core.min.mjs +1 -1
  18. package/dist/core.mjs +1745 -955
  19. package/dist/core.mjs.map +1 -1
  20. package/dist/core.prod.cjs +1368 -949
  21. package/dist/core.prod.mjs +1435 -951
  22. package/dist/insights/vite/index.cjs +1 -1
  23. package/dist/insights/vite/index.mjs +10 -10
  24. package/dist/loader/index.cjs +2 -2
  25. package/dist/loader/index.mjs +2 -2
  26. package/dist/loader/package.json +1 -1
  27. package/dist/optimizer.cjs +201 -4016
  28. package/dist/optimizer.d.ts +12 -37
  29. package/dist/optimizer.mjs +2539 -3715
  30. package/dist/preloader.cjs +8 -11
  31. package/dist/preloader.mjs +8 -11
  32. package/dist/qwikloader.debug.js +1 -15
  33. package/dist/qwikloader.js +1 -1
  34. package/dist/server.cjs +309 -116
  35. package/dist/server.d.ts +17 -2
  36. package/dist/server.mjs +291 -103
  37. package/dist/starters/adapters/aws-lambda/adapters/aws-lambda/vite.config.mts +1 -1
  38. package/dist/starters/adapters/aws-lambda/package.json +1 -1
  39. package/dist/starters/adapters/aws-lambda/src/entry_aws-lambda.tsx +2 -6
  40. package/dist/starters/adapters/azure-swa/adapters/azure-swa/vite.config.mts +1 -1
  41. package/dist/starters/adapters/azure-swa/package.json +1 -1
  42. package/dist/starters/adapters/azure-swa/src/entry.azure-swa.tsx +2 -3
  43. package/dist/starters/adapters/bun/adapters/bun/vite.config.mts +2 -2
  44. package/dist/starters/adapters/bun/package.json +1 -1
  45. package/dist/starters/adapters/bun/src/entry.bun.ts +0 -2
  46. package/dist/starters/adapters/cloud-run/adapters/cloud-run/vite.config.mts +1 -1
  47. package/dist/starters/adapters/cloud-run/package.json +1 -1
  48. package/dist/starters/adapters/cloud-run/src/entry.cloud-run.tsx +1 -3
  49. package/dist/starters/adapters/cloudflare-pages/adapters/cloudflare-pages/vite.config.mts +1 -1
  50. package/dist/starters/adapters/cloudflare-pages/package.json +1 -1
  51. package/dist/starters/adapters/cloudflare-pages/src/entry.cloudflare-pages.tsx +2 -3
  52. package/dist/starters/adapters/deno/adapters/deno/vite.config.mts +1 -1
  53. package/dist/starters/adapters/deno/package.json +1 -1
  54. package/dist/starters/adapters/deno/src/entry.deno.ts +0 -2
  55. package/dist/starters/adapters/express/adapters/express/vite.config.mts +1 -1
  56. package/dist/starters/adapters/express/package.json +1 -1
  57. package/dist/starters/adapters/express/src/entry.express.tsx +1 -3
  58. package/dist/starters/adapters/fastify/adapters/fastify/vite.config.mts +1 -1
  59. package/dist/starters/adapters/fastify/package.json +1 -1
  60. package/dist/starters/adapters/fastify/src/entry.fastify.tsx +1 -1
  61. package/dist/starters/adapters/fastify/src/plugins/fastify-qwik.ts +1 -2
  62. package/dist/starters/adapters/firebase/adapters/firebase/vite.config.mts +1 -1
  63. package/dist/starters/adapters/firebase/package.json +1 -1
  64. package/dist/starters/adapters/firebase/src/entry-firebase.tsx +2 -3
  65. package/dist/starters/adapters/netlify-edge/adapters/netlify-edge/vite.config.mts +1 -1
  66. package/dist/starters/adapters/netlify-edge/package.json +1 -1
  67. package/dist/starters/adapters/netlify-edge/src/entry.netlify-edge.tsx +2 -3
  68. package/dist/starters/adapters/node-server/adapters/node-server/vite.config.mts +1 -1
  69. package/dist/starters/adapters/node-server/package.json +1 -1
  70. package/dist/starters/adapters/node-server/src/entry.node-server.tsx +0 -2
  71. package/dist/starters/adapters/{static/adapters/static → ssg/adapters/ssg}/vite.config.mts +2 -2
  72. package/dist/starters/adapters/ssg/package.json +19 -0
  73. package/dist/starters/adapters/vercel-edge/adapters/vercel-edge/vite.config.mts +1 -1
  74. package/dist/starters/adapters/vercel-edge/package.json +1 -1
  75. package/dist/starters/adapters/vercel-edge/src/entry.vercel-edge.tsx +2 -3
  76. package/dist/starters/adapters/vercel-edge/vercel.json +1 -1
  77. package/dist/starters/features/auth/package.json +1 -1
  78. package/dist/starters/features/csr/index.html +23 -0
  79. package/dist/starters/features/csr/package.json +29 -0
  80. package/dist/starters/features/csr/src/root.tsx +15 -0
  81. package/dist/starters/features/csr/vite.config.mts +13 -0
  82. package/dist/starters/features/localize/package.json +3 -3
  83. package/dist/starters/features/localize/src/entry.ssr.tsx +17 -21
  84. package/dist/starters/features/pandacss/package.json +1 -1
  85. package/dist/starters/features/playwright/playwright-report/index.html +953 -911
  86. package/dist/starters/features/postcss/postcss.config.js +1 -1
  87. package/dist/starters/features/tailwind/package.json +2 -2
  88. package/dist/starters/features/tailwind/prettier.config.js +10 -0
  89. package/dist/starters/features/tailwind-v3/package.json +1 -1
  90. package/dist/starters/features/tailwind-v3/prettier.config.js +10 -0
  91. package/dist/testing/index.cjs +7556 -5229
  92. package/dist/testing/index.d.ts +972 -1
  93. package/dist/testing/index.mjs +7456 -5140
  94. package/dist/testing/package.json +1 -1
  95. package/package.json +16 -10
  96. package/public.d.ts +1 -0
  97. package/dist/starters/adapters/static/package.json +0 -19
  98. package/dist/starters/features/tailwind/.prettierrc.js +0 -3
  99. /package/dist/starters/adapters/{static → ssg}/README.md +0 -0
@@ -1,11 +1,10 @@
1
+ import { ComputedSignal as ComputedSignal_2 } from '..';
1
2
  import * 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 { QRL as QRL_2 } from './qrl.public';
6
- import { ReadonlySignal as ReadonlySignal_2 } from '..';
7
7
  import type { StreamWriter as StreamWriter_2 } from '.';
8
- import { ValueOrPromise as ValueOrPromise_2 } from '..';
9
8
 
10
9
  /**
11
10
  * Qwik Optimizer marker function.
@@ -99,7 +98,7 @@ declare type _AllowPlainQrl<Q> = QRLEventHandlerMulti<any, any> extends Q ? Q ex
99
98
 
100
99
  declare type AllPascalEventMaps = PascalMap<AllEventsMap>;
101
100
 
102
- declare type AllSignalFlags = SignalFlags | WrappedSignalFlags;
101
+ declare type AllSignalFlags = SignalFlags | WrappedSignalFlags | SerializationSignalFlags;
103
102
 
104
103
  /**
105
104
  * TS defines these with the React syntax which is not compatible with Qwik. E.g. `ariaAtomic`
@@ -366,12 +365,47 @@ declare type AsyncComputedCtx = {
366
365
  export declare type AsyncComputedFn<T> = (ctx: AsyncComputedCtx) => Promise<T>;
367
366
 
368
367
  /** @public */
369
- export declare interface AsyncComputedReadonlySignal<T = unknown> extends ReadonlySignal<T> {
368
+ export declare interface AsyncComputedReadonlySignal<T = unknown> extends ComputedSignal<T> {
369
+ /** Whether the signal is currently loading. */
370
+ loading: boolean;
371
+ /** The error that occurred while computing the signal. */
372
+ error: Error | null;
370
373
  }
371
374
 
372
375
  /** @public */
373
376
  export declare type AsyncComputedReturnType<T> = T extends Promise<infer T> ? AsyncComputedReadonlySignal<T> : AsyncComputedReadonlySignal<T>;
374
377
 
378
+ /**
379
+ * # ================================
380
+ *
381
+ * AsyncComputedSignalImpl
382
+ *
383
+ * # ================================
384
+ */
385
+ declare class AsyncComputedSignalImpl<T> extends ComputedSignalImpl<T, AsyncComputeQRL<T>> implements BackRef {
386
+ $untrackedLoading$: boolean;
387
+ $untrackedError$: Error | null;
388
+ $loadingEffects$: null | Set<EffectSubscription>;
389
+ $errorEffects$: null | Set<EffectSubscription>;
390
+ $destroy$: NoSerialize<() => void> | null;
391
+ private $promiseValue$;
392
+ [_EFFECT_BACK_REF]: Map<EffectProperty | string, EffectSubscription> | null;
393
+ constructor(container: Container | null, fn: AsyncComputeQRL<T>, flags?: SignalFlags | SerializationSignalFlags);
394
+ /**
395
+ * Loading is true if the signal is still waiting for the promise to resolve, false if the promise
396
+ * has resolved or rejected.
397
+ */
398
+ get loading(): boolean;
399
+ set untrackedLoading(value: boolean);
400
+ get untrackedLoading(): boolean;
401
+ /** The error that occurred when the signal was resolved. */
402
+ get error(): Error | null;
403
+ set untrackedError(value: Error | null);
404
+ get untrackedError(): Error | null;
405
+ invalidate(): void;
406
+ $computeIfNeeded$(): boolean | undefined;
407
+ }
408
+
375
409
  declare type AsyncComputeQRL<T> = QRLInternal<AsyncComputedFn<T>>;
376
410
 
377
411
  /**
@@ -400,6 +434,32 @@ declare type BivariantQrlFn<ARGS extends any[], RETURN> = {
400
434
  /** @public */
401
435
  declare type Booleanish = boolean | `${boolean}`;
402
436
 
437
+ declare interface Chore<T extends ChoreType = ChoreType> {
438
+ $type$: T;
439
+ $idx$: number | string;
440
+ $host$: HostElement;
441
+ $target$: ChoreTarget | null;
442
+ $payload$: unknown;
443
+ $state$: ChoreState;
444
+ $blockedChores$: Chore[] | null;
445
+ $startTime$: number | undefined;
446
+ $endTime$: number | undefined;
447
+ $resolve$: ((value: any) => void) | undefined;
448
+ $reject$: ((reason?: any) => void) | undefined;
449
+ $returnValue$: ValueOrPromise<ChoreReturnValue<T>>;
450
+ }
451
+
452
+ 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
+
454
+ declare enum ChoreState {
455
+ NONE = 0,
456
+ RUNNING = 1,
457
+ FAILED = 2,
458
+ DONE = 3
459
+ }
460
+
461
+ declare type ChoreTarget = HostElement | QRLInternal<(...args: unknown[]) => unknown> | Signal | StoreTarget;
462
+
403
463
  declare const enum ChoreType {
404
464
  MACRO = 240,
405
465
  MICRO = 15,
@@ -411,10 +471,9 @@ declare const enum ChoreType {
411
471
  NODE_PROP = 5,
412
472
  COMPONENT = 6,
413
473
  RECOMPUTE_AND_SCHEDULE_EFFECTS = 7,
414
- JOURNAL_FLUSH = 16,
415
- VISIBLE = 32,
416
- CLEANUP_VISIBLE = 48,
417
- WAIT_FOR_ALL = 255
474
+ VISIBLE = 16,
475
+ CLEANUP_VISIBLE = 32,
476
+ WAIT_FOR_QUEUE = 255
418
477
  }
419
478
 
420
479
  /**
@@ -438,9 +497,8 @@ export declare interface ClientContainer extends Container {
438
497
  qManifestHash: string;
439
498
  rootVNode: _ElementVNode;
440
499
  $journal$: VNodeJournal;
441
- renderDone: Promise<void> | null;
442
500
  $forwardRefs$: Array<number> | null;
443
- $initialQRLsIndexes$: Array<number> | null;
501
+ $flushEpoch$: number;
444
502
  parseQRL<T = unknown>(qrl: string): QRL<T>;
445
503
  $setRawState$(id: number, vParent: _ElementVNode | _VirtualVNode): void;
446
504
  }
@@ -540,7 +598,13 @@ export declare const componentQrl: <PROPS extends Record<any, any>>(componentQrl
540
598
  export declare type ComputedFn<T> = () => T;
541
599
 
542
600
  /** @public */
543
- export declare type ComputedReturnType<T> = T extends Promise<any> ? never : ReadonlySignal<T>;
601
+ export declare interface ComputedOptions {
602
+ serializationStrategy?: SerializationStrategy;
603
+ container?: Container;
604
+ }
605
+
606
+ /** @public */
607
+ export declare type ComputedReturnType<T> = T extends Promise<any> ? never : ComputedSignal<T>;
544
608
 
545
609
  /**
546
610
  * A computed signal is a signal which is calculated from other signals. When the signals change,
@@ -551,10 +615,15 @@ export declare type ComputedReturnType<T> = T extends Promise<any> ? never : Rea
551
615
  */
552
616
  export declare interface ComputedSignal<T> extends ReadonlySignal<T> {
553
617
  /**
554
- * Use this to force recalculation and running subscribers, for example when the calculated value
555
- * mutates but remains the same object. Useful for third-party libraries.
618
+ * Use this to force running subscribers, for example when the calculated value mutates but
619
+ * remains the same object.
556
620
  */
557
621
  force(): void;
622
+ /**
623
+ * Use this to force recalculation and running subscribers, for example when the calculated value
624
+ * mutates but remains the same object.
625
+ */
626
+ invalidate(): void;
558
627
  }
559
628
 
560
629
  /**
@@ -570,18 +639,17 @@ declare class ComputedSignalImpl<T, S extends QRLInternal = ComputeQRL<T>> exten
570
639
  * resolve the QRL during the mark dirty phase so that any call to it will be synchronous). )
571
640
  */
572
641
  $computeQrl$: S;
573
- $flags$: SignalFlags;
574
- $forceRunEffects$: boolean;
642
+ $flags$: SignalFlags | SerializationSignalFlags;
575
643
  [_EFFECT_BACK_REF]: Map<EffectProperty | string, EffectSubscription> | null;
576
- constructor(container: Container | null, fn: S, flags?: SignalFlags);
577
- $invalidate$(): void;
644
+ constructor(container: Container | null, fn: S, flags?: SignalFlags | SerializationSignalFlags);
645
+ invalidate(): void;
578
646
  /**
579
647
  * Use this to force running subscribers, for example when the calculated value has mutated but
580
648
  * remained the same object
581
649
  */
582
650
  force(): void;
583
651
  get untrackedValue(): T;
584
- $computeIfNeeded$(): boolean;
652
+ $computeIfNeeded$(): void;
585
653
  set value(_: any);
586
654
  get value(): any;
587
655
  }
@@ -611,7 +679,7 @@ declare interface Container {
611
679
  readonly $serverData$: Record<string, any>;
612
680
  $currentUniqueId$: number;
613
681
  $buildBase$: string | null;
614
- handleError(err: any, $host$: HostElement): void;
682
+ handleError(err: any, $host$: HostElement | null): void;
615
683
  getParentHost(host: HostElement): HostElement | null;
616
684
  setContext<T>(host: HostElement, context: ContextId<T>, value: T): void;
617
685
  resolveContext<T>(host: HostElement, contextId: ContextId<T>): T | undefined;
@@ -762,12 +830,6 @@ export declare interface CorePlatform {
762
830
  * @param fn - The function to call when the next animation frame is ready.
763
831
  */
764
832
  raf: (fn: () => any) => Promise<any>;
765
- /**
766
- * Perform operation on next tick.
767
- *
768
- * @param fn - The function to call when the tick is ready.
769
- */
770
- nextTick: (fn: () => any) => Promise<any>;
771
833
  /**
772
834
  * Retrieve chunk name for the symbol.
773
835
  *
@@ -789,6 +851,21 @@ export declare interface CorrectedToggleEvent extends Event {
789
851
  readonly prevState: 'open' | 'closed';
790
852
  }
791
853
 
854
+ /**
855
+ * Create an async computed signal which is calculated from the given QRL. A computed signal is a
856
+ * signal which is calculated from other signals or async operation. When the signals change, the
857
+ * computed signal is recalculated.
858
+ *
859
+ * The QRL must be a function which returns the value of the signal. The function must not have side
860
+ * effects, and it can be async.
861
+ *
862
+ * @public
863
+ */
864
+ export declare const createAsyncComputed$: <T>(qrl: () => Promise<T>, options?: ComputedOptions) => AsyncComputedReturnType<T>;
865
+
866
+ /** @internal */
867
+ export declare const createAsyncComputedQrl: <T>(qrl: QRL<(ctx: AsyncComputedCtx) => Promise<T>>, options?: ComputedOptions) => AsyncComputedSignalImpl<T>;
868
+
792
869
  /**
793
870
  * Create a computed signal which is calculated from the given QRL. A computed signal is a signal
794
871
  * which is calculated from other signals. When the signals change, the computed signal is
@@ -797,14 +874,14 @@ export declare interface CorrectedToggleEvent extends Event {
797
874
  * The QRL must be a function which returns the value of the signal. The function must not have side
798
875
  * effects, and it must be synchronous.
799
876
  *
800
- * If you need the function to be async, use `useSignal` and `useTask$` instead.
877
+ * If you need the function to be async, use `useAsyncComputed$` instead.
801
878
  *
802
879
  * @public
803
880
  */
804
- export declare const createComputed$: <T>(qrl: () => T) => T extends Promise<any> ? never : ComputedSignal<T>;
881
+ export declare const createComputed$: <T>(qrl: () => T, options?: ComputedOptions) => ComputedReturnType<T>;
805
882
 
806
883
  /** @internal */
807
- export declare const createComputedQrl: <T>(qrl: QRL<() => T>) => ComputedSignalImpl<T>;
884
+ export declare const createComputedQrl: <T>(qrl: QRL<() => T>, options?: ComputedOptions) => ComputedSignalImpl<T>;
808
885
 
809
886
  /**
810
887
  * Create a context ID to be used in your application. The name should be written with no spaces.
@@ -858,17 +935,16 @@ export declare const createComputedQrl: <T>(qrl: QRL<() => T>) => ComputedSignal
858
935
  */
859
936
  export declare const createContextId: <STATE = unknown>(name: string) => ContextId<STATE>;
860
937
 
861
- declare const createScheduler: (container: Container, scheduleDrain: () => void, journalFlush: () => void) => {
862
- (type: ChoreType.QRL_RESOLVE, ignore: null, target: ComputeQRL<any> | AsyncComputeQRL<any>): ValueOrPromise<void>;
863
- (type: ChoreType.JOURNAL_FLUSH): ValueOrPromise<void>;
864
- (type: ChoreType.WAIT_FOR_ALL): ValueOrPromise<void>;
865
- (type: ChoreType.RECOMPUTE_AND_SCHEDULE_EFFECTS, host: HostElement | null, target: Signal | StoreHandler, effects: Set<EffectSubscription> | null): ValueOrPromise<void>;
866
- (type: ChoreType.TASK | ChoreType.VISIBLE, task: Task): ValueOrPromise<void>;
867
- (type: ChoreType.RUN_QRL, host: HostElement, target: QRLInternal<(...args: unknown[]) => unknown>, args: unknown[]): ValueOrPromise<void>;
868
- (type: ChoreType.COMPONENT, host: HostElement, qrl: QRLInternal<OnRenderFn<unknown>>, props: Props | null): ValueOrPromise<JSXOutput>;
869
- (type: ChoreType.NODE_DIFF, host: HostElement, target: HostElement, value: JSXOutput | Signal): ValueOrPromise<void>;
870
- (type: ChoreType.NODE_PROP, host: HostElement, prop: string, value: any): ValueOrPromise<void>;
871
- (type: ChoreType.CLEANUP_VISIBLE, task: Task): ValueOrPromise<JSXOutput>;
938
+ declare const createScheduler: (container: Container, journalFlush: () => void, choreQueue?: Chore[], blockedChores?: Set<Chore>, runningChores?: Set<Chore>) => {
939
+ (type: ChoreType.QRL_RESOLVE, ignore: null, target: ComputeQRL<any> | AsyncComputeQRL<any>): Chore<ChoreType.QRL_RESOLVE>;
940
+ (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>;
942
+ (type: ChoreType.TASK | ChoreType.VISIBLE, task: Task): Chore<ChoreType.TASK | ChoreType.VISIBLE>;
943
+ (type: ChoreType.RUN_QRL, host: HostElement, target: QRLInternal<(...args: unknown[]) => unknown>, args: unknown[]): Chore<ChoreType.RUN_QRL>;
944
+ (type: ChoreType.COMPONENT, host: HostElement, qrl: QRLInternal<OnRenderFn<unknown>>, props: Props | null): Chore<ChoreType.COMPONENT>;
945
+ (type: ChoreType.NODE_DIFF, host: HostElement, target: HostElement, value: JSXOutput | Signal): Chore<ChoreType.NODE_DIFF>;
946
+ (type: ChoreType.NODE_PROP, host: HostElement, prop: string, value: any): Chore<ChoreType.NODE_PROP>;
947
+ (type: ChoreType.CLEANUP_VISIBLE, task: Task): Chore<ChoreType.CLEANUP_VISIBLE>;
872
948
  };
873
949
 
874
950
  /**
@@ -935,7 +1011,7 @@ declare interface DeserializeContainer {
935
1011
  $state$?: unknown[];
936
1012
  $storeProxyMap$: ObjToProxyMap;
937
1013
  $forwardRefs$: Array<number> | null;
938
- $initialQRLsIndexes$: Array<number> | null;
1014
+ $initialQRLs$: Array<string> | null;
939
1015
  readonly $scheduler$: Scheduler | null;
940
1016
  }
941
1017
 
@@ -964,28 +1040,24 @@ declare class DomContainer extends _SharedContainer implements ClientContainer {
964
1040
  rootVNode: _ElementVNode;
965
1041
  document: _QDocument;
966
1042
  $journal$: VNodeJournal;
967
- renderDone: Promise<void> | null;
968
1043
  $rawStateData$: unknown[];
969
1044
  $storeProxyMap$: ObjToProxyMap;
970
1045
  $qFuncs$: Array<(...args: unknown[]) => unknown>;
971
1046
  $instanceHash$: string;
972
1047
  $forwardRefs$: Array<number> | null;
973
- $initialQRLsIndexes$: Array<number> | null;
1048
+ $initialQRLs$: Array<string> | null;
974
1049
  vNodeLocate: (id: string | Element) => _VNode;
975
1050
  private $stateData$;
976
1051
  private $styleIds$;
977
- private $renderCount$;
978
1052
  constructor(element: _ContainerElement);
979
1053
  $setRawState$(id: number, vParent: _ElementVNode | _VirtualVNode): void;
980
1054
  parseQRL<T = unknown>(qrl: string): QRL<T>;
981
- handleError(err: any, host: HostElement): void;
1055
+ handleError(err: any, host: HostElement | null): void;
982
1056
  setContext<T>(host: HostElement, context: ContextId<T>, value: T): void;
983
1057
  resolveContext<T>(host: HostElement, contextId: ContextId<T>): T | undefined;
984
1058
  getParentHost(host: HostElement): HostElement | null;
985
1059
  setHostProp<T>(host: HostElement, name: string, value: T): void;
986
1060
  getHostProp<T>(host: HostElement, name: string): T | null;
987
- scheduleRender(): Promise<void>;
988
- private processChores;
989
1061
  ensureProjectionResolved(vNode: _VirtualVNode): void;
990
1062
  $getObjectById$: (id: number | string) => unknown;
991
1063
  getSyncFn(id: number): (...args: unknown[]) => unknown;
@@ -1147,6 +1219,13 @@ declare type Filtered<T, A = {}> = {
1147
1219
  /** @internal */
1148
1220
  export declare const _fnSignal: <T extends (...args: any) => any>(fn: T, args: Parameters<T>, fnStr?: string) => WrappedSignalImpl<any>;
1149
1221
 
1222
+ /**
1223
+ * Force a store to recompute and schedule effects.
1224
+ *
1225
+ * @public
1226
+ */
1227
+ export declare const forceStoreEffects: (value: StoreTarget, prop: keyof StoreTarget) => void;
1228
+
1150
1229
  /** @public */
1151
1230
  export declare const Fragment: FunctionComponent<{
1152
1231
  children?: any;
@@ -1164,6 +1243,12 @@ export declare type FunctionComponent<P = unknown> = {
1164
1243
  renderFn(props: P, key: string | null, flags: number, dev?: DevJSX): JSXOutput;
1165
1244
  }['renderFn'];
1166
1245
 
1246
+ /** @internal */
1247
+ export declare const _getConstProps: <T, JSX>(props: PropsProxy | Record<string, unknown> | null | undefined) => Props | null;
1248
+
1249
+ /** @internal */
1250
+ export declare const _getContextContainer: () => ClientContainer | undefined;
1251
+
1167
1252
  /** @internal */
1168
1253
  export declare const _getContextElement: () => unknown;
1169
1254
 
@@ -1202,6 +1287,9 @@ export declare const getPlatform: () => CorePlatform;
1202
1287
  /** @internal */
1203
1288
  export declare function _getQContainerElement(element: Element | _VNode): Element | null;
1204
1289
 
1290
+ /** @internal */
1291
+ export declare const _getVarProps: <T, JSX>(props: PropsProxy | Record<string, unknown> | null | undefined) => Props | null;
1292
+
1205
1293
  /** @public */
1206
1294
  declare interface GlobalInjections {
1207
1295
  tag: string;
@@ -1223,6 +1311,12 @@ declare function h<TYPE extends string | FunctionComponent<PROPS>, PROPS extends
1223
1311
  export { h as createElement }
1224
1312
  export { h }
1225
1313
 
1314
+ /**
1315
+ * @returns True if the store has effects for the given prop
1316
+ * @internal
1317
+ */
1318
+ export declare const _hasStoreEffects: (value: StoreTarget, prop: keyof StoreTarget) => boolean;
1319
+
1226
1320
  /** @public */
1227
1321
  declare interface HoistEntryStrategy {
1228
1322
  type: 'hoist';
@@ -1436,17 +1530,26 @@ export declare interface ISsrComponentFrame {
1436
1530
 
1437
1531
  declare interface ISsrNode {
1438
1532
  id: string;
1439
- parentSsrNode: ISsrNode | null;
1440
- vnodeData?: VNodeData;
1533
+ flags: SsrNodeFlags;
1534
+ parentComponent: ISsrNode | null;
1535
+ vnodeData: VNodeData;
1536
+ currentFile: string | null;
1441
1537
  setProp(name: string, value: any): void;
1442
1538
  getProp(name: string): any;
1443
1539
  removeProp(name: string): void;
1444
1540
  addChild(child: ISsrNode): void;
1541
+ setTreeNonUpdatable(): void;
1445
1542
  }
1446
1543
 
1544
+ /** @internal */
1545
+ export declare const _isStore: (value: StoreTarget) => boolean;
1546
+
1447
1547
  /** @internal */
1448
1548
  export declare function _isStringifiable(value: unknown): value is _Stringifiable;
1449
1549
 
1550
+ /** @internal */
1551
+ export declare const _isTask: (value: any) => value is Task;
1552
+
1450
1553
  /**
1451
1554
  * @public
1452
1555
  * Used by the JSX transpilers to create a JSXNode.
@@ -1601,6 +1704,15 @@ declare interface LenientSVGProps<T extends Element> extends SVGAttributes, DOMA
1601
1704
  */
1602
1705
  declare type LiteralUnion<LiteralType, BaseType extends Primitive> = LiteralType | (BaseType & Record<never, never>);
1603
1706
 
1707
+ /** @internal */
1708
+ export declare const _mapApp_findIndx: <T>(array: (T | null)[], key: string, start: number) => number;
1709
+
1710
+ /** @internal */
1711
+ export declare const _mapArray_get: <T>(array: (T | null)[], key: string, start: number) => T | null;
1712
+
1713
+ /** @internal */
1714
+ export declare const _mapArray_set: <T>(array: (T | null)[], key: string, value: T | null, start: number, allowNullValue?: boolean) => void;
1715
+
1604
1716
  declare type MediaSpecialAttrs = {
1605
1717
  crossOrigin?: HTMLCrossOriginAttribute;
1606
1718
  };
@@ -2049,13 +2161,12 @@ declare type QRLInternalMethods<TYPE> = {
2049
2161
  $captureRef$: unknown[] | null;
2050
2162
  dev: QRLDev | null;
2051
2163
  resolved: undefined | TYPE;
2052
- resolve(): Promise<TYPE>;
2164
+ resolve(containerEl?: Element): Promise<TYPE>;
2053
2165
  getSymbol(): string;
2054
2166
  getHash(): string;
2055
2167
  getCaptured(): unknown[] | null;
2056
2168
  getFn(currentCtx?: InvokeContext | InvokeTuple, beforeFn?: () => void): TYPE extends (...args: any) => any ? (...args: Parameters<TYPE>) => ValueOrPromise<ReturnType<TYPE>> : unknown;
2057
2169
  $setContainer$(containerEl: Element | undefined): Element | undefined;
2058
- $resolveLazy$(containerEl?: Element): ValueOrPromise<TYPE>;
2059
2170
  };
2060
2171
 
2061
2172
  declare type QrlReturn<T> = T extends (...args: any) => infer R ? Awaited<R> : unknown;
@@ -2413,6 +2524,9 @@ export declare interface RenderSSROptions {
2413
2524
  manifestHash: string;
2414
2525
  }
2415
2526
 
2527
+ /** @internal */
2528
+ export declare const _resolveContextWithoutSequentialScope: <STATE>(context: ContextId<STATE>) => STATE | undefined;
2529
+
2416
2530
  /** @public */
2417
2531
  declare interface ResolvedManifest {
2418
2532
  mapper: SymbolMapper;
@@ -2513,9 +2627,9 @@ export declare interface ResourcePending<T> {
2513
2627
  /** @public */
2514
2628
  export declare interface ResourceProps<T> {
2515
2629
  readonly value: ResourceReturn<T> | Signal<Promise<T> | T> | Promise<T>;
2516
- onResolved: (value: T) => JSXOutput;
2517
- onPending?: () => JSXOutput;
2518
- onRejected?: (reason: Error) => JSXOutput;
2630
+ onResolved: (value: T) => JSXOutput | Promise<JSXOutput>;
2631
+ onPending?: () => JSXOutput | Promise<JSXOutput>;
2632
+ onRejected?: (reason: Error) => JSXOutput | Promise<JSXOutput>;
2519
2633
  }
2520
2634
 
2521
2635
  /** @public */
@@ -2545,14 +2659,14 @@ declare interface ResourceReturnInternal<T> {
2545
2659
  }
2546
2660
 
2547
2661
  /** @internal */
2548
- export declare const _restProps: (props: PropsProxy, omit: string[], target?: Props) => Props;
2662
+ export declare const _restProps: (props: PropsProxy, omit?: string[], target?: Props) => Props;
2549
2663
 
2550
2664
  /**
2551
2665
  * This is called by qwik-loader to schedule a QRL. It has to be synchronous.
2552
2666
  *
2553
2667
  * @internal
2554
2668
  */
2555
- export declare const _run: (...args: unknown[]) => ValueOrPromise_2<void>;
2669
+ export declare const _run: (...args: unknown[]) => ValueOrPromise<unknown>;
2556
2670
 
2557
2671
  declare type Scheduler = ReturnType<typeof createScheduler>;
2558
2672
 
@@ -2602,7 +2716,7 @@ declare interface SerializationContext {
2602
2716
  $addRootPath$: (obj: any) => string | number;
2603
2717
  $seen$: (obj: unknown, parent: unknown | null, index: number) => void;
2604
2718
  $roots$: unknown[];
2605
- $pathMap$: Map<unknown, string | number>;
2719
+ $objectPathStringCache$: Map<unknown, string | number>;
2606
2720
  $addSyncFn$($funcStr$: string | null, argsCount: number, fn: Function): number;
2607
2721
  $isSsrNode$: (obj: unknown) => obj is SsrNode;
2608
2722
  $isDomRef$: (obj: unknown) => obj is DomRef;
@@ -2617,6 +2731,22 @@ declare interface SerializationContext {
2617
2731
  $setProp$: (obj: any, prop: string, value: any) => void;
2618
2732
  }
2619
2733
 
2734
+ declare const enum SerializationSignalFlags {
2735
+ SERIALIZATION_STRATEGY_NEVER = 16,
2736
+ SERIALIZATION_STRATEGY_ALWAYS = 32
2737
+ }
2738
+
2739
+ /** @public */
2740
+ export declare type SerializationStrategy = 'never' | 'always';
2741
+
2742
+ declare class SerializationWeakRef {
2743
+ $obj$: unknown;
2744
+ constructor($obj$: unknown);
2745
+ }
2746
+
2747
+ /** @internal */
2748
+ export declare const _serializationWeakRef: (obj: unknown) => SerializationWeakRef;
2749
+
2620
2750
  /**
2621
2751
  * Serialize data to string using SerializationContext.
2622
2752
  *
@@ -2688,7 +2818,7 @@ declare interface SerializerSignal<T> extends ComputedSignal<T> {
2688
2818
  declare class SerializerSignalImpl<T, S> extends ComputedSignalImpl<T> {
2689
2819
  constructor(container: Container | null, argQrl: QRLInternal<SerializerArg<T, S>>);
2690
2820
  $didInitialize$: boolean;
2691
- $computeIfNeeded$(): boolean;
2821
+ $computeIfNeeded$(): void;
2692
2822
  }
2693
2823
 
2694
2824
  /**
@@ -2739,7 +2869,8 @@ export declare abstract class _SharedContainer implements Container {
2739
2869
  $currentUniqueId$: number;
2740
2870
  $instanceHash$: string | null;
2741
2871
  $buildBase$: string | null;
2742
- constructor(scheduleDrain: () => void, journalFlush: () => void, serverData: Record<string, any>, locale: string);
2872
+ $flushEpoch$: number;
2873
+ constructor(journalFlush: () => void, serverData: Record<string, any>, locale: string);
2743
2874
  trackSignalValue<T>(signal: Signal, subscriber: HostElement, property: string, data: _SubscriptionData): T;
2744
2875
  serializationCtxFactory(NodeConstructor: {
2745
2876
  new (...rest: any[]): {
@@ -2751,7 +2882,7 @@ export declare abstract class _SharedContainer implements Container {
2751
2882
  };
2752
2883
  } | null, symbolToChunkResolver: SymbolToChunkResolver, writer?: StreamWriter): SerializationContext;
2753
2884
  abstract ensureProjectionResolved(host: HostElement): void;
2754
- abstract handleError(err: any, $host$: HostElement): void;
2885
+ abstract handleError(err: any, $host$: HostElement | null): void;
2755
2886
  abstract getParentHost(host: HostElement): HostElement | null;
2756
2887
  abstract setContext<T>(host: HostElement, context: ContextId<T>, value: T): void;
2757
2888
  abstract resolveContext<T>(host: HostElement, contextId: ContextId<T>): T | undefined;
@@ -2777,7 +2908,8 @@ export declare interface Signal<T = any> extends ReadonlySignal<T> {
2777
2908
  }
2778
2909
 
2779
2910
  declare const enum SignalFlags {
2780
- INVALID = 1
2911
+ INVALID = 1,
2912
+ RUN_EFFECTS = 2
2781
2913
  }
2782
2914
 
2783
2915
  declare class SignalImpl<T = any> implements Signal<T> {
@@ -2786,6 +2918,11 @@ declare class SignalImpl<T = any> implements Signal<T> {
2786
2918
  $effects$: null | Set<EffectSubscription>;
2787
2919
  $container$: Container | null;
2788
2920
  constructor(container: Container | null, value: T);
2921
+ /**
2922
+ * Use this to force running subscribers, for example when the calculated value has mutated but
2923
+ * remained the same object
2924
+ */
2925
+ force(): void;
2789
2926
  get untrackedValue(): T;
2790
2927
  set untrackedValue(value: T);
2791
2928
  get value(): T;
@@ -3115,6 +3252,8 @@ declare interface SSRContainer extends Container {
3115
3252
  render(jsx: JSXOutput): Promise<void>;
3116
3253
  emitPreloaderPre(): void;
3117
3254
  emitQwikLoaderAtTopIfNeeded(): void;
3255
+ emitPatchDataIfNeeded(): void;
3256
+ addBackpatchEntry(ssrNodeId: string, attrName: string, serializedValue: string | boolean | null): void;
3118
3257
  }
3119
3258
 
3120
3259
  /** @public */
@@ -3130,6 +3269,10 @@ declare type SsrNode = {
3130
3269
  [_EFFECT_BACK_REF]: Map<EffectProperty | string, EffectSubscription> | null;
3131
3270
  };
3132
3271
 
3272
+ declare const enum SsrNodeFlags {
3273
+ Updatable = 1
3274
+ }
3275
+
3133
3276
  /** @public */
3134
3277
  export declare const SSRRaw: FunctionComponent<{
3135
3278
  data: string;
@@ -3144,13 +3287,18 @@ export declare const SSRStreamBlock: FunctionComponent<{
3144
3287
  }>;
3145
3288
 
3146
3289
  /** @public */
3147
- export declare type SSRStreamChildren = AsyncGenerator<JSXChildren, void, any> | ((stream: StreamWriter) => Promise<void>) | (() => AsyncGenerator<JSXChildren, void, any>);
3290
+ export declare type SSRStreamChildren = AsyncGenerator<JSXChildren, void, any> | ((stream: SSRStreamWriter) => Promise<void>) | (() => AsyncGenerator<JSXChildren, void, any>);
3148
3291
 
3149
3292
  /** @public */
3150
3293
  export declare type SSRStreamProps = {
3151
3294
  children: SSRStreamChildren;
3152
3295
  };
3153
3296
 
3297
+ /** @public */
3298
+ export declare interface SSRStreamWriter {
3299
+ write(chunk: JSXOutput): void;
3300
+ }
3301
+
3154
3302
  declare type StopPropagation = {
3155
3303
  [K in keyof HTMLElementEventMap as `stoppropagation:${K}`]?: boolean;
3156
3304
  };
@@ -3167,6 +3315,7 @@ declare class StoreHandler implements ProxyHandler<StoreTarget> {
3167
3315
  $effects$: null | Map<string | symbol, Set<EffectSubscription>>;
3168
3316
  constructor($flags$: StoreFlags, $container$: Container | null);
3169
3317
  toString(): string;
3318
+ force(prop: keyof StoreTarget): void;
3170
3319
  get(target: StoreTarget, prop: string | symbol): any;
3171
3320
  /** In the case of oldValue and value are the same, the effects are not triggered. */
3172
3321
  set(target: StoreTarget, prop: string | symbol, value: any): boolean;
@@ -3631,6 +3780,9 @@ export declare interface Tracker {
3631
3780
  <T extends object, P extends keyof T>(obj: T, prop: P): T[P];
3632
3781
  }
3633
3782
 
3783
+ /** @internal */
3784
+ export declare const _UNINITIALIZED: unique symbol;
3785
+
3634
3786
  /**
3635
3787
  * Don't track listeners for this callback
3636
3788
  *
@@ -3658,10 +3810,10 @@ export declare const unwrapStore: <T>(value: T) => T;
3658
3810
  *
3659
3811
  * @public
3660
3812
  */
3661
- export declare const useAsyncComputed$: <T>(qrl: AsyncComputedFn<T>) => AsyncComputedReturnType<T>;
3813
+ export declare const useAsyncComputed$: <T>(qrl: AsyncComputedFn<T>, options?: ComputedOptions | undefined) => AsyncComputedReturnType<T>;
3662
3814
 
3663
3815
  /** @internal */
3664
- export declare const useAsyncComputedQrl: <T>(qrl: QRL<AsyncComputedFn<T>>) => AsyncComputedReturnType<T>;
3816
+ export declare const useAsyncComputedQrl: <T>(qrl: QRL<AsyncComputedFn<T>>, options?: ComputedOptions) => AsyncComputedReturnType<T>;
3665
3817
 
3666
3818
  /**
3667
3819
  * Creates a computed signal which is calculated from the given function. A computed signal is a
@@ -3673,10 +3825,10 @@ export declare const useAsyncComputedQrl: <T>(qrl: QRL<AsyncComputedFn<T>>) => A
3673
3825
  *
3674
3826
  * @public
3675
3827
  */
3676
- export declare const useComputed$: <T>(qrl: ComputedFn<T>) => ComputedReturnType<T>;
3828
+ export declare const useComputed$: <T>(qrl: ComputedFn<T>, options?: ComputedOptions | undefined) => ComputedReturnType<T>;
3677
3829
 
3678
3830
  /** @internal */
3679
- export declare const useComputedQrl: <T>(qrl: QRL<ComputedFn<T>>) => ComputedReturnType<T>;
3831
+ export declare const useComputedQrl: <T>(qrl: QRL<ComputedFn<T>>, options?: ComputedOptions) => ComputedReturnType<T>;
3680
3832
 
3681
3833
  /**
3682
3834
  * Stores a value which is retained for the lifetime of the component. Subsequent calls to
@@ -4002,7 +4154,7 @@ export declare const useResourceQrl: <T>(qrl: QRL<ResourceFn<T>>, opts?: Resourc
4002
4154
  export declare const useSerializer$: typeof createSerializer$;
4003
4155
 
4004
4156
  /** @internal */
4005
- export declare const useSerializerQrl: <T, S>(qrl: QRL<SerializerArg<T, S>>) => ReadonlySignal_2<unknown>;
4157
+ export declare const useSerializerQrl: <T, S>(qrl: QRL<SerializerArg<T, S>>) => ComputedSignal_2<unknown>;
4006
4158
 
4007
4159
  /** @public */
4008
4160
  export declare function useServerData<T>(key: string): T | undefined;
@@ -4250,7 +4402,7 @@ export declare const _VAR_PROPS: unique symbol;
4250
4402
  export declare const _verifySerializable: <T>(value: T, preMessage?: string) => T;
4251
4403
 
4252
4404
  /**
4253
- * 2.0.0-beta.1-dev+495e8d9
4405
+ * 2.0.0-beta.10-dev+4669425
4254
4406
  *
4255
4407
  * @public
4256
4408
  */
@@ -4280,6 +4432,36 @@ export declare type VisibleTaskStrategy = 'intersection-observer' | 'document-re
4280
4432
  /** @internal */
4281
4433
  export declare type _VNode = _ElementVNode | _TextVNode | _VirtualVNode;
4282
4434
 
4435
+ /** @internal */
4436
+ export declare const _vnode_ensureElementInflated: (vnode: _VNode) => void;
4437
+
4438
+ /** @internal */
4439
+ export declare const _vnode_getAttr: (vnode: _VNode, key: string) => string | null;
4440
+
4441
+ /** @internal */
4442
+ export declare const _vnode_getAttrKeys: (vnode: _ElementVNode | _VirtualVNode) => string[];
4443
+
4444
+ /** @internal */
4445
+ export declare const _vnode_getFirstChild: (vnode: _VNode) => _VNode | null;
4446
+
4447
+ /** @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;
4455
+
4456
+ /** @internal */
4457
+ export declare const _vnode_isMaterialized: (vNode: _VNode) => boolean;
4458
+
4459
+ /** @internal */
4460
+ export declare const _vnode_isTextVNode: (vNode: _VNode) => vNode is _TextVNode;
4461
+
4462
+ /** @internal */
4463
+ export declare const _vnode_isVirtualVNode: (vNode: _VNode) => vNode is _VirtualVNode;
4464
+
4283
4465
  /** @internal */
4284
4466
  export declare function _vnode_toString(this: _VNode | null, depth?: number, offset?: string, materialize?: boolean, siblings?: boolean, colorize?: boolean): string;
4285
4467
 
@@ -4349,10 +4531,10 @@ export declare const enum _VNodeFlags {
4349
4531
  Element = 1,
4350
4532
  Virtual = 2,
4351
4533
  ELEMENT_OR_VIRTUAL_MASK = 3,
4534
+ Text = 4,
4352
4535
  ELEMENT_OR_TEXT_MASK = 5,
4353
4536
  TYPE_MASK = 7,
4354
4537
  INFLATED_TYPE_MASK = 15,
4355
- Text = 4,
4356
4538
  Inflated = 8,
4357
4539
  Resolved = 16,
4358
4540
  Deleted = 32,
@@ -4390,9 +4572,6 @@ export declare function _walkJSX(ssr: SSRContainer, value: JSXOutput, options: {
4390
4572
  parentComponentFrame: ISsrComponentFrame | null;
4391
4573
  }): Promise<void>;
4392
4574
 
4393
- /** @internal */
4394
- export declare const _weakSerialize: <T extends object>(input: T) => Partial<T>;
4395
-
4396
4575
  /**
4397
4576
  * Override the `getLocale` with `lang` within the `fn` execution.
4398
4577
  *
@@ -4401,7 +4580,7 @@ export declare const _weakSerialize: <T extends object>(input: T) => Partial<T>;
4401
4580
  export declare function withLocale<T>(locale: string, fn: () => T): T;
4402
4581
 
4403
4582
  declare const enum WrappedSignalFlags {
4404
- UNWRAP = 2
4583
+ UNWRAP = 4
4405
4584
  }
4406
4585
 
4407
4586
  declare class WrappedSignalImpl<T> extends SignalImpl<T> implements BackRef {
@@ -4410,17 +4589,16 @@ declare class WrappedSignalImpl<T> extends SignalImpl<T> implements BackRef {
4410
4589
  $funcStr$: string | null;
4411
4590
  $flags$: AllSignalFlags;
4412
4591
  $hostElement$: HostElement | null;
4413
- $forceRunEffects$: boolean;
4414
4592
  [_EFFECT_BACK_REF]: Map<EffectProperty | string, EffectSubscription> | null;
4415
4593
  constructor(container: Container | null, fn: (...args: any[]) => T, args: any[], fnStr: string | null, flags?: SignalFlags);
4416
- $invalidate$(): void;
4594
+ invalidate(): void;
4417
4595
  /**
4418
4596
  * Use this to force running subscribers, for example when the calculated value has mutated but
4419
4597
  * remained the same object.
4420
4598
  */
4421
4599
  force(): void;
4422
4600
  get untrackedValue(): T;
4423
- $computeIfNeeded$(): boolean;
4601
+ $computeIfNeeded$(): void;
4424
4602
  set value(_: any);
4425
4603
  get value(): any;
4426
4604
  }
@@ -4441,7 +4619,4 @@ export declare const _wrapProp: <T extends Record<any, any>, P extends keyof T>(
4441
4619
  /** @internal @deprecated v1 compat */
4442
4620
  export declare const _wrapSignal: <T extends Record<any, any>, P extends keyof T>(obj: T, prop: P) => any;
4443
4621
 
4444
- /** @internal */
4445
- export declare const _wrapStore: <T extends Record<any, any>, P extends keyof T>(obj: T, prop: P) => Signal<T>;
4446
-
4447
4622
  export { }