@qwik.dev/core 2.0.0-beta.28 → 2.0.0-beta.29
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.
- package/bindings/qwik.darwin-arm64.node +0 -0
- package/bindings/qwik.linux-x64-gnu.node +0 -0
- package/bindings/qwik.win32-x64-msvc.node +0 -0
- package/bindings/qwik_wasm_bg.wasm +0 -0
- package/dist/backpatch/package.json +1 -1
- package/dist/build/package.json +1 -1
- package/dist/cli.mjs +2 -2
- package/dist/core-internal.d.ts +81 -10
- package/dist/core.min.mjs +1 -1
- package/dist/core.mjs +431 -201
- package/dist/core.mjs.map +1 -1
- package/dist/core.prod.mjs +2440 -2309
- package/dist/loader/package.json +1 -1
- package/dist/optimizer.mjs +2 -2
- package/dist/server.mjs +2 -2
- package/dist/server.prod.mjs +254 -254
- package/dist/testing/index.d.ts +42 -8
- package/dist/testing/index.mjs +407 -291
- package/dist/testing/package.json +1 -1
- package/package.json +2 -2
- package/public.d.ts +1 -0
package/dist/testing/index.d.ts
CHANGED
|
@@ -429,6 +429,25 @@ declare interface JSXNodeInternal_2<T extends string | FunctionComponent | unkno
|
|
|
429
429
|
*/
|
|
430
430
|
declare type JSXOutput_2 = JSXNode | string | number | boolean | null | undefined | JSXOutput_2[];
|
|
431
431
|
|
|
432
|
+
/**
|
|
433
|
+
* Shared lazy-loading reference that holds module loading metadata. Multiple QRLs pointing to the
|
|
434
|
+
* same chunk+symbol can share a single LazyRef, differing only in their captured scope.
|
|
435
|
+
*/
|
|
436
|
+
declare class LazyRef<TYPE = unknown> {
|
|
437
|
+
readonly $chunk$: string | null;
|
|
438
|
+
readonly $symbol$: string;
|
|
439
|
+
readonly $symbolFn$: undefined | null | (() => Promise<Record<string, TYPE>>);
|
|
440
|
+
$ref$?: (null | ValueOrPromise<TYPE>) | undefined;
|
|
441
|
+
$container$: Container | undefined;
|
|
442
|
+
dev?: QRLDev | null | undefined;
|
|
443
|
+
constructor($chunk$: string | null, $symbol$: string, $symbolFn$: undefined | null | (() => Promise<Record<string, TYPE>>), $ref$?: (null | ValueOrPromise<TYPE>) | undefined, container?: Container | null);
|
|
444
|
+
/** We don't read hash very often so let's not allocate a string for every QRL */
|
|
445
|
+
get $hash$(): string;
|
|
446
|
+
$setRef$(ref: ValueOrPromise<TYPE>): void;
|
|
447
|
+
/** Load the raw module export without capture binding. */
|
|
448
|
+
$load$(): ValueOrPromise<TYPE>;
|
|
449
|
+
}
|
|
450
|
+
|
|
432
451
|
/** @public */
|
|
433
452
|
declare interface MockDocument extends Document {
|
|
434
453
|
}
|
|
@@ -637,21 +656,35 @@ declare type QRLInternalMethods<TYPE> = {
|
|
|
637
656
|
readonly $symbol$: string;
|
|
638
657
|
readonly $hash$: string;
|
|
639
658
|
/** If it's a string it's serialized */
|
|
640
|
-
$captures
|
|
641
|
-
dev
|
|
659
|
+
readonly $captures$?: Readonly<unknown[]> | string | null;
|
|
660
|
+
dev?: QRLDev | null;
|
|
642
661
|
resolve(container?: Container): Promise<TYPE>;
|
|
643
662
|
resolved: undefined | TYPE;
|
|
644
663
|
getSymbol(): string;
|
|
645
664
|
getHash(): string;
|
|
646
665
|
getCaptured(): unknown[] | null;
|
|
647
|
-
getFn(currentCtx?: InvokeContext,
|
|
666
|
+
getFn(currentCtx?: InvokeContext,
|
|
667
|
+
/** If this returns false, the function execution will be skipped */
|
|
668
|
+
beforeFn?: () => void | false): TYPE extends (...args: any) => any ? (...args: Parameters<TYPE>) => ValueOrPromise<ReturnType<TYPE> | undefined> : unknown;
|
|
669
|
+
$callFn$(withThis: unknown, ...args: QrlArgs<TYPE>): ValueOrPromise<QrlReturn<TYPE>>;
|
|
670
|
+
/**
|
|
671
|
+
* "with captures" - Get a new QRL for these captures, reusing the lazy ref. It's an internal
|
|
672
|
+
* method but we need to have a stable name because it gets called in user code by the optimizer,
|
|
673
|
+
* after the $name$ props are mangled
|
|
674
|
+
*/
|
|
675
|
+
w(captures: Readonly<unknown[]> | string | null): QRLInternal<TYPE>;
|
|
676
|
+
/**
|
|
677
|
+
* "set ref" - Set the ref of the QRL. It's an internal method but we need to have a stable name
|
|
678
|
+
* because it gets called in user code by the optimizer, after the $name$ props are mangled
|
|
679
|
+
*/
|
|
680
|
+
s(ref: ValueOrPromise<TYPE>): void;
|
|
648
681
|
/**
|
|
649
682
|
* Needed for deserialization and importing. We don't always have the container while creating
|
|
650
683
|
* qrls in async sections of code
|
|
651
684
|
*/
|
|
652
|
-
$container
|
|
653
|
-
/**
|
|
654
|
-
$
|
|
685
|
+
readonly $container$?: Container | null;
|
|
686
|
+
/** The shared lazy-loading reference */
|
|
687
|
+
readonly $lazy$: LazyRef<TYPE>;
|
|
655
688
|
};
|
|
656
689
|
|
|
657
690
|
declare type QrlReturn<T> = T extends (...args: any) => infer R ? Awaited<R> : unknown;
|
|
@@ -746,7 +779,7 @@ declare class SignalImpl<T = any> implements Signal<T> {
|
|
|
746
779
|
$effects$: undefined | Set<EffectSubscription>;
|
|
747
780
|
$container$: Container | null;
|
|
748
781
|
$wrappedSignal$: WrappedSignalImpl<T> | null;
|
|
749
|
-
constructor(container: Container | null, value: T);
|
|
782
|
+
constructor(container: Container | null | undefined, value: T);
|
|
750
783
|
/**
|
|
751
784
|
* Use this to trigger running subscribers, for example when the calculated value has mutated but
|
|
752
785
|
* remained the same object
|
|
@@ -980,7 +1013,8 @@ declare const enum VNodeFlags {
|
|
|
980
1013
|
NEGATED_NAMESPACE_MASK = -1537,
|
|
981
1014
|
NS_html = 0,// http://www.w3.org/1999/xhtml
|
|
982
1015
|
NS_svg = 512,// http://www.w3.org/2000/svg
|
|
983
|
-
NS_math = 1024
|
|
1016
|
+
NS_math = 1024,// http://www.w3.org/1998/Math/MathML
|
|
1017
|
+
HasTargetElement = 2048
|
|
984
1018
|
}
|
|
985
1019
|
|
|
986
1020
|
/**
|