@qwik.dev/core 2.0.0-beta.38 → 2.0.0-beta.39
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/dist/backpatch/package.json +1 -1
- package/dist/build/package.json +1 -1
- package/dist/cli.mjs +14 -5
- package/dist/core-internal.d.ts +19 -76
- package/dist/core.min.mjs +9 -9
- package/dist/core.mjs +177 -266
- package/dist/core.mjs.map +1 -1
- package/dist/core.prod.mjs +2647 -2716
- package/dist/loader/index.mjs +2 -2
- package/dist/loader/package.json +1 -1
- package/dist/optimizer.mjs +1681 -1754
- package/dist/qwikloader.debug.js +1 -1
- package/dist/qwikloader.js +1 -1
- package/dist/server.mjs +28 -28
- package/dist/server.prod.mjs +282 -283
- package/dist/starters/adapters/fastify/package.json +2 -2
- package/dist/starters/features/csr/package.json +1 -1
- package/dist/starters/features/drizzle/package.json +1 -1
- package/dist/starters/features/vitest/package.json +1 -1
- package/dist/testing/index.d.ts +4 -2
- package/dist/testing/index.mjs +188 -257
- package/dist/testing/package.json +1 -1
- package/dist/worker/package.json +1 -1
- package/package.json +6 -6
package/dist/build/package.json
CHANGED
package/dist/cli.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* @qwik.dev/core/cli 2.0.0-beta.
|
|
3
|
+
* @qwik.dev/core/cli 2.0.0-beta.39-dev+6fb620f
|
|
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
|
|
@@ -19,11 +19,20 @@ var __require = /* @__PURE__ */ ((x2) => typeof require !== "undefined" ? requir
|
|
|
19
19
|
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
20
20
|
throw Error('Dynamic require of "' + x2 + '" is not supported');
|
|
21
21
|
});
|
|
22
|
-
var __esm = (fn, res) => function __init() {
|
|
23
|
-
|
|
22
|
+
var __esm = (fn, res, err) => function __init() {
|
|
23
|
+
if (err) throw err[0];
|
|
24
|
+
try {
|
|
25
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
26
|
+
} catch (e2) {
|
|
27
|
+
throw err = [e2], e2;
|
|
28
|
+
}
|
|
24
29
|
};
|
|
25
30
|
var __commonJS = (cb, mod) => function __require2() {
|
|
26
|
-
|
|
31
|
+
try {
|
|
32
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
33
|
+
} catch (e2) {
|
|
34
|
+
throw mod = 0, e2;
|
|
35
|
+
}
|
|
27
36
|
};
|
|
28
37
|
var __export = (target, all) => {
|
|
29
38
|
for (var name in all)
|
|
@@ -12957,7 +12966,7 @@ async function printHelp(app) {
|
|
|
12957
12966
|
await runCommand2(Object.assign(app, { task: args[0], args }));
|
|
12958
12967
|
}
|
|
12959
12968
|
function printVersion() {
|
|
12960
|
-
console.log("2.0.0-beta.
|
|
12969
|
+
console.log("2.0.0-beta.39-dev+6fb620f");
|
|
12961
12970
|
}
|
|
12962
12971
|
export {
|
|
12963
12972
|
runCli,
|
package/dist/core-internal.d.ts
CHANGED
|
@@ -409,8 +409,6 @@ export declare type AsyncSignal<T = unknown> = ComputedSignal<T>;
|
|
|
409
409
|
declare const enum AsyncSignalFlags {
|
|
410
410
|
EAGER_CLEANUP = 32,
|
|
411
411
|
CLIENT_ONLY = 64,
|
|
412
|
-
CLEAR_ON_INVALIDATE = 128,
|
|
413
|
-
NO_POLL = 256,
|
|
414
412
|
/** The compute fn is async: the async engine (jobs, loading, error) is active */
|
|
415
413
|
ASYNC_MODE = 512,
|
|
416
414
|
/** Invoke the compute fn AsyncSignal-style: pass the ComputeCtx argument, no auto-tracking */
|
|
@@ -424,9 +422,9 @@ declare const enum AsyncSignalFlags {
|
|
|
424
422
|
*
|
|
425
423
|
* # ================================
|
|
426
424
|
*
|
|
427
|
-
* The async engine (jobs, loading, error
|
|
428
|
-
*
|
|
429
|
-
*
|
|
425
|
+
* The async engine (jobs, loading, error) lives in ComputedSignalImpl; this subclass configures it
|
|
426
|
+
* from options and switches the compute invocation to CTX_ARG mode: the compute fn receives the
|
|
427
|
+
* ComputeCtx argument and tracks only via its explicit `track()` (no auto-tracking).
|
|
430
428
|
*
|
|
431
429
|
* @internal
|
|
432
430
|
*/
|
|
@@ -668,25 +666,6 @@ export declare interface ComputedOptions<T = unknown> {
|
|
|
668
666
|
* Defaults to `false`, meaning cleanup happens only when inputs change.
|
|
669
667
|
*/
|
|
670
668
|
eagerCleanup?: boolean;
|
|
671
|
-
/**
|
|
672
|
-
* Time in milliseconds after which the value expires.
|
|
673
|
-
*
|
|
674
|
-
* When the value expires and subscribers exist, the signal is invalidated. If `poll` is `true`
|
|
675
|
-
* (default), the function is re-run automatically. If `poll` is `false`, the value is marked
|
|
676
|
-
* stale and recomputation happens when reading `.value` or `.loading`.
|
|
677
|
-
*
|
|
678
|
-
* `0` (default) means no expiration.
|
|
679
|
-
*/
|
|
680
|
-
expires?: number;
|
|
681
|
-
/**
|
|
682
|
-
* Whether to automatically re-run the function when the value expires. Only relevant when
|
|
683
|
-
* `expires` is set.
|
|
684
|
-
*
|
|
685
|
-
* Defaults to `true`.
|
|
686
|
-
*/
|
|
687
|
-
poll?: boolean;
|
|
688
|
-
/** @deprecated Use `expires` and `poll` instead. Will be removed before v2 */
|
|
689
|
-
interval?: number;
|
|
690
669
|
/**
|
|
691
670
|
* When true, the async computation is postponed to the browser. On SSR, the signal remains
|
|
692
671
|
* INVALID and does not execute the function. On the client, it will compute on first read.
|
|
@@ -694,23 +673,6 @@ export declare interface ComputedOptions<T = unknown> {
|
|
|
694
673
|
* Defaults to `false`.
|
|
695
674
|
*/
|
|
696
675
|
clientOnly?: boolean;
|
|
697
|
-
/**
|
|
698
|
-
* When true (default), the previous value is kept while the signal re-computes after
|
|
699
|
-
* invalidation, so reads return stale data instead of throwing a promise. Reactivity will then
|
|
700
|
-
* update the readers when the new value is ready.
|
|
701
|
-
*
|
|
702
|
-
* When false, invalidation clears the value so reads throw the computation promise (like the
|
|
703
|
-
* initial load), which is useful for navigations where showing old data would be confusing.
|
|
704
|
-
*
|
|
705
|
-
* Note that polling invalidations (`expires` with `poll: true`) are not affected by this option
|
|
706
|
-
* and will keep the old value while the new value is loading, to avoid flashing loaders.
|
|
707
|
-
*
|
|
708
|
-
* This option only affects manual invalidations via `invalidate()`, and non-polling expirations
|
|
709
|
-
* (`poll: false`, or there are no subscribers).
|
|
710
|
-
*
|
|
711
|
-
* Defaults to `true`.
|
|
712
|
-
*/
|
|
713
|
-
allowStale?: boolean;
|
|
714
676
|
/**
|
|
715
677
|
* Maximum time in milliseconds to wait for the async computation to complete. If exceeded, the
|
|
716
678
|
* computation is aborted and an error is thrown.
|
|
@@ -737,6 +699,11 @@ export declare interface ComputedSignal<T> extends Signal<T> {
|
|
|
737
699
|
force(): void;
|
|
738
700
|
/** Use this to force recalculation. */
|
|
739
701
|
invalidate(): void;
|
|
702
|
+
/**
|
|
703
|
+
* Clear the value and recompute. Unlike `invalidate()`, readers see the loading state (reads
|
|
704
|
+
* throw the computation promise) instead of the stale value while the new value computes.
|
|
705
|
+
*/
|
|
706
|
+
clear(): void;
|
|
740
707
|
/**
|
|
741
708
|
* Whether the signal is currently loading. This will trigger lazy computation of the signal, so
|
|
742
709
|
* you can use it like this:
|
|
@@ -771,22 +738,6 @@ export declare interface ComputedSignal<T> extends Signal<T> {
|
|
|
771
738
|
* Setting it will trigger listeners for `.error`.
|
|
772
739
|
*/
|
|
773
740
|
untrackedError: Error | undefined;
|
|
774
|
-
/**
|
|
775
|
-
* Expiration time in ms. Writable and immediately effective.
|
|
776
|
-
*
|
|
777
|
-
* When set, the signal is invalidated after this many ms. Whether it auto-recomputes depends on
|
|
778
|
-
* the `poll` property. `0` means no expiration.
|
|
779
|
-
*/
|
|
780
|
-
expires: number;
|
|
781
|
-
/**
|
|
782
|
-
* Whether to automatically re-run the function when the value expires. Writable and immediately
|
|
783
|
-
* effective. Only relevant when `expires` is set.
|
|
784
|
-
*
|
|
785
|
-
* Defaults to `true`.
|
|
786
|
-
*/
|
|
787
|
-
poll: boolean;
|
|
788
|
-
/** @deprecated Use `expires` and `poll` instead. Will be removed before v2 */
|
|
789
|
-
interval: number;
|
|
790
741
|
/** A promise that resolves when the value is computed or rejected. */
|
|
791
742
|
promise(): Promise<void>;
|
|
792
743
|
/** Abort the current computation and run cleanups if needed. */
|
|
@@ -809,7 +760,7 @@ declare const enum ComputedSignalFlags {
|
|
|
809
760
|
*
|
|
810
761
|
* Sync compute functions resolve synchronously and every read they perform is auto-tracked. When
|
|
811
762
|
* the compute function turns out to be async (it returned a promise), the signal lazily switches on
|
|
812
|
-
* the async engine — jobs, `loading`, `error
|
|
763
|
+
* the async engine — jobs, `loading`, `error` — giving it the same API as an AsyncSignal.
|
|
813
764
|
* Auto-tracking only covers reads before the first await point (the invoke context is lost after
|
|
814
765
|
* it); later reads must use the ComputeCtx `track()`.
|
|
815
766
|
*/
|
|
@@ -828,15 +779,15 @@ declare class ComputedSignalImpl<T, S extends _QRLInternal = ComputeQRL<T>> exte
|
|
|
828
779
|
$current$: Job<T> | null | undefined;
|
|
829
780
|
$jobs$: Job<T>[] | undefined;
|
|
830
781
|
$concurrency$: number | undefined;
|
|
831
|
-
$expires$: number | undefined;
|
|
832
782
|
$timeoutMs$: number | undefined;
|
|
833
783
|
$loadingEffects$: undefined | Set<EffectSubscription>;
|
|
834
784
|
$errorEffects$: undefined | Set<EffectSubscription>;
|
|
835
|
-
$pollTimeoutId$: ReturnType<typeof setTimeout> | undefined;
|
|
836
785
|
$computationTimeoutId$: ReturnType<typeof setTimeout> | undefined;
|
|
837
786
|
$info$: unknown | undefined;
|
|
838
787
|
$infoVersion$: number | undefined;
|
|
839
788
|
constructor(container: _Container | null, fn: S, flags?: number, options?: ComputedOptions<T>);
|
|
789
|
+
/** Clear the value so readers see the loading state, then recompute. */
|
|
790
|
+
clear(): void;
|
|
840
791
|
invalidate(info?: unknown): void;
|
|
841
792
|
/**
|
|
842
793
|
* Read the value, subscribing if in a tracking context. Triggers computation if needed.
|
|
@@ -883,14 +834,7 @@ declare class ComputedSignalImpl<T, S extends _QRLInternal = ComputeQRL<T>> exte
|
|
|
883
834
|
get error(): Error | undefined;
|
|
884
835
|
set untrackedError(value: Error | undefined);
|
|
885
836
|
get untrackedError(): Error | undefined;
|
|
886
|
-
|
|
887
|
-
set expires(value: number);
|
|
888
|
-
get poll(): boolean;
|
|
889
|
-
set poll(value: boolean);
|
|
890
|
-
/** @deprecated Use `expires` and `poll` instead. */
|
|
891
|
-
get interval(): number;
|
|
892
|
-
set interval(value: number);
|
|
893
|
-
$setInvalid$(allowRecalc: boolean, mustClear: boolean | number): void;
|
|
837
|
+
$setInvalid$(allowRecalc: boolean): void;
|
|
894
838
|
/** Abort the current computation and run cleanups if needed. */
|
|
895
839
|
abort(reason?: any): void;
|
|
896
840
|
/** Schedule eager cleanup on next macro task if no subscribers remain. */
|
|
@@ -917,8 +861,6 @@ declare class ComputedSignalImpl<T, S extends _QRLInternal = ComputeQRL<T>> exte
|
|
|
917
861
|
$setError$(job: Job<T>, error: Error): void;
|
|
918
862
|
/** Called after SSR/unmount */
|
|
919
863
|
$destroy$(): Promise<void>;
|
|
920
|
-
private $clearNextPoll$;
|
|
921
|
-
private $scheduleNextPoll$;
|
|
922
864
|
private $hasSubscribers$;
|
|
923
865
|
$requestCleanups$(job: Job<T>, reason?: any): void;
|
|
924
866
|
/** Run a job's cleanup callbacks, returning a promise when any of them are async. */
|
|
@@ -2125,6 +2067,7 @@ declare class LazyRef<TYPE = unknown> {
|
|
|
2125
2067
|
readonly $symbolFn$: undefined | null | (() => Promise<Record<string, TYPE>>);
|
|
2126
2068
|
$ref$?: (null | ValueOrPromise<TYPE>) | undefined;
|
|
2127
2069
|
$container$: _Container | undefined;
|
|
2070
|
+
$hasMovedCaptures$?: boolean;
|
|
2128
2071
|
dev?: QRLDev | null | undefined;
|
|
2129
2072
|
qrls?: Set<any>;
|
|
2130
2073
|
constructor($chunk$: string | null, $symbol$: string, $symbolFn$: undefined | null | (() => Promise<Record<string, TYPE>>), $ref$?: (null | ValueOrPromise<TYPE>) | undefined, container?: _Container | null);
|
|
@@ -2261,7 +2204,7 @@ export declare const _noopQrlDEV: <T>(symbolName: string, opts: QRLDev, lexicalS
|
|
|
2261
2204
|
* @see noSerialize
|
|
2262
2205
|
*/
|
|
2263
2206
|
export declare type NoSerialize<T> = (T & {
|
|
2264
|
-
__no_serialize__
|
|
2207
|
+
__no_serialize__: true;
|
|
2265
2208
|
}) | undefined;
|
|
2266
2209
|
|
|
2267
2210
|
/**
|
|
@@ -2707,6 +2650,7 @@ declare type QRLInternalMethods<TYPE> = {
|
|
|
2707
2650
|
readonly $hash$: string;
|
|
2708
2651
|
/** Captures are stored lazily after deserialization. */
|
|
2709
2652
|
readonly $captures$?: QrlCaptures;
|
|
2653
|
+
readonly $hasMovedCaptures$?: boolean;
|
|
2710
2654
|
dev?: QRLDev | null;
|
|
2711
2655
|
resolve(container?: _Container): Promise<TYPE>;
|
|
2712
2656
|
resolved: undefined | TYPE;
|
|
@@ -2724,6 +2668,8 @@ declare type QRLInternalMethods<TYPE> = {
|
|
|
2724
2668
|
* after the $name$ props are mangled
|
|
2725
2669
|
*/
|
|
2726
2670
|
w(captures: QrlCaptures): _QRLInternal<TYPE>;
|
|
2671
|
+
/** Mark that the handler receives captures moved to its element. */
|
|
2672
|
+
m(): _QRLInternal<TYPE>;
|
|
2727
2673
|
/**
|
|
2728
2674
|
* "set ref" - Set the ref of the QRL. It's an internal method but we need to have a stable name
|
|
2729
2675
|
* because it gets called in user code by the optimizer, after the $name$ props are mangled
|
|
@@ -3167,9 +3113,7 @@ export declare const Reveal: typeof _reC;
|
|
|
3167
3113
|
|
|
3168
3114
|
declare interface RevealItemLike {
|
|
3169
3115
|
boundary: {
|
|
3170
|
-
|
|
3171
|
-
untrackedValue: number;
|
|
3172
|
-
};
|
|
3116
|
+
untrackedValue: number;
|
|
3173
3117
|
};
|
|
3174
3118
|
}
|
|
3175
3119
|
|
|
@@ -3996,7 +3940,6 @@ export declare const Suspense: typeof _suC;
|
|
|
3996
3940
|
/** @public @experimental */
|
|
3997
3941
|
export declare type SuspenseProps = {
|
|
3998
3942
|
fallback?: JSXOutput;
|
|
3999
|
-
showStale?: boolean;
|
|
4000
3943
|
delay?: number;
|
|
4001
3944
|
};
|
|
4002
3945
|
|
|
@@ -5174,7 +5117,7 @@ export declare const _VAR_PROPS: unique symbol;
|
|
|
5174
5117
|
export declare const _verifySerializable: <T>(value: T, preMessage?: string) => T;
|
|
5175
5118
|
|
|
5176
5119
|
/**
|
|
5177
|
-
* 2.0.0-beta.
|
|
5120
|
+
* 2.0.0-beta.39-dev+6fb620f
|
|
5178
5121
|
*
|
|
5179
5122
|
* @public
|
|
5180
5123
|
*/
|