@qwik.dev/core 2.0.0-beta.14 → 2.0.0-beta.16

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.14-dev+1e7496d",
3
+ "version": "2.0.0-beta.16-dev+a83ccf3",
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.14-dev+1e7496d",
3
+ "version": "2.0.0-beta.16-dev+a83ccf3",
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.14-dev+1e7496d
3
+ * @qwik.dev/core/cli 2.0.0-beta.16-dev+a83ccf3
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
@@ -5625,7 +5625,7 @@ async function printHelp(app) {
5625
5625
  await runCommand2(Object.assign(app, { task: args[0], args }));
5626
5626
  }
5627
5627
  function printVersion() {
5628
- console.log("2.0.0-beta.14-dev+1e7496d");
5628
+ console.log("2.0.0-beta.16-dev+a83ccf3");
5629
5629
  }
5630
5630
  export {
5631
5631
  runCli,
@@ -383,13 +383,13 @@ export declare type AsyncComputedReturnType<T> = T extends Promise<infer T> ? As
383
383
  */
384
384
  declare class AsyncComputedSignalImpl<T> extends ComputedSignalImpl<T | undefined, AsyncComputeQRL<T>> implements BackRef {
385
385
  $untrackedLoading$: boolean;
386
- $untrackedError$: Error | null;
387
- $loadingEffects$: null | Set<EffectSubscription>;
388
- $errorEffects$: null | Set<EffectSubscription>;
386
+ $untrackedError$: Error | undefined;
387
+ $loadingEffects$: undefined | Set<EffectSubscription>;
388
+ $errorEffects$: undefined | Set<EffectSubscription>;
389
389
  $destroy$: NoSerialize<() => void> | null;
390
390
  $promiseValue$: T | typeof NEEDS_COMPUTATION;
391
391
  private $promise$;
392
- [_EFFECT_BACK_REF]: Map<EffectProperty | string, EffectSubscription> | null;
392
+ [_EFFECT_BACK_REF]: Map<EffectProperty | string, EffectSubscription> | undefined;
393
393
  constructor(container: Container | null, fn: AsyncComputeQRL<T>, flags?: SignalFlags | SerializationSignalFlags);
394
394
  /**
395
395
  * Loading is true if the signal is still waiting for the promise to resolve, false if the promise
@@ -399,9 +399,9 @@ declare class AsyncComputedSignalImpl<T> extends ComputedSignalImpl<T | undefine
399
399
  set untrackedLoading(value: boolean);
400
400
  get untrackedLoading(): boolean;
401
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;
402
+ get error(): Error | undefined;
403
+ set untrackedError(value: Error | undefined);
404
+ get untrackedError(): Error | undefined;
405
405
  invalidate(): void;
406
406
  promise(): Promise<T>;
407
407
  $computeIfNeeded$(): Promise<void> | undefined;
@@ -409,7 +409,7 @@ declare class AsyncComputedSignalImpl<T> extends ComputedSignalImpl<T | undefine
409
409
  private setValue;
410
410
  }
411
411
 
412
- declare type AsyncComputeQRL<T> = QRLInternal<AsyncComputedFn<T>>;
412
+ declare type AsyncComputeQRL<T> = _QRLInternal<AsyncComputedFn<T>>;
413
413
 
414
414
  /**
415
415
  * Replace given element's props with custom types and return all props specific to the element. Use
@@ -421,7 +421,7 @@ declare type Augmented<E, A = {}> = Prettify<Filtered<E, A> & A>;
421
421
 
422
422
  /** Class for back reference to the EffectSubscription */
423
423
  declare abstract class BackRef {
424
- [_EFFECT_BACK_REF]: Map<EffectProperty | string, EffectSubscription> | null;
424
+ [_EFFECT_BACK_REF]: Map<EffectProperty | string, EffectSubscription> | undefined;
425
425
  }
426
426
 
427
427
  declare type BivariantQrlFn<ARGS extends any[], RETURN> = {
@@ -473,7 +473,7 @@ declare enum ChoreState {
473
473
  DONE = 3
474
474
  }
475
475
 
476
- declare type ChoreTarget = HostElement | QRLInternal<(...args: unknown[]) => unknown> | Signal | StoreTarget;
476
+ declare type ChoreTarget = HostElement | _QRLInternal<(...args: unknown[]) => unknown> | Signal | StoreTarget;
477
477
 
478
478
  declare const enum ChoreType {
479
479
  MACRO = 240,
@@ -646,7 +646,7 @@ export declare interface ComputedSignal<T> extends ReadonlySignal<T> {
646
646
  *
647
647
  * The value is available synchronously, but the computation is done lazily.
648
648
  */
649
- declare class ComputedSignalImpl<T, S extends QRLInternal = ComputeQRL<T>> extends SignalImpl<T> implements BackRef {
649
+ declare class ComputedSignalImpl<T, S extends _QRLInternal = ComputeQRL<T>> extends SignalImpl<T> implements BackRef {
650
650
  /**
651
651
  * The compute function is stored here.
652
652
  *
@@ -655,7 +655,7 @@ declare class ComputedSignalImpl<T, S extends QRLInternal = ComputeQRL<T>> exten
655
655
  */
656
656
  $computeQrl$: S;
657
657
  $flags$: SignalFlags | SerializationSignalFlags;
658
- [_EFFECT_BACK_REF]: Map<EffectProperty | string, EffectSubscription> | null;
658
+ [_EFFECT_BACK_REF]: Map<EffectProperty | string, EffectSubscription> | undefined;
659
659
  constructor(container: Container | null, fn: S, flags?: SignalFlags | SerializationSignalFlags);
660
660
  invalidate(): void;
661
661
  /**
@@ -669,7 +669,7 @@ declare class ComputedSignalImpl<T, S extends QRLInternal = ComputeQRL<T>> exten
669
669
  get value(): any;
670
670
  }
671
671
 
672
- declare type ComputeQRL<T> = QRLInternal<ComputedFn<T>>;
672
+ declare type ComputeQRL<T> = _QRLInternal<ComputedFn<T>>;
673
673
 
674
674
  /** @internal */
675
675
  export declare const _CONST_PROPS: unique symbol;
@@ -950,13 +950,13 @@ export declare const createComputedQrl: <T>(qrl: QRL<() => T>, options?: Compute
950
950
  */
951
951
  export declare const createContextId: <STATE = unknown>(name: string) => ContextId<STATE>;
952
952
 
953
- declare const createScheduler: (container: Container, journalFlush: () => void, choreQueue: ChoreArray, blockedChores: Set<Chore>, runningChores: Set<Chore>) => {
953
+ declare const createScheduler: (container: Container, journalFlush: () => void, choreQueue: ChoreArray, blockedChores: ChoreArray, runningChores: Set<Chore>) => {
954
954
  (type: ChoreType.QRL_RESOLVE, ignore: null, target: ComputeQRL<any> | AsyncComputeQRL<any>): Chore<ChoreType.QRL_RESOLVE>;
955
955
  (type: ChoreType.WAIT_FOR_QUEUE): Chore<ChoreType.WAIT_FOR_QUEUE>;
956
- (type: ChoreType.RECOMPUTE_AND_SCHEDULE_EFFECTS, host: HostElement | null, target: Signal<unknown> | StoreTarget, effects: Set<EffectSubscription> | null): Chore<ChoreType.RECOMPUTE_AND_SCHEDULE_EFFECTS>;
956
+ (type: ChoreType.RECOMPUTE_AND_SCHEDULE_EFFECTS, host: HostElement | undefined, target: Signal<unknown> | StoreTarget, effects: Set<EffectSubscription> | undefined): Chore<ChoreType.RECOMPUTE_AND_SCHEDULE_EFFECTS>;
957
957
  (type: ChoreType.TASK | ChoreType.VISIBLE, task: Task): Chore<ChoreType.TASK | ChoreType.VISIBLE>;
958
- (type: ChoreType.RUN_QRL, host: HostElement, target: QRLInternal<(...args: unknown[]) => unknown>, args: unknown[]): Chore<ChoreType.RUN_QRL>;
959
- (type: ChoreType.COMPONENT, host: HostElement, qrl: QRLInternal<OnRenderFn<unknown>>, props: Props | null): Chore<ChoreType.COMPONENT>;
958
+ (type: ChoreType.RUN_QRL, host: HostElement, target: _QRLInternal<(...args: unknown[]) => unknown>, args: unknown[]): Chore<ChoreType.RUN_QRL>;
959
+ (type: ChoreType.COMPONENT, host: HostElement, qrl: _QRLInternal<OnRenderFn<unknown>>, props: Props | null): Chore<ChoreType.COMPONENT>;
960
960
  (type: ChoreType.NODE_DIFF, host: HostElement, target: HostElement, value: JSXOutput | Signal): Chore<ChoreType.NODE_DIFF>;
961
961
  (type: ChoreType.NODE_PROP, host: HostElement, prop: string, value: any): Chore<ChoreType.NODE_PROP>;
962
962
  (type: ChoreType.CLEANUP_VISIBLE, task: Task): Chore<ChoreType.CLEANUP_VISIBLE>;
@@ -1004,7 +1004,7 @@ declare interface DescriptorBase<T = unknown, B = unknown> extends BackRef {
1004
1004
  $flags$: number;
1005
1005
  $index$: number;
1006
1006
  $el$: HostElement;
1007
- $qrl$: QRLInternal<T>;
1007
+ $qrl$: _QRLInternal<T>;
1008
1008
  $state$: B | undefined;
1009
1009
  $destroy$: NoSerialize<() => void> | null;
1010
1010
  }
@@ -1591,6 +1591,21 @@ export declare interface JSXNode<T extends string | FunctionComponent | unknown
1591
1591
  dev?: DevJSX;
1592
1592
  }
1593
1593
 
1594
+ declare class JSXNodeImpl<T = unknown> implements JSXNodeInternal<T> {
1595
+ type: T;
1596
+ toSort: boolean;
1597
+ key: string | null;
1598
+ varProps: Props;
1599
+ constProps: Props | null;
1600
+ children: JSXChildren;
1601
+ dev?: DevJSX & {
1602
+ stack: string | undefined;
1603
+ };
1604
+ _proxy: Props | null;
1605
+ constructor(type: T, varProps?: Props | null, constProps?: Props | null, children?: JSXChildren, key?: string | number | null, toSort?: boolean, dev?: DevJSX);
1606
+ get props(): T extends FunctionComponent<infer PROPS> ? PROPS : Props;
1607
+ }
1608
+
1594
1609
  /**
1595
1610
  * The internal representation of a JSX Node.
1596
1611
  *
@@ -1990,6 +2005,9 @@ export declare type PropFunction<T> = QRL<T>;
1990
2005
 
1991
2006
  declare type Props = Record<string, unknown>;
1992
2007
 
2008
+ /** @internal */
2009
+ declare const _PROPS_HANDLER: unique symbol;
2010
+
1993
2011
  /**
1994
2012
  * Infers `Props` from the component or tag.
1995
2013
  *
@@ -2013,7 +2031,21 @@ declare type PropsProxy = {
2013
2031
  [_VAR_PROPS]: Props;
2014
2032
  [_CONST_PROPS]: Props | null;
2015
2033
  [_OWNER]: JSXNodeInternal;
2016
- };
2034
+ [_PROPS_HANDLER]: PropsProxyHandler;
2035
+ } & Record<string | symbol, unknown>;
2036
+
2037
+ declare class PropsProxyHandler implements ProxyHandler<any> {
2038
+ owner: JSXNodeImpl;
2039
+ $effects$: undefined | Map<string | symbol, Set<EffectSubscription>>;
2040
+ $container$: Container | null;
2041
+ constructor(owner: JSXNodeImpl);
2042
+ get(_: any, prop: string | symbol): any;
2043
+ set(_: any, prop: string | symbol, value: any): boolean;
2044
+ deleteProperty(_: any, prop: string | symbol): boolean;
2045
+ has(_: any, prop: string | symbol): boolean;
2046
+ getOwnPropertyDescriptor(_: any, p: string | symbol): PropertyDescriptor | undefined;
2047
+ ownKeys(): string[];
2048
+ }
2017
2049
 
2018
2050
  declare type PropType<T extends object, P extends keyof T> = P extends keyof T ? T[P] : 'value' extends keyof T ? T['value'] : never;
2019
2051
 
@@ -2203,7 +2235,8 @@ export declare const qrlDEV: <T = any>(chunkOrFn: string | (() => Promise<any>),
2203
2235
  */
2204
2236
  export declare type QRLEventHandlerMulti<EV extends Event, EL> = QRL<EventHandler<EV, EL>> | undefined | null | QRLEventHandlerMulti<EV, EL>[];
2205
2237
 
2206
- declare type QRLInternal<TYPE = unknown> = QRL<TYPE> & QRLInternalMethods<TYPE>;
2238
+ /** @internal */
2239
+ export declare type _QRLInternal<TYPE = unknown> = QRL<TYPE> & QRLInternalMethods<TYPE>;
2207
2240
 
2208
2241
  declare type QRLInternalMethods<TYPE> = {
2209
2242
  readonly $chunk$: string | null;
@@ -2883,7 +2916,7 @@ declare interface SerializerSignal<T> extends ComputedSignal<T> {
2883
2916
  * @public
2884
2917
  */
2885
2918
  declare class SerializerSignalImpl<T, S> extends ComputedSignalImpl<T> {
2886
- constructor(container: Container | null, argQrl: QRLInternal<SerializerArg<T, S>>);
2919
+ constructor(container: Container | null, argQrl: _QRLInternal<SerializerArg<T, S>>);
2887
2920
  $didInitialize$: boolean;
2888
2921
  $computeIfNeeded$(): void;
2889
2922
  }
@@ -2982,7 +3015,7 @@ declare const enum SignalFlags {
2982
3015
  declare class SignalImpl<T = any> implements Signal<T> {
2983
3016
  $untrackedValue$: T;
2984
3017
  /** Store a list of effects which are dependent on this signal. */
2985
- $effects$: null | Set<EffectSubscription>;
3018
+ $effects$: undefined | Set<EffectSubscription>;
2986
3019
  $container$: Container | null;
2987
3020
  $wrappedSignal$: WrappedSignalImpl<T> | null;
2988
3021
  constructor(container: Container | null, value: T);
@@ -3696,10 +3729,10 @@ declare class Task<T = unknown, B = T> extends BackRef implements DescriptorBase
3696
3729
  $flags$: number;
3697
3730
  $index$: number;
3698
3731
  $el$: HostElement;
3699
- $qrl$: QRLInternal<T>;
3732
+ $qrl$: _QRLInternal<T>;
3700
3733
  $state$: Signal<B> | ResourceReturnInternal<B> | undefined;
3701
3734
  $destroy$: NoSerialize<() => void> | null;
3702
- constructor($flags$: number, $index$: number, $el$: HostElement, $qrl$: QRLInternal<T>, $state$: Signal<B> | ResourceReturnInternal<B> | undefined, $destroy$: NoSerialize<() => void> | null);
3735
+ constructor($flags$: number, $index$: number, $el$: HostElement, $qrl$: _QRLInternal<T>, $state$: Signal<B> | ResourceReturnInternal<B> | undefined, $destroy$: NoSerialize<() => void> | null);
3703
3736
  }
3704
3737
 
3705
3738
  /**
@@ -4453,7 +4486,7 @@ export declare const _VAR_PROPS: unique symbol;
4453
4486
  export declare const _verifySerializable: <T>(value: T, preMessage?: string) => T;
4454
4487
 
4455
4488
  /**
4456
- * 2.0.0-beta.14-dev+1e7496d
4489
+ * 2.0.0-beta.16-dev+a83ccf3
4457
4490
  *
4458
4491
  * @public
4459
4492
  */
@@ -4637,8 +4670,8 @@ declare class WrappedSignalImpl<T> extends SignalImpl<T> implements BackRef {
4637
4670
  $func$: (...args: any[]) => T;
4638
4671
  $funcStr$: string | null;
4639
4672
  $flags$: AllSignalFlags;
4640
- $hostElement$: HostElement | null;
4641
- [_EFFECT_BACK_REF]: Map<EffectProperty | string, EffectSubscription> | null;
4673
+ $hostElement$: HostElement | undefined;
4674
+ [_EFFECT_BACK_REF]: Map<EffectProperty | string, EffectSubscription> | undefined;
4642
4675
  constructor(container: Container | null, fn: (...args: any[]) => T, args: any[], fnStr: string | null, flags?: SignalFlags);
4643
4676
  invalidate(): void;
4644
4677
  /**