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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qwik.dev/core/backpatch",
3
- "version": "2.0.0-beta.36-dev+3268fab",
3
+ "version": "2.0.0-beta.37-dev+82dc74d",
4
4
  "main": "index.mjs",
5
5
  "types": "index.d.ts",
6
6
  "private": true,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qwik.dev/core/build",
3
- "version": "2.0.0-beta.36-dev+3268fab",
3
+ "version": "2.0.0-beta.37-dev+82dc74d",
4
4
  "main": "index.mjs",
5
5
  "types": "index.d.ts",
6
6
  "private": true,
package/dist/cli.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * @qwik.dev/core/cli 2.0.0-beta.36-dev+3268fab
3
+ * @qwik.dev/core/cli 2.0.0-beta.37-dev+82dc74d
4
4
  * Copyright QwikDev. All Rights Reserved.
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://github.com/QwikDev/qwik/blob/main/LICENSE
@@ -12957,7 +12957,7 @@ async function printHelp(app) {
12957
12957
  await runCommand2(Object.assign(app, { task: args[0], args }));
12958
12958
  }
12959
12959
  function printVersion() {
12960
- console.log("2.0.0-beta.36-dev+3268fab");
12960
+ console.log("2.0.0-beta.37-dev+82dc74d");
12961
12961
  }
12962
12962
  export {
12963
12963
  runCli,
@@ -397,7 +397,7 @@ export declare type AsyncFn<T> = (ctx: AsyncCtx) => ValueOrPromise<T>;
397
397
 
398
398
  /** Retains job metadata and also serves as the argument for the compute function */
399
399
  declare class AsyncJob<T> implements AsyncCtx<T> {
400
- readonly $signal$: AsyncSignalImpl<T>;
400
+ readonly $signal$: _AsyncSignalImpl<T>;
401
401
  /** First holds the compute promise and then the cleanup promise */
402
402
  $promise$: Promise<void> | null | void;
403
403
  $cleanupRequested$: boolean;
@@ -407,7 +407,7 @@ declare class AsyncJob<T> implements AsyncCtx<T> {
407
407
  $abortController$: AbortController | undefined;
408
408
  info: unknown;
409
409
  $infoVersion$: number | undefined;
410
- constructor($signal$: AsyncSignalImpl<T>, info: unknown, $infoVersion$: number | undefined);
410
+ constructor($signal$: _AsyncSignalImpl<T>, info: unknown, $infoVersion$: number | undefined);
411
411
  get track(): AsyncCtx<T>['track'];
412
412
  get abortSignal(): AbortSignal;
413
413
  /** Backward compatible cache method for resource */
@@ -515,7 +515,7 @@ declare const enum AsyncSignalFlags {
515
515
  *
516
516
  * @internal
517
517
  */
518
- declare class AsyncSignalImpl<T> extends ComputedSignalImpl<T, AsyncQRL<T>> implements BackRef, AsyncSignal<T> {
518
+ export declare class _AsyncSignalImpl<T> extends ComputedSignalImpl<T, AsyncQRL<T>> implements BackRef, AsyncSignal<T> {
519
519
  $untrackedLoading$: boolean;
520
520
  $untrackedError$: Error | undefined;
521
521
  $current$: AsyncJob<T> | null;
@@ -529,7 +529,7 @@ declare class AsyncSignalImpl<T> extends ComputedSignalImpl<T, AsyncQRL<T>> impl
529
529
  $computationTimeoutId$: ReturnType<typeof setTimeout> | undefined;
530
530
  $info$: unknown | undefined;
531
531
  $infoVersion$: number | undefined;
532
- [_EFFECT_BACK_REF]: Map<EffectProperty | string, EffectSubscription> | undefined;
532
+ [_EFFECT_BACK_REF]: Map<_EffectProperty | string, EffectSubscription> | undefined;
533
533
  constructor(container: _Container | null, fn: AsyncQRL<T>, flags?: SignalFlags | SerializationSignalFlags, options?: AsyncSignalOptions<T>);
534
534
  get untrackedValue(): T;
535
535
  set untrackedValue(value: T);
@@ -878,7 +878,7 @@ declare class ComputedSignalImpl<T, S extends _QRLInternal = ComputeQRL<T>> exte
878
878
  */
879
879
  $computeQrl$: S;
880
880
  $flags$: SignalFlags | SerializationSignalFlags;
881
- [_EFFECT_BACK_REF]: Map<EffectProperty | string, EffectSubscription> | undefined;
881
+ [_EFFECT_BACK_REF]: Map<_EffectProperty | string, EffectSubscription> | undefined;
882
882
  constructor(container: _Container | null, fn: S, flags?: SignalFlags | SerializationSignalFlags);
883
883
  invalidate(): void;
884
884
  get untrackedValue(): T;
@@ -900,7 +900,7 @@ export declare const _CONST_PROPS: unique symbol;
900
900
  * - `VNode` and `ISsrNode`: Either a component or `<Signal>`
901
901
  * - `Signal2`: A derived signal which contains a computation function.
902
902
  */
903
- declare type Consumer = Task | _VNode | SignalImpl | ISsrNode;
903
+ declare type Consumer = _Task | _VNode | SignalImpl | ISsrNode;
904
904
 
905
905
  /** @internal */
906
906
  export declare interface _Container {
@@ -918,13 +918,13 @@ export declare interface _Container {
918
918
  $resolveRenderPromise$: (() => void) | null;
919
919
  $pendingCount$: number;
920
920
  $checkPendingCount$(): void;
921
- handleError(err: any, $host$: HostElement | null): void;
922
- getParentHost(host: HostElement): HostElement | null;
923
- setContext<T>(host: HostElement, context: ContextId<T>, value: T): void;
924
- resolveContext<T>(host: HostElement, contextId: ContextId<T>): T | undefined;
925
- setHostProp<T>(host: HostElement, name: string, value: T): void;
926
- getHostProp<T>(host: HostElement, name: string): T | null;
927
- $appendStyle$(content: string, styleId: string, host: HostElement, scoped: boolean): void;
921
+ handleError(err: any, $host$: _HostElement | null): void;
922
+ getParentHost(host: _HostElement): _HostElement | null;
923
+ setContext<T>(host: _HostElement, context: ContextId<T>, value: T): void;
924
+ resolveContext<T>(host: _HostElement, contextId: ContextId<T>): T | undefined;
925
+ setHostProp<T>(host: _HostElement, name: string, value: T): void;
926
+ getHostProp<T>(host: _HostElement, name: string): T | null;
927
+ $appendStyle$(content: string, styleId: string, host: _HostElement, scoped: boolean): void;
928
928
  /**
929
929
  * When component is about to be executed, it may add/remove children. This can cause problems
930
930
  * with the projection because deleting content will prevent the projection references from
@@ -933,7 +933,7 @@ export declare interface _Container {
933
933
  *
934
934
  * @param renderHost - Host element to ensure projection is resolved.
935
935
  */
936
- ensureProjectionResolved(host: HostElement): void;
936
+ ensureProjectionResolved(host: _HostElement): void;
937
937
  serializationCtxFactory(NodeConstructor: {
938
938
  new (...rest: any[]): {
939
939
  __brand__: 'SsrNode';
@@ -1101,7 +1101,7 @@ export declare interface CorrectedToggleEvent extends Event {
1101
1101
  export declare const createAsync$: <T>(qrl: (arg: AsyncCtx<T>) => Promise<T>, options?: AsyncSignalOptions<T>) => AsyncSignal<T>;
1102
1102
 
1103
1103
  /** @internal */
1104
- export declare const createAsyncQrl: <T>(qrl: QRL<AsyncFn<T>>, options?: AsyncSignalOptions<T>) => AsyncSignalImpl<T>;
1104
+ export declare const createAsyncQrl: <T>(qrl: QRL<AsyncFn<T>>, options?: AsyncSignalOptions<T>) => _AsyncSignalImpl<T>;
1105
1105
 
1106
1106
  /**
1107
1107
  * Create a computed signal which is calculated from the given QRL. A computed signal is a signal
@@ -1216,6 +1216,9 @@ export declare const createSignal: {
1216
1216
  <T>(value: T): Signal<T>;
1217
1217
  };
1218
1218
 
1219
+ /** @internal */
1220
+ export declare function _createStore<T extends object>(container: _Container | null | undefined, obj: T, flags: _StoreFlags): T;
1221
+
1219
1222
  /** @public */
1220
1223
  export declare interface CSSProperties extends CSS_2.Properties<string | number>, CSS_2.PropertiesHyphen<string | number> {
1221
1224
  /**
@@ -1228,6 +1231,9 @@ export declare interface CSSProperties extends CSS_2.Properties<string | number>
1228
1231
  [v: `--${string}`]: string | number | undefined;
1229
1232
  }
1230
1233
 
1234
+ /** @internal */
1235
+ export declare const _delay: (timeout: number) => Promise<unknown>;
1236
+
1231
1237
  declare class DeleteOperation {
1232
1238
  target: Element | Text;
1233
1239
  constructor(target: Element | Text);
@@ -1236,7 +1242,7 @@ declare class DeleteOperation {
1236
1242
  declare interface DescriptorBase<T = unknown, B = unknown> extends BackRef {
1237
1243
  $flags$: number;
1238
1244
  $index$: number;
1239
- $el$: HostElement;
1245
+ $el$: _HostElement;
1240
1246
  $qrl$: _QRLInternal<T>;
1241
1247
  $state$: B | undefined;
1242
1248
  $destroy$: (() => void) | null;
@@ -1313,8 +1319,8 @@ declare class DomContainer extends _SharedContainer implements ClientContainer {
1313
1319
  setContext<T>(host: _VNode, context: ContextId<T>, value: T): void;
1314
1320
  resolveContext<T>(host: _VNode, contextId: ContextId<T>): T | undefined;
1315
1321
  getParentHost(host: _VNode): _VNode | null;
1316
- setHostProp<T>(host: HostElement, name: string, value: T): void;
1317
- getHostProp<T>(host: HostElement, name: string): T | null;
1322
+ setHostProp<T>(host: _HostElement, name: string, value: T): void;
1323
+ getHostProp<T>(host: _HostElement, name: string): T | null;
1318
1324
  ensureProjectionResolved(vNode: _VirtualVNode): void;
1319
1325
  $getObjectById$: (id: number | string) => unknown;
1320
1326
  $getForwardRef$(id: number): number | string | undefined;
@@ -1355,7 +1361,8 @@ export declare const _EFFECT_BACK_REF: unique symbol;
1355
1361
 
1356
1362
  declare type EffectBackRef = SignalImpl | StoreTarget | PropsProxy;
1357
1363
 
1358
- declare const enum EffectProperty {
1364
+ /** @internal */
1365
+ export declare const enum _EffectProperty {
1359
1366
  COMPONENT = ":",
1360
1367
  VNODE = "."
1361
1368
  }
@@ -1398,12 +1405,15 @@ declare const enum EffectProperty {
1398
1405
  */
1399
1406
  declare class EffectSubscription {
1400
1407
  consumer: Consumer;
1401
- property: EffectProperty | string;
1408
+ property: _EffectProperty | string;
1402
1409
  backRef: Set<EffectBackRef> | null;
1403
1410
  data: _SubscriptionData | null;
1404
- constructor(consumer: Consumer, property: EffectProperty | string, backRef?: Set<EffectBackRef> | null, data?: _SubscriptionData | null);
1411
+ constructor(consumer: Consumer, property: _EffectProperty | string, backRef?: Set<EffectBackRef> | null, data?: _SubscriptionData | null);
1405
1412
  }
1406
1413
 
1414
+ /** @internal */
1415
+ export declare const _ELEMENT_SEQ = "q:seq";
1416
+
1407
1417
  /** @internal */
1408
1418
  export declare class _ElementVNode extends _VirtualVNode {
1409
1419
  node: Element;
@@ -1509,7 +1519,7 @@ export declare const _getContextContainer: () => _Container | undefined;
1509
1519
  export declare const _getContextEvent: () => unknown;
1510
1520
 
1511
1521
  /** @internal */
1512
- export declare const _getContextHostElement: () => HostElement | undefined;
1522
+ export declare const _getContextHostElement: () => _HostElement | undefined;
1513
1523
 
1514
1524
  /** @public */
1515
1525
  declare function getDomContainer(element: Element): ClientContainer;
@@ -1543,6 +1553,9 @@ export declare const getPlatform: () => CorePlatform;
1543
1553
  /** @internal */
1544
1554
  export declare function _getQContainerElement(element: Element): Element | null;
1545
1555
 
1556
+ /** @internal */
1557
+ export declare function _getSubscriber(effect: Consumer, prop: _EffectProperty | string, data?: _SubscriptionData): EffectSubscription;
1558
+
1546
1559
  /** Used by the optimizer for spread props operations @internal */
1547
1560
  export declare const _getVarProps: (props: PropsProxy | Record<string, unknown> | null | undefined) => Props | null;
1548
1561
 
@@ -1576,7 +1589,8 @@ export declare const _hmr: (this: string | undefined, event: CustomEvent<{
1576
1589
  t: number;
1577
1590
  }>, element: Element) => void;
1578
1591
 
1579
- declare type HostElement = _VNode | ISsrNode;
1592
+ /** @internal */
1593
+ export declare type _HostElement = _VNode | ISsrNode;
1580
1594
 
1581
1595
  /** @public */
1582
1596
  declare type HTMLAttributeAnchorTarget = '_self' | '_blank' | '_parent' | '_top' | (string & {});
@@ -1687,6 +1701,16 @@ export declare const _IMMUTABLE: unique symbol;
1687
1701
  */
1688
1702
  export declare const implicit$FirstArg: <FIRST, REST extends any[], RET>(fn: (qrl: QRL<FIRST>, ...rest: REST) => RET) => ((qrl: FIRST, ...rest: REST) => RET);
1689
1703
 
1704
+ /**
1705
+ * Inject a pre-loaded value into an AsyncSignal while preserving track() subscriptions. Calls
1706
+ * `invalidate({ __v })` so the compute function reads the value from `info`, then triggers an
1707
+ * immediate synchronous compute via the private $computeIfNeeded$() method (which is mangled in
1708
+ * core builds, so callers from other packages must go through this helper).
1709
+ *
1710
+ * @internal
1711
+ */
1712
+ export declare const _injectAsyncSignalValue: (signal: AsyncSignal<unknown>, value: unknown) => void;
1713
+
1690
1714
  /**
1691
1715
  * Create an inlined QRL. This is mostly useful on the server side for serialization.
1692
1716
  *
@@ -1741,10 +1765,17 @@ declare type IntrinsicSVGElements = {
1741
1765
  [K in keyof Omit<SVGElementTagNameMap, keyof HTMLElementTagNameMap>]: LenientSVGProps<SVGElementTagNameMap[K]>;
1742
1766
  };
1743
1767
 
1768
+ /**
1769
+ * Call a function with the given InvokeContext and given arguments.
1770
+ *
1771
+ * @internal
1772
+ */
1773
+ export declare function _invoke<FN extends (...args: any[]) => any>(this: unknown, context: InvokeContext | undefined, fn: FN, ...args: Parameters<FN>): ReturnType<FN>;
1774
+
1744
1775
  /** The shared state during an invoke() call */
1745
1776
  declare interface InvokeContext {
1746
1777
  /** The Virtual parent component for the current component code */
1747
- $hostElement$: HostElement | undefined;
1778
+ $hostElement$: _HostElement | undefined;
1748
1779
  /** The event we're currently handling */
1749
1780
  $event$: PossibleEvents | undefined;
1750
1781
  $effectSubscriber$: EffectSubscription | undefined;
@@ -1795,7 +1826,7 @@ declare interface ISsrNode {
1795
1826
  children: ISsrNode[] | null;
1796
1827
  vnodeData: VNodeData;
1797
1828
  currentFile: string | null;
1798
- readonly [_EFFECT_BACK_REF]: Map<EffectProperty | string, EffectSubscription> | null;
1829
+ readonly [_EFFECT_BACK_REF]: Map<_EffectProperty | string, EffectSubscription> | null;
1799
1830
  setProp(name: string, value: any): void;
1800
1831
  getProp(name: string): any;
1801
1832
  removeProp(name: string): void;
@@ -1810,7 +1841,7 @@ export declare const _isStore: (value: object) => boolean;
1810
1841
  export declare function _isStringifiable(value: unknown): value is _Stringifiable;
1811
1842
 
1812
1843
  /** @internal */
1813
- export declare const _isTask: (value: any) => value is Task;
1844
+ export declare const _isTask: (value: any) => value is _Task;
1814
1845
 
1815
1846
  /** @internal */
1816
1847
  declare interface IStreamHandler {
@@ -2130,6 +2161,9 @@ export declare type NativeUIEvent = UIEvent;
2130
2161
  /** @public @deprecated Use `WheelEvent` and use the second argument to the handler function for the current event target */
2131
2162
  export declare type NativeWheelEvent = WheelEvent;
2132
2163
 
2164
+ /** @internal */
2165
+ export declare function _newInvokeContext(locale?: string, hostElement?: _HostElement, event?: Exclude<PossibleEvents, typeof RenderEvent>): InvokeContext;
2166
+
2133
2167
  declare interface NodePropData {
2134
2168
  $scopedStyleIdPrefix$: string | null;
2135
2169
  $isConst$: boolean;
@@ -3031,6 +3065,14 @@ export declare const _restProps: (props: PropsProxy, omit?: string[], target?: P
3031
3065
  /** @internal */
3032
3066
  export declare const _reT: ({ cleanup }: TaskCtx) => void;
3033
3067
 
3068
+ /**
3069
+ * Retries a function that throws a promise. If you pass `onError`, you're responsible for handling
3070
+ * errors.
3071
+ *
3072
+ * @internal
3073
+ */
3074
+ export declare function _retryOnPromise<T>(fn: () => ValueOrPromise<T>, onError?: (e: any) => ValueOrPromise<T>): ValueOrPromise<T>;
3075
+
3034
3076
  /** @public @experimental */
3035
3077
  export declare const Reveal: typeof _reC;
3036
3078
 
@@ -3312,7 +3354,7 @@ export declare abstract class _SharedContainer implements _Container {
3312
3354
  $resolveRenderPromise$: (() => void) | null;
3313
3355
  $pendingCount$: number;
3314
3356
  constructor(serverData: Record<string, any>, locale: string);
3315
- trackSignalValue<T>(signal: Signal, subscriber: HostElement, property: string, data: _SubscriptionData): T;
3357
+ trackSignalValue<T>(signal: Signal, subscriber: _HostElement, property: string, data: _SubscriptionData): T;
3316
3358
  serializationCtxFactory(NodeConstructor: {
3317
3359
  new (...rest: any[]): {
3318
3360
  __brand__: 'SsrNode';
@@ -3323,14 +3365,14 @@ export declare abstract class _SharedContainer implements _Container {
3323
3365
  };
3324
3366
  } | null, symbolToChunkResolver: SymbolToChunkResolver, writer?: StreamWriter): SerializationContext;
3325
3367
  $checkPendingCount$(): void;
3326
- abstract ensureProjectionResolved(host: HostElement): void;
3327
- abstract handleError(err: any, $host$: HostElement | null): void;
3328
- abstract getParentHost(host: HostElement): HostElement | null;
3329
- abstract setContext<T>(host: HostElement, context: ContextId<T>, value: T): void;
3330
- abstract resolveContext<T>(host: HostElement, contextId: ContextId<T>): T | undefined;
3331
- abstract setHostProp<T>(host: HostElement, name: string, value: T): void;
3332
- abstract getHostProp<T>(host: HostElement, name: string): T | null;
3333
- abstract $appendStyle$(content: string, styleId: string, host: HostElement, scoped: boolean): void;
3368
+ abstract ensureProjectionResolved(host: _HostElement): void;
3369
+ abstract handleError(err: any, $host$: _HostElement | null): void;
3370
+ abstract getParentHost(host: _HostElement): _HostElement | null;
3371
+ abstract setContext<T>(host: _HostElement, context: ContextId<T>, value: T): void;
3372
+ abstract resolveContext<T>(host: _HostElement, contextId: ContextId<T>): T | undefined;
3373
+ abstract setHostProp<T>(host: _HostElement, name: string, value: T): void;
3374
+ abstract getHostProp<T>(host: _HostElement, name: string): T | null;
3375
+ abstract $appendStyle$(content: string, styleId: string, host: _HostElement, scoped: boolean): void;
3334
3376
  }
3335
3377
 
3336
3378
  /**
@@ -3798,6 +3840,13 @@ declare type StopPropagation = {
3798
3840
  [K in keyof HTMLElementEventMap as `stoppropagation:${K}`]?: boolean;
3799
3841
  };
3800
3842
 
3843
+ /** @internal */
3844
+ export declare const enum _StoreFlags {
3845
+ NONE = 0,
3846
+ RECURSIVE = 1,
3847
+ IMMUTABLE = 2
3848
+ }
3849
+
3801
3850
  declare type StoreTarget = Record<string | symbol, any>;
3802
3851
 
3803
3852
  /** @internal */
@@ -4146,16 +4195,17 @@ declare type TableCellSpecialAttrs = {
4146
4195
  valign?: 'top' | 'middle' | 'bottom' | 'baseline' | undefined;
4147
4196
  };
4148
4197
 
4149
- declare class Task<T = unknown, B = T> extends BackRef implements DescriptorBase<unknown, Signal<B>> {
4198
+ /** @internal */
4199
+ export declare class _Task<T = unknown, B = T> extends BackRef implements DescriptorBase<unknown, Signal<B>> {
4150
4200
  $flags$: number;
4151
4201
  $index$: number;
4152
- $el$: HostElement;
4202
+ $el$: _HostElement;
4153
4203
  $qrl$: _QRLInternal<T>;
4154
4204
  $state$: Signal<B> | undefined;
4155
4205
  $destroy$: (() => void) | null;
4156
4206
  $destroyPromise$: Promise<void> | undefined;
4157
4207
  $taskPromise$: Promise<void> | null;
4158
- constructor($flags$: number, $index$: number, $el$: HostElement, $qrl$: _QRLInternal<T>, $state$: Signal<B> | undefined, $destroy$: (() => void) | null);
4208
+ constructor($flags$: number, $index$: number, $el$: _HostElement, $qrl$: _QRLInternal<T>, $state$: Signal<B> | undefined, $destroy$: (() => void) | null);
4159
4209
  }
4160
4210
 
4161
4211
  /**
@@ -4989,7 +5039,7 @@ export declare const _VAR_PROPS: unique symbol;
4989
5039
  export declare const _verifySerializable: <T>(value: T, preMessage?: string) => T;
4990
5040
 
4991
5041
  /**
4992
- * 2.0.0-beta.36-dev+3268fab
5042
+ * 2.0.0-beta.37-dev+82dc74d
4993
5043
  *
4994
5044
  * @public
4995
5045
  */
@@ -5180,8 +5230,8 @@ declare class WrappedSignalImpl<T> extends SignalImpl<T> {
5180
5230
  $func$: (...args: any[]) => T;
5181
5231
  $funcStr$: string | null;
5182
5232
  $flags$: AllSignalFlags;
5183
- $hostElement$: HostElement | undefined;
5184
- [_EFFECT_BACK_REF]: Map<EffectProperty | string, EffectSubscription> | undefined;
5233
+ $hostElement$: _HostElement | undefined;
5234
+ [_EFFECT_BACK_REF]: Map<_EffectProperty | string, EffectSubscription> | undefined;
5185
5235
  constructor(container: _Container | null, fn: (...args: any[]) => T, args: any[], fnStr: string | null, flags?: SignalFlags);
5186
5236
  invalidate(): void;
5187
5237
  get untrackedValue(): T;