@qwik.dev/core 2.0.0-beta.23 → 2.0.0-beta.24

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.
@@ -18,37 +18,9 @@ declare interface AddRootFn {
18
18
 
19
19
  declare type AllSignalFlags = SignalFlags | WrappedSignalFlags | SerializationSignalFlags | AsyncSignalFlags;
20
20
 
21
- /** @public */
22
- declare interface AsyncSignal<T = unknown> extends ComputedSignal<T> {
23
- /**
24
- * Whether the signal is currently loading. This will trigger lazy loading of the signal, so you
25
- * can use it like this:
26
- *
27
- * ```tsx
28
- * signal.loading ? <Loading /> : signal.error ? <Error /> : <Component
29
- * value={signal.value} />
30
- * ```
31
- */
32
- loading: boolean;
33
- /**
34
- * The error that occurred while computing the signal, if any. This will be cleared when the
35
- * signal is successfully computed.
36
- */
37
- error: Error | undefined;
38
- /**
39
- * Poll interval in ms. Writable and immediately effective when the signal has consumers. If set
40
- * to `0`, polling stops.
41
- */
42
- interval: number;
43
- /** A promise that resolves when the value is computed or rejected. */
44
- promise(): Promise<void>;
45
- /** Abort the current computation and run cleanups if needed. */
46
- abort(reason?: any): void;
47
- }
48
-
49
21
  declare const enum AsyncSignalFlags {
50
22
  EAGER_CLEANUP = 32,
51
- AWAIT_PREVIOUS = 64
23
+ CLIENT_ONLY = 64
52
24
  }
53
25
 
54
26
  /** Class for back reference to the EffectSubscription */
@@ -78,26 +50,6 @@ declare const enum ChoreBits {
78
50
  DIRTY_MASK = 127
79
51
  }
80
52
 
81
- /**
82
- * A computed signal is a signal which is calculated from other signals. When the signals change,
83
- * the computed signal is recalculated, and if the result changed, all tasks which are tracking the
84
- * signal will be re-run and all components that read the signal will be re-rendered.
85
- *
86
- * @public
87
- */
88
- declare interface ComputedSignal<T> extends ReadonlySignal<T> {
89
- /**
90
- * Use this to force running subscribers, for example when the calculated value mutates but
91
- * remains the same object.
92
- */
93
- force(): void;
94
- /**
95
- * Use this to force recalculation and running subscribers, for example when the calculated value
96
- * mutates but remains the same object.
97
- */
98
- invalidate(): void;
99
- }
100
-
101
53
  /**
102
54
  * Effect is something which needs to happen (side-effect) due to signal value change.
103
55
  *
@@ -567,22 +519,8 @@ declare type QRLInternalMethods<TYPE> = {
567
519
 
568
520
  declare type QrlReturn<T> = T extends (...args: any) => infer R ? Awaited<R> : unknown;
569
521
 
570
- /** @public */
571
- declare interface ReadonlySignal<T = unknown> {
572
- readonly value: T;
573
- }
574
-
575
522
  declare const RenderEvent = "qRender";
576
523
 
577
- declare interface ResourceReturnInternal<T> {
578
- __brand: 'resource';
579
- value: Promise<T>;
580
- loading: boolean;
581
- signal: AsyncSignal<{
582
- r: T;
583
- }>;
584
- }
585
-
586
524
  /** Stores the location of an object. If no parent, it's a root. */
587
525
  declare type SeenRef = {
588
526
  $index$: number;
@@ -627,14 +565,13 @@ declare interface SerializationContext {
627
565
  $renderSymbols$: Set<string>;
628
566
  $storeProxyMap$: ObjToProxyMap;
629
567
  $eagerResume$: Set<unknown>;
630
- $resources$: Set<ResourceReturnInternal<any>>;
631
- $getProp$: (obj: any, prop: string) => any;
632
568
  $setProp$: (obj: any, prop: string, value: any) => void;
633
569
  }
634
570
 
635
571
  declare const enum SerializationSignalFlags {
636
572
  SERIALIZATION_STRATEGY_NEVER = 8,
637
- SERIALIZATION_STRATEGY_ALWAYS = 16
573
+ SERIALIZATION_STRATEGY_ALWAYS = 16,
574
+ SERIALIZATION_ALL_STRATEGIES = 24
638
575
  }
639
576
 
640
577
  /**
@@ -649,8 +586,16 @@ declare const enum SerializationSignalFlags {
649
586
  *
650
587
  * @public
651
588
  */
652
- declare interface Signal<T = any> extends ReadonlySignal<T> {
589
+ declare interface Signal<T = any> {
590
+ /** Reading from this subscribes to updates; writing to this triggers updates. */
653
591
  value: T;
592
+ /** Reading from this does not subscribe to updates; writing to this does not trigger updates. */
593
+ untrackedValue: T;
594
+ /**
595
+ * Use this to trigger running subscribers, for example when the value mutated but remained the
596
+ * same object.
597
+ */
598
+ trigger(): void;
654
599
  }
655
600
 
656
601
  declare const enum SignalFlags {
@@ -666,9 +611,11 @@ declare class SignalImpl<T = any> implements Signal<T> {
666
611
  $wrappedSignal$: WrappedSignalImpl<T> | null;
667
612
  constructor(container: Container | null, value: T);
668
613
  /**
669
- * Use this to force running subscribers, for example when the calculated value has mutated but
614
+ * Use this to trigger running subscribers, for example when the calculated value has mutated but
670
615
  * remained the same object
671
616
  */
617
+ trigger(): void;
618
+ /** @deprecated Use `trigger()` instead */
672
619
  force(): void;
673
620
  get untrackedValue(): T;
674
621
  set untrackedValue(value: T);
@@ -681,20 +628,12 @@ declare class SignalImpl<T = any> implements Signal<T> {
681
628
  };
682
629
  }
683
630
 
684
- declare type SimpleSsrAttrValue = string | Signal<SimpleSsrAttrValue> | boolean | object | null;
685
-
686
631
  declare interface SimplifiedServerRequestEvent<T = unknown> {
687
632
  url: URL;
688
633
  locale: string | undefined;
689
634
  request: Request;
690
635
  }
691
636
 
692
- declare type SsrAttrKey = string;
693
-
694
- declare type SsrAttrs = Array<SsrAttrKey | SsrAttrValue>;
695
-
696
- declare type SsrAttrValue = SimpleSsrAttrValue | Promise<SimpleSsrAttrValue>;
697
-
698
637
  /** A selection of attributes of the real thing */
699
638
  declare type SsrNode = {
700
639
  id: string;
@@ -848,7 +787,7 @@ export declare function vnode_fromJSX(jsx: JSXOutput): {
848
787
  * this data needs to be serialized into a string and stored in the DOM as a script tag which has
849
788
  * deferent serialization format.
850
789
  */
851
- declare type VNodeData = [VNodeDataFlag, ...(SsrAttrs | number)[]];
790
+ declare type VNodeData = [VNodeDataFlag, ...(Props | number)[]];
852
791
 
853
792
  /**
854
793
  * Flags for VNodeData (Flags con be bitwise combined)
@@ -925,7 +864,7 @@ declare const enum WrappedSignalFlags {
925
864
  UNWRAP = 4
926
865
  }
927
866
 
928
- declare class WrappedSignalImpl<T> extends SignalImpl<T> implements BackRef {
867
+ declare class WrappedSignalImpl<T> extends SignalImpl<T> {
929
868
  $args$: any[];
930
869
  $func$: (...args: any[]) => T;
931
870
  $funcStr$: string | null;