@qwik.dev/core 2.0.0-beta.35 → 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.
- package/dist/backpatch/index.mjs +2 -2
- package/dist/backpatch/package.json +1 -1
- package/dist/backpatch-executor.debug.js +2 -1
- package/dist/backpatch-executor.js +1 -1
- package/dist/build/package.json +1 -1
- package/dist/cli.mjs +2 -2
- package/dist/core-internal.d.ts +272 -78
- package/dist/core.min.mjs +8 -9
- package/dist/core.mjs +2307 -1329
- package/dist/core.mjs.map +1 -1
- package/dist/core.prod.mjs +4520 -3646
- package/dist/loader/index.mjs +2 -2
- package/dist/loader/package.json +1 -1
- package/dist/optimizer.d.ts +6 -4
- package/dist/optimizer.mjs +1533 -1440
- package/dist/out-of-order-executor.debug.js +163 -0
- package/dist/out-of-order-executor.js +1 -0
- package/dist/preloader.mjs +1 -1
- package/dist/qwikloader.debug.js +51 -28
- package/dist/qwikloader.js +1 -1
- package/dist/server.d.ts +4 -0
- package/dist/server.mjs +1158 -146
- package/dist/server.prod.mjs +1192 -391
- package/dist/testing/index.d.ts +78 -20
- package/dist/testing/index.mjs +3015 -1230
- package/dist/testing/package.json +1 -1
- package/dist/worker/package.json +1 -1
- package/package.json +3 -3
- package/public.d.ts +1 -0
package/dist/testing/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import type { JSXNodeInternal } from '../internal';
|
|
|
7
7
|
import { JSXOutput } from '..';
|
|
8
8
|
import type { _QDocument } from '../internal';
|
|
9
9
|
import { RenderResult } from '..';
|
|
10
|
+
import { StreamWriter } from '..';
|
|
10
11
|
import type { _Stringifiable } from '../internal';
|
|
11
12
|
import type { _VirtualVNode } from '../internal';
|
|
12
13
|
import type { _VNode } from '../internal';
|
|
@@ -45,13 +46,14 @@ declare const enum ChoreBits {
|
|
|
45
46
|
TASKS = 1,
|
|
46
47
|
NODE_DIFF = 2,
|
|
47
48
|
COMPONENT = 4,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
49
|
+
INLINE_COMPONENT = 8,
|
|
50
|
+
NODE_PROPS = 16,
|
|
51
|
+
COMPUTE = 32,
|
|
52
|
+
CHILDREN = 64,
|
|
53
|
+
CLEANUP = 128,
|
|
54
|
+
RECONCILE = 256,
|
|
55
|
+
ERROR_WRAP = 512,
|
|
56
|
+
DIRTY_MASK = 1023
|
|
55
57
|
}
|
|
56
58
|
|
|
57
59
|
/** @internal */
|
|
@@ -72,6 +74,8 @@ declare type Consumer = Task | VNode | SignalImpl | ISsrNode;
|
|
|
72
74
|
declare interface Container {
|
|
73
75
|
readonly $version$: string;
|
|
74
76
|
readonly $storeProxyMap$: ObjToProxyMap;
|
|
77
|
+
$rootContainer$: Container | null;
|
|
78
|
+
$isOutOfOrderSegment$: boolean;
|
|
75
79
|
readonly $locale$: string;
|
|
76
80
|
readonly $getObjectById$: (id: number | string) => any;
|
|
77
81
|
readonly $serverData$: Record<string, any>;
|
|
@@ -106,7 +110,7 @@ declare interface Container {
|
|
|
106
110
|
new (...rest: any[]): {
|
|
107
111
|
__brand__: 'DomRef';
|
|
108
112
|
};
|
|
109
|
-
} | null, symbolToChunkResolver: SymbolToChunkResolver, writer?:
|
|
113
|
+
} | null, symbolToChunkResolver: SymbolToChunkResolver, writer?: StreamWriter_2): SerializationContext;
|
|
110
114
|
}
|
|
111
115
|
|
|
112
116
|
/**
|
|
@@ -204,7 +208,7 @@ declare interface DevJSX {
|
|
|
204
208
|
}
|
|
205
209
|
|
|
206
210
|
declare type DomRef = {
|
|
207
|
-
$ssrNode$:
|
|
211
|
+
$ssrNode$: ISsrNode;
|
|
208
212
|
};
|
|
209
213
|
|
|
210
214
|
/** @public */
|
|
@@ -222,6 +226,7 @@ declare const _EFFECT_BACK_REF: unique symbol;
|
|
|
222
226
|
|
|
223
227
|
declare type EffectBackRef = SignalImpl | StoreTarget | PropsProxy;
|
|
224
228
|
|
|
229
|
+
/** @internal */
|
|
225
230
|
declare const enum EffectProperty {
|
|
226
231
|
COMPONENT = ":",
|
|
227
232
|
VNODE = "."
|
|
@@ -320,8 +325,29 @@ declare type FunctionComponent<P = unknown> = {
|
|
|
320
325
|
/** @public */
|
|
321
326
|
export declare function getTestPlatform(): TestPlatform;
|
|
322
327
|
|
|
328
|
+
/** @internal */
|
|
323
329
|
declare type HostElement = VNode | ISsrNode;
|
|
324
330
|
|
|
331
|
+
/** @public */
|
|
332
|
+
export declare interface InOrderAuto {
|
|
333
|
+
strategy: 'auto';
|
|
334
|
+
maximumInitialChunk?: number;
|
|
335
|
+
maximumChunk?: number;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
/** @public */
|
|
339
|
+
export declare interface InOrderDirect {
|
|
340
|
+
strategy: 'direct';
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
/** @public */
|
|
344
|
+
export declare interface InOrderDisabled {
|
|
345
|
+
strategy: 'disabled';
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
/** @public */
|
|
349
|
+
export declare type InOrderStreaming = InOrderAuto | InOrderDisabled | InOrderDirect;
|
|
350
|
+
|
|
325
351
|
/** The shared state during an invoke() call */
|
|
326
352
|
declare interface InvokeContext {
|
|
327
353
|
/** The Virtual parent component for the current component code */
|
|
@@ -338,8 +364,10 @@ declare interface ISsrNode {
|
|
|
338
364
|
flags: SsrNodeFlags;
|
|
339
365
|
dirty: ChoreBits;
|
|
340
366
|
parentComponent: ISsrNode | null;
|
|
367
|
+
children: ISsrNode[] | null;
|
|
341
368
|
vnodeData: VNodeData;
|
|
342
369
|
currentFile: string | null;
|
|
370
|
+
readonly [_EFFECT_BACK_REF]: Map<EffectProperty | string, EffectSubscription> | null;
|
|
343
371
|
setProp(name: string, value: any): void;
|
|
344
372
|
getProp(name: string): any;
|
|
345
373
|
removeProp(name: string): void;
|
|
@@ -480,6 +508,9 @@ declare interface NodePropData {
|
|
|
480
508
|
|
|
481
509
|
declare type ObjToProxyMap = WeakMap<any, any>;
|
|
482
510
|
|
|
511
|
+
/** @public */
|
|
512
|
+
export declare type OutOfOrderStreaming = boolean;
|
|
513
|
+
|
|
483
514
|
/** @internal */
|
|
484
515
|
declare const _OWNER: unique symbol;
|
|
485
516
|
|
|
@@ -706,6 +737,7 @@ declare type SeenRef = {
|
|
|
706
737
|
|
|
707
738
|
declare interface SerializationContext {
|
|
708
739
|
$serialize$: () => ValueOrPromise<void>;
|
|
740
|
+
$serializePatch$: (rootStart: number, rootIds: number[], extraRootId?: number | string | number[], streamedRootLimit?: number) => ValueOrPromise<void>;
|
|
709
741
|
$symbolToChunkResolver$: SymbolToChunkResolver;
|
|
710
742
|
/**
|
|
711
743
|
* Map from object to parent and index reference.
|
|
@@ -728,14 +760,26 @@ declare interface SerializationContext {
|
|
|
728
760
|
* Returns the index of the root object.
|
|
729
761
|
*/
|
|
730
762
|
$addRoot$: AddRootFn;
|
|
763
|
+
$addDuplicateRoot$: (obj: unknown) => SeenRef;
|
|
764
|
+
$commitRoot$: (root: unknown, obj: unknown) => number;
|
|
731
765
|
/** Mark an object as seen during serialization. This is used to handle backreferences and cycles */
|
|
732
766
|
$markSeen$: (obj: unknown, parent: SeenRef | undefined, index: number) => SeenRef;
|
|
733
767
|
$roots$: unknown[];
|
|
734
|
-
$
|
|
768
|
+
$rootObjs$: unknown[];
|
|
769
|
+
$onAddRoot$?: (id: number, root: unknown, obj: unknown) => void;
|
|
770
|
+
$forwardRefOffset$: number;
|
|
771
|
+
$serializedRootCount$: number;
|
|
772
|
+
$serializedForwardRefCount$: number;
|
|
773
|
+
$rootStateRootCount$: number;
|
|
774
|
+
$hasRootStateForwardRefs$: boolean;
|
|
775
|
+
$promoteToRoot$: (ref: SeenRef, obj: unknown, index?: number) => void;
|
|
735
776
|
$addSyncFn$($funcStr$: string | null, argsCount: number, fn: Function): number;
|
|
736
|
-
$
|
|
777
|
+
$setSyncFnOffset$(offset: number, existingFns?: string[]): void;
|
|
778
|
+
$isSsrNode$: (obj: unknown) => obj is ISsrNode;
|
|
737
779
|
$isDomRef$: (obj: unknown) => obj is DomRef;
|
|
738
|
-
$
|
|
780
|
+
$markSsrNodeForSerialization$: (node: ISsrNode, flags: number) => void;
|
|
781
|
+
$writer$: SSRInternalStreamWriter;
|
|
782
|
+
$setWriter$(writer: SSRInternalStreamWriter): void;
|
|
739
783
|
$syncFns$: string[];
|
|
740
784
|
$eventQrls$: Set<QRL>;
|
|
741
785
|
$eventNames$: Set<string>;
|
|
@@ -811,13 +855,12 @@ declare interface SimplifiedServerRequestEvent<T = unknown> {
|
|
|
811
855
|
request: Request;
|
|
812
856
|
}
|
|
813
857
|
|
|
814
|
-
/**
|
|
815
|
-
declare
|
|
816
|
-
id:
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
};
|
|
858
|
+
/** @internal */
|
|
859
|
+
declare interface SSRInternalStreamWriter extends StreamWriter_2 {
|
|
860
|
+
writeRootRef(id: number): ValueOrPromise<void>;
|
|
861
|
+
writeRootRefPath(path: number[]): ValueOrPromise<void>;
|
|
862
|
+
toString(remap?: number[]): string;
|
|
863
|
+
}
|
|
821
864
|
|
|
822
865
|
declare const enum SsrNodeFlags {
|
|
823
866
|
Updatable = 1
|
|
@@ -831,6 +874,14 @@ export declare function ssrRenderToDom(jsx: JSXOutput, opts?: {
|
|
|
831
874
|
raw?: boolean;
|
|
832
875
|
/** Include QwikLoader */
|
|
833
876
|
qwikLoader?: boolean;
|
|
877
|
+
/** Override the SSR container tag name. */
|
|
878
|
+
containerTagName?: string;
|
|
879
|
+
/** Stream rendered chunks while still collecting the final HTML. */
|
|
880
|
+
stream?: StreamWriter;
|
|
881
|
+
/** Configure SSR streaming. */
|
|
882
|
+
streaming?: StreamingOptions;
|
|
883
|
+
/** Skip client resume emulation after SSR. */
|
|
884
|
+
resume?: boolean;
|
|
834
885
|
/** Inject nodes into the document before test runs (for testing purposes) */
|
|
835
886
|
onBeforeResume?: (document: Document) => void;
|
|
836
887
|
}): Promise<{
|
|
@@ -842,8 +893,14 @@ export declare function ssrRenderToDom(jsx: JSXOutput, opts?: {
|
|
|
842
893
|
|
|
843
894
|
declare type StoreTarget = Record<string | symbol, any>;
|
|
844
895
|
|
|
896
|
+
/** @public */
|
|
897
|
+
export declare interface StreamingOptions {
|
|
898
|
+
inOrder?: InOrderStreaming;
|
|
899
|
+
outOfOrder?: OutOfOrderStreaming;
|
|
900
|
+
}
|
|
901
|
+
|
|
845
902
|
/** @internal */
|
|
846
|
-
declare interface
|
|
903
|
+
declare interface StreamWriter_2 {
|
|
847
904
|
write(chunk: string): ValueOrPromise<void>;
|
|
848
905
|
waitForDrain?(): ValueOrPromise<void>;
|
|
849
906
|
}
|
|
@@ -856,6 +913,7 @@ declare class SubscriptionData {
|
|
|
856
913
|
|
|
857
914
|
declare type SymbolToChunkResolver = (symbol: string) => string;
|
|
858
915
|
|
|
916
|
+
/** @internal */
|
|
859
917
|
declare class Task<T = unknown, B = T> extends BackRef implements DescriptorBase<unknown, Signal<B>> {
|
|
860
918
|
$flags$: number;
|
|
861
919
|
$index$: number;
|