@qwik.dev/core 2.0.0-beta.35 → 2.0.0-beta.36
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 +183 -39
- package/dist/core.min.mjs +8 -9
- package/dist/core.mjs +2223 -1290
- package/dist/core.mjs.map +1 -1
- package/dist/core.prod.mjs +4492 -3645
- package/dist/loader/index.mjs +2 -2
- package/dist/loader/package.json +1 -1
- package/dist/optimizer.d.ts +0 -4
- package/dist/optimizer.mjs +429 -424
- 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 +47 -26
- package/dist/qwikloader.js +1 -1
- package/dist/server.d.ts +4 -0
- package/dist/server.mjs +1160 -143
- package/dist/server.prod.mjs +1231 -428
- package/dist/testing/index.d.ts +75 -20
- package/dist/testing/index.mjs +2966 -1218
- package/dist/testing/package.json +1 -1
- package/dist/worker/package.json +1 -1
- package/package.json +4 -4
- package/public.d.ts +1 -0
package/dist/backpatch/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const QWIK_BACKPATCH_EXECUTOR_MINIFIED = "const t='script[type=\"qwik/backpatch\"]';function e(e,n){const o=n||e.querySelector(\"[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])\");if(o){const n=o.
|
|
2
|
-
const QWIK_BACKPATCH_EXECUTOR_DEBUG = "const BACKPATCH_DATA_SELECTOR = 'script[type=\"qwik/backpatch\"]';\nfunction executeBackpatch(doc, containerElement) {\n const container = containerElement || doc.querySelector(\"[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])\");\n if (container) {\n const
|
|
1
|
+
const QWIK_BACKPATCH_EXECUTOR_MINIFIED = "const t='script[type=\"qwik/backpatch\"]';function e(e,n){const o=n||e.querySelector(\"[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])\");if(o){const n=o.querySelectorAll(t),r=n[n.length-1];if(r){const t=JSON.parse(r.textContent||\"[]\"),n=e.createTreeWalker(o,NodeFilter.SHOW_ELEMENT);let c=n.currentNode,i=c.hasAttribute(\":\")?0:-1;for(let e=0;e<t.length;e+=3){const o=t[e],r=t[e+1];let l=t[e+2];for(;i<o&&(c=n.nextNode(),c);)c.hasAttribute(\":\")&&i++;const s=c;null==l||!1===l?s.removeAttribute(r):(\"boolean\"==typeof l&&(l=\"\"),s.setAttribute(r,l))}}}}const n=document.currentScript;if(n){const t=n.closest(\"[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])\");t&&e(document,t)}";
|
|
2
|
+
const QWIK_BACKPATCH_EXECUTOR_DEBUG = "const BACKPATCH_DATA_SELECTOR = 'script[type=\"qwik/backpatch\"]';\nfunction executeBackpatch(doc, containerElement) {\n const container = containerElement || doc.querySelector(\"[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])\");\n if (container) {\n const scripts = container.querySelectorAll(BACKPATCH_DATA_SELECTOR);\n const script = scripts[scripts.length - 1];\n if (script) {\n const data = JSON.parse(script.textContent || \"[]\");\n const walker = doc.createTreeWalker(container, NodeFilter.SHOW_ELEMENT);\n let currentNode = walker.currentNode;\n let currentNodeIdx = currentNode.hasAttribute(\":\") ? 0 : -1;\n for (let i = 0; i < data.length; i += 3) {\n const elementIdx = data[i];\n const attrName = data[i + 1];\n let value = data[i + 2];\n while (currentNodeIdx < elementIdx) {\n currentNode = walker.nextNode();\n if (!currentNode) {\n break;\n }\n if (currentNode.hasAttribute(\":\")) {\n currentNodeIdx++;\n }\n }\n const element = currentNode;\n if (value == null || value === false) {\n element.removeAttribute(attrName);\n } else {\n if (typeof value === \"boolean\") {\n value = \"\";\n }\n element.setAttribute(attrName, value);\n }\n }\n }\n }\n}\nconst executorScript = document.currentScript;\nif (executorScript) {\n const container = executorScript.closest(\n \"[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])\"\n );\n if (container) {\n executeBackpatch(document, container);\n }\n}";
|
|
3
3
|
globalThis.QWIK_BACKPATCH_EXECUTOR_MINIFIED = QWIK_BACKPATCH_EXECUTOR_MINIFIED;
|
|
4
4
|
globalThis.QWIK_BACKPATCH_EXECUTOR_DEBUG = QWIK_BACKPATCH_EXECUTOR_DEBUG;
|
|
5
5
|
export { QWIK_BACKPATCH_EXECUTOR_MINIFIED, QWIK_BACKPATCH_EXECUTOR_DEBUG };
|
|
@@ -2,7 +2,8 @@ const BACKPATCH_DATA_SELECTOR = 'script[type="qwik/backpatch"]';
|
|
|
2
2
|
function executeBackpatch(doc, containerElement) {
|
|
3
3
|
const container = containerElement || doc.querySelector("[q\\:container]:not([q\\:container=html]):not([q\\:container=text])");
|
|
4
4
|
if (container) {
|
|
5
|
-
const
|
|
5
|
+
const scripts = container.querySelectorAll(BACKPATCH_DATA_SELECTOR);
|
|
6
|
+
const script = scripts[scripts.length - 1];
|
|
6
7
|
if (script) {
|
|
7
8
|
const data = JSON.parse(script.textContent || "[]");
|
|
8
9
|
const walker = doc.createTreeWalker(container, NodeFilter.SHOW_ELEMENT);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const t='script[type="qwik/backpatch"]';function e(e,n){const o=n||e.querySelector("[q\\:container]:not([q\\:container=html]):not([q\\:container=text])");if(o){const n=o.
|
|
1
|
+
const t='script[type="qwik/backpatch"]';function e(e,n){const o=n||e.querySelector("[q\\:container]:not([q\\:container=html]):not([q\\:container=text])");if(o){const n=o.querySelectorAll(t),r=n[n.length-1];if(r){const t=JSON.parse(r.textContent||"[]"),n=e.createTreeWalker(o,NodeFilter.SHOW_ELEMENT);let c=n.currentNode,i=c.hasAttribute(":")?0:-1;for(let e=0;e<t.length;e+=3){const o=t[e],r=t[e+1];let l=t[e+2];for(;i<o&&(c=n.nextNode(),c);)c.hasAttribute(":")&&i++;const s=c;null==l||!1===l?s.removeAttribute(r):("boolean"==typeof l&&(l=""),s.setAttribute(r,l))}}}}const n=document.currentScript;if(n){const t=n.closest("[q\\:container]:not([q\\:container=html]):not([q\\:container=text])");t&&e(document,t)}
|
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.36-dev+3268fab
|
|
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.
|
|
12960
|
+
console.log("2.0.0-beta.36-dev+3268fab");
|
|
12961
12961
|
}
|
|
12962
12962
|
export {
|
|
12963
12963
|
runCli,
|
package/dist/core-internal.d.ts
CHANGED
|
@@ -716,13 +716,14 @@ declare const enum ChoreBits {
|
|
|
716
716
|
TASKS = 1,
|
|
717
717
|
NODE_DIFF = 2,
|
|
718
718
|
COMPONENT = 4,
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
719
|
+
INLINE_COMPONENT = 8,
|
|
720
|
+
NODE_PROPS = 16,
|
|
721
|
+
COMPUTE = 32,
|
|
722
|
+
CHILDREN = 64,
|
|
723
|
+
CLEANUP = 128,
|
|
724
|
+
RECONCILE = 256,
|
|
725
|
+
ERROR_WRAP = 512,
|
|
726
|
+
DIRTY_MASK = 1023
|
|
726
727
|
}
|
|
727
728
|
|
|
728
729
|
/**
|
|
@@ -745,8 +746,10 @@ export declare interface ClientContainer extends _Container {
|
|
|
745
746
|
$locale$: string;
|
|
746
747
|
qManifestHash: string;
|
|
747
748
|
rootVNode: _ElementVNode;
|
|
748
|
-
$forwardRefs$: Array<number> | null;
|
|
749
|
+
$forwardRefs$: Array<number | string> | null;
|
|
750
|
+
vNodeLocate(id: string | Element): _VNode;
|
|
749
751
|
parseQRL<T = unknown>(qrl: string): QRL<T>;
|
|
752
|
+
$getForwardRef$(id: number): number | string | undefined;
|
|
750
753
|
$setRawState$(id: number, vParent: _ElementVNode | _VirtualVNode): void;
|
|
751
754
|
}
|
|
752
755
|
|
|
@@ -903,6 +906,8 @@ declare type Consumer = Task | _VNode | SignalImpl | ISsrNode;
|
|
|
903
906
|
export declare interface _Container {
|
|
904
907
|
readonly $version$: string;
|
|
905
908
|
readonly $storeProxyMap$: ObjToProxyMap;
|
|
909
|
+
$rootContainer$: _Container | null;
|
|
910
|
+
$isOutOfOrderSegment$: boolean;
|
|
906
911
|
readonly $locale$: string;
|
|
907
912
|
readonly $getObjectById$: (id: number | string) => any;
|
|
908
913
|
readonly $serverData$: Record<string, any>;
|
|
@@ -957,6 +962,8 @@ export declare interface _ContainerElement extends HTMLElement {
|
|
|
957
962
|
qVNodeRefs?: Map<number, Element | _ElementVNode>;
|
|
958
963
|
/** String from `<script type="qwik/vnode">` tag. */
|
|
959
964
|
qVnodeData?: string;
|
|
965
|
+
/** Segment-local strings from `<script type="qwik/vnode" q:r="...">` tags. */
|
|
966
|
+
qSegmentVnodeData?: Map<string, string>;
|
|
960
967
|
}
|
|
961
968
|
|
|
962
969
|
/**
|
|
@@ -1245,11 +1252,12 @@ export declare function _deserialize<T>(rawStateData: string): T;
|
|
|
1245
1252
|
|
|
1246
1253
|
declare interface DeserializeContainer {
|
|
1247
1254
|
$getObjectById$: (id: number | string) => unknown;
|
|
1255
|
+
$getForwardRef$: (id: number) => number | string | undefined;
|
|
1248
1256
|
element: HTMLElement | null;
|
|
1249
1257
|
getSyncFn: (id: number) => (...args: unknown[]) => unknown;
|
|
1250
1258
|
$state$?: unknown[];
|
|
1251
1259
|
$storeProxyMap$: ObjToProxyMap;
|
|
1252
|
-
$forwardRefs$: Array<number> | null;
|
|
1260
|
+
$forwardRefs$: Array<number | string> | null;
|
|
1253
1261
|
}
|
|
1254
1262
|
|
|
1255
1263
|
/** @public */
|
|
@@ -1279,14 +1287,17 @@ declare class DomContainer extends _SharedContainer implements ClientContainer {
|
|
|
1279
1287
|
$storeProxyMap$: ObjToProxyMap;
|
|
1280
1288
|
$qFuncs$: Array<(...args: unknown[]) => unknown>;
|
|
1281
1289
|
$instanceHash$: string;
|
|
1282
|
-
$forwardRefs$: Array<number> | null;
|
|
1290
|
+
$forwardRefs$: Array<number | string> | null;
|
|
1283
1291
|
vNodeLocate: (id: string | Element) => _VNode;
|
|
1284
1292
|
private $rawStateData$;
|
|
1285
1293
|
private $stateData$;
|
|
1294
|
+
private $rootForwardRefs$;
|
|
1286
1295
|
private $styleIds$;
|
|
1287
1296
|
constructor(element: _ContainerElement);
|
|
1288
1297
|
/** Tear down this container so stale references fail gracefully. */
|
|
1289
1298
|
$destroy$(): void;
|
|
1299
|
+
private $processRootStateScript$;
|
|
1300
|
+
private $stateScriptSelector$;
|
|
1290
1301
|
/**
|
|
1291
1302
|
* The first time we render we need to hoist the styles. (Meaning we need to move all styles from
|
|
1292
1303
|
* component inline to <head>)
|
|
@@ -1306,6 +1317,7 @@ declare class DomContainer extends _SharedContainer implements ClientContainer {
|
|
|
1306
1317
|
getHostProp<T>(host: HostElement, name: string): T | null;
|
|
1307
1318
|
ensureProjectionResolved(vNode: _VirtualVNode): void;
|
|
1308
1319
|
$getObjectById$: (id: number | string) => unknown;
|
|
1320
|
+
$getForwardRef$(id: number): number | string | undefined;
|
|
1309
1321
|
getSyncFn(id: number): (...args: unknown[]) => unknown;
|
|
1310
1322
|
$appendStyle$(content: string, styleId: string, host: _VirtualVNode, scoped: boolean): void;
|
|
1311
1323
|
/** Set the server data for the Qwik Router. */
|
|
@@ -1315,7 +1327,7 @@ export { DomContainer }
|
|
|
1315
1327
|
export { DomContainer as _DomContainer }
|
|
1316
1328
|
|
|
1317
1329
|
declare type DomRef = {
|
|
1318
|
-
$ssrNode$:
|
|
1330
|
+
$ssrNode$: ISsrNode;
|
|
1319
1331
|
};
|
|
1320
1332
|
|
|
1321
1333
|
/** @internal */
|
|
@@ -1696,6 +1708,16 @@ declare class InsertOrMoveOperation {
|
|
|
1696
1708
|
constructor(target: Element | Text, parent: Element, beforeTarget: Element | Text | null);
|
|
1697
1709
|
}
|
|
1698
1710
|
|
|
1711
|
+
/** @internal */
|
|
1712
|
+
declare type InternalServerComponent<PROPS = unknown> = FunctionComponent<PROPS> & {
|
|
1713
|
+
[InternalServerComponentSymbol]: InternalServerComponentHandler;
|
|
1714
|
+
};
|
|
1715
|
+
|
|
1716
|
+
/** @internal */
|
|
1717
|
+
declare type InternalServerComponentHandler = (ssr: SSRContainer, jsx: JSXNodeInternal, options: SSRRenderJSXOptions, enqueue: (value: StackValue) => void) => ValueOrPromise<void>;
|
|
1718
|
+
|
|
1719
|
+
declare const InternalServerComponentSymbol: unique symbol;
|
|
1720
|
+
|
|
1699
1721
|
/**
|
|
1700
1722
|
* These are the HTML tags with handlers allowing plain callbacks, to be used for the JSX interface
|
|
1701
1723
|
*
|
|
@@ -1770,8 +1792,10 @@ declare interface ISsrNode {
|
|
|
1770
1792
|
flags: SsrNodeFlags;
|
|
1771
1793
|
dirty: ChoreBits;
|
|
1772
1794
|
parentComponent: ISsrNode | null;
|
|
1795
|
+
children: ISsrNode[] | null;
|
|
1773
1796
|
vnodeData: VNodeData;
|
|
1774
1797
|
currentFile: string | null;
|
|
1798
|
+
readonly [_EFFECT_BACK_REF]: Map<EffectProperty | string, EffectSubscription> | null;
|
|
1775
1799
|
setProp(name: string, value: any): void;
|
|
1776
1800
|
getProp(name: string): any;
|
|
1777
1801
|
removeProp(name: string): void;
|
|
@@ -2063,6 +2087,9 @@ export declare const _mapArray_get: <T>(array: (T | null)[], key: string, start:
|
|
|
2063
2087
|
/** @internal */
|
|
2064
2088
|
export declare const _mapArray_set: <T>(array: (T | null)[], key: string, value: T | null, start: number, allowNullValue?: boolean) => void;
|
|
2065
2089
|
|
|
2090
|
+
declare class MaybeAsyncSignal {
|
|
2091
|
+
}
|
|
2092
|
+
|
|
2066
2093
|
declare type MediaSpecialAttrs = {
|
|
2067
2094
|
crossOrigin?: HTMLCrossOriginAttribute;
|
|
2068
2095
|
};
|
|
@@ -2179,6 +2206,26 @@ export declare interface OnVisibleTaskOptions {
|
|
|
2179
2206
|
strategy?: VisibleTaskStrategy;
|
|
2180
2207
|
}
|
|
2181
2208
|
|
|
2209
|
+
/** @internal */
|
|
2210
|
+
declare type OutOfOrderRevealBoundary = {
|
|
2211
|
+
attrs: string;
|
|
2212
|
+
showFallback: boolean;
|
|
2213
|
+
resolve: () => void;
|
|
2214
|
+
};
|
|
2215
|
+
|
|
2216
|
+
/** @internal */
|
|
2217
|
+
declare class OutOfOrderRevealCoordinator<ITEM extends RevealItemLike = RevealItemLike> {
|
|
2218
|
+
private id;
|
|
2219
|
+
private collapsed;
|
|
2220
|
+
private count;
|
|
2221
|
+
private pendingItems;
|
|
2222
|
+
private orderCode;
|
|
2223
|
+
constructor(id: number, order: RevealOrder, collapsed: boolean);
|
|
2224
|
+
register(registration: RevealRegistrationLike<ITEM>): OutOfOrderRevealBoundary;
|
|
2225
|
+
canReveal(registration: RevealRegistrationLike<ITEM>): boolean;
|
|
2226
|
+
script(): string;
|
|
2227
|
+
}
|
|
2228
|
+
|
|
2182
2229
|
/** @internal */
|
|
2183
2230
|
declare const _OWNER: unique symbol;
|
|
2184
2231
|
|
|
@@ -2275,7 +2322,7 @@ export declare const PrefetchServiceWorker: (opts: {
|
|
|
2275
2322
|
* @returns The preprocessed state data
|
|
2276
2323
|
* @internal
|
|
2277
2324
|
*/
|
|
2278
|
-
export declare function _preprocessState(data: unknown[], container: DeserializeContainer): void;
|
|
2325
|
+
export declare function _preprocessState(data: unknown[], container: DeserializeContainer, segmentId?: string, startIndex?: number): void;
|
|
2279
2326
|
|
|
2280
2327
|
declare type Prettify<T> = {} & {
|
|
2281
2328
|
[K in keyof T]: T[K];
|
|
@@ -2352,6 +2399,12 @@ export declare type PublicProps<PROPS> = (PROPS extends Record<any, any> ? Omit<
|
|
|
2352
2399
|
/** @internal */
|
|
2353
2400
|
export declare interface _QDocument extends Document {
|
|
2354
2401
|
qVNodeData: WeakMap<Element, string>;
|
|
2402
|
+
/** True once the root document VNode data has been fully processed. */
|
|
2403
|
+
qVNodeDataProcessed?: boolean;
|
|
2404
|
+
/** Processes one vnode patch script. */
|
|
2405
|
+
qProcessVNodeDataPatch?: (script: Element | null) => void;
|
|
2406
|
+
/** Processes an out-of-order Suspense segment after its resolved HTML is swapped in. */
|
|
2407
|
+
qProcessOOOS?: (boundaryId: number, content: Element | null) => void;
|
|
2355
2408
|
}
|
|
2356
2409
|
|
|
2357
2410
|
/**
|
|
@@ -2781,7 +2834,7 @@ export declare interface ReadonlySignal<T = unknown> {
|
|
|
2781
2834
|
}
|
|
2782
2835
|
|
|
2783
2836
|
/** @internal */
|
|
2784
|
-
export declare const _reC: (props: RevealProps) => JSXNodeInternal<FunctionComponent< {
|
|
2837
|
+
export declare const _reC: (props: RevealProps) => JSXNodeInternal<InternalServerComponent<SSRRevealSlotProps>> | JSXNodeInternal<FunctionComponent< {
|
|
2785
2838
|
name?: string;
|
|
2786
2839
|
children?: JSXChildren;
|
|
2787
2840
|
}>>;
|
|
@@ -2981,6 +3034,14 @@ export declare const _reT: ({ cleanup }: TaskCtx) => void;
|
|
|
2981
3034
|
/** @public @experimental */
|
|
2982
3035
|
export declare const Reveal: typeof _reC;
|
|
2983
3036
|
|
|
3037
|
+
declare interface RevealItemLike {
|
|
3038
|
+
boundary: {
|
|
3039
|
+
pending: {
|
|
3040
|
+
untrackedValue: number;
|
|
3041
|
+
};
|
|
3042
|
+
};
|
|
3043
|
+
}
|
|
3044
|
+
|
|
2984
3045
|
/** @public @experimental */
|
|
2985
3046
|
export declare type RevealOrder = 'parallel' | 'sequential' | 'reverse' | 'together';
|
|
2986
3047
|
|
|
@@ -2990,6 +3051,14 @@ export declare type RevealProps = {
|
|
|
2990
3051
|
collapsed?: boolean;
|
|
2991
3052
|
};
|
|
2992
3053
|
|
|
3054
|
+
declare interface RevealRegistrationLike<ITEM extends RevealItemLike = RevealItemLike> {
|
|
3055
|
+
reveal: {
|
|
3056
|
+
order: RevealOrder;
|
|
3057
|
+
items: ITEM[];
|
|
3058
|
+
};
|
|
3059
|
+
item: ITEM;
|
|
3060
|
+
}
|
|
3061
|
+
|
|
2993
3062
|
/**
|
|
2994
3063
|
* The resource function wrapper
|
|
2995
3064
|
*
|
|
@@ -3012,8 +3081,15 @@ declare type SeenRef = {
|
|
|
3012
3081
|
$parent$?: SeenRef | null;
|
|
3013
3082
|
};
|
|
3014
3083
|
|
|
3084
|
+
declare interface SegmentRenderContext {
|
|
3085
|
+
container: SSRSegmentContainer;
|
|
3086
|
+
writer: SSRInternalStreamWriter;
|
|
3087
|
+
htmlChunks: SSRSegmentWriteChunk[];
|
|
3088
|
+
}
|
|
3089
|
+
|
|
3015
3090
|
declare interface SerializationContext {
|
|
3016
3091
|
$serialize$: () => ValueOrPromise<void>;
|
|
3092
|
+
$serializePatch$: (rootStart: number, rootIds: number[], extraRootId?: number | string | number[], streamedRootLimit?: number) => ValueOrPromise<void>;
|
|
3017
3093
|
$symbolToChunkResolver$: SymbolToChunkResolver;
|
|
3018
3094
|
/**
|
|
3019
3095
|
* Map from object to parent and index reference.
|
|
@@ -3036,14 +3112,26 @@ declare interface SerializationContext {
|
|
|
3036
3112
|
* Returns the index of the root object.
|
|
3037
3113
|
*/
|
|
3038
3114
|
$addRoot$: AddRootFn;
|
|
3115
|
+
$addDuplicateRoot$: (obj: unknown) => SeenRef;
|
|
3116
|
+
$commitRoot$: (root: unknown, obj: unknown) => number;
|
|
3039
3117
|
/** Mark an object as seen during serialization. This is used to handle backreferences and cycles */
|
|
3040
3118
|
$markSeen$: (obj: unknown, parent: SeenRef | undefined, index: number) => SeenRef;
|
|
3041
3119
|
$roots$: unknown[];
|
|
3042
|
-
$
|
|
3120
|
+
$rootObjs$: unknown[];
|
|
3121
|
+
$onAddRoot$?: (id: number, root: unknown, obj: unknown) => void;
|
|
3122
|
+
$forwardRefOffset$: number;
|
|
3123
|
+
$serializedRootCount$: number;
|
|
3124
|
+
$serializedForwardRefCount$: number;
|
|
3125
|
+
$rootStateRootCount$: number;
|
|
3126
|
+
$hasRootStateForwardRefs$: boolean;
|
|
3127
|
+
$promoteToRoot$: (ref: SeenRef, obj: unknown, index?: number) => void;
|
|
3043
3128
|
$addSyncFn$($funcStr$: string | null, argsCount: number, fn: Function): number;
|
|
3044
|
-
$
|
|
3129
|
+
$setSyncFnOffset$(offset: number, existingFns?: string[]): void;
|
|
3130
|
+
$isSsrNode$: (obj: unknown) => obj is ISsrNode;
|
|
3045
3131
|
$isDomRef$: (obj: unknown) => obj is DomRef;
|
|
3046
|
-
$
|
|
3132
|
+
$markSsrNodeForSerialization$: (node: ISsrNode, flags: number) => void;
|
|
3133
|
+
$writer$: SSRInternalStreamWriter;
|
|
3134
|
+
$setWriter$(writer: SSRInternalStreamWriter): void;
|
|
3047
3135
|
$syncFns$: string[];
|
|
3048
3136
|
$eventQrls$: Set<QRL>;
|
|
3049
3137
|
$eventNames$: Set<string>;
|
|
@@ -3178,7 +3266,7 @@ declare class SetAttributeOperation {
|
|
|
3178
3266
|
}
|
|
3179
3267
|
|
|
3180
3268
|
/** @internal */
|
|
3181
|
-
export declare function _setEvent(serializationCtx: SerializationContext, key: string, rawValue: unknown, hasMovedCaptures: boolean): string | null;
|
|
3269
|
+
export declare function _setEvent(serializationCtx: SerializationContext, key: string, rawValue: unknown, hasMovedCaptures: boolean): string | SSRWriteChunk[] | null;
|
|
3182
3270
|
|
|
3183
3271
|
/**
|
|
3184
3272
|
* Sets the `CorePlatform`.
|
|
@@ -3212,6 +3300,8 @@ declare class SetTextOperation {
|
|
|
3212
3300
|
export declare abstract class _SharedContainer implements _Container {
|
|
3213
3301
|
readonly $version$: string;
|
|
3214
3302
|
readonly $storeProxyMap$: ObjToProxyMap;
|
|
3303
|
+
$rootContainer$: _Container | null;
|
|
3304
|
+
$isOutOfOrderSegment$: boolean;
|
|
3215
3305
|
readonly $locale$: string;
|
|
3216
3306
|
readonly $getObjectById$: (id: number | string) => any;
|
|
3217
3307
|
$serverData$: Record<string, any>;
|
|
@@ -3569,14 +3659,21 @@ declare interface SSRContainer extends _Container {
|
|
|
3569
3659
|
readonly tag: string;
|
|
3570
3660
|
readonly isHtml: boolean;
|
|
3571
3661
|
readonly size: number;
|
|
3572
|
-
readonly writer:
|
|
3662
|
+
readonly writer: SSRInternalStreamWriter;
|
|
3573
3663
|
readonly streamHandler: IStreamHandler;
|
|
3574
3664
|
readonly serializationCtx: SerializationContext;
|
|
3575
3665
|
readonly symbolToChunkResolver: SymbolToChunkResolver;
|
|
3576
3666
|
readonly resolvedManifest: ResolvedManifest;
|
|
3667
|
+
readonly outOfOrderStreaming: boolean;
|
|
3577
3668
|
additionalHeadNodes: Array<JSXNodeInternal>;
|
|
3578
3669
|
additionalBodyNodes: Array<JSXNodeInternal>;
|
|
3579
3670
|
$noScriptHere$: number;
|
|
3671
|
+
/**
|
|
3672
|
+
* Lets the container place a root-level `useOn` placeholder `<script>` itself when injecting it
|
|
3673
|
+
* inline would put it at an illegal position. Returns `true` if the container took the node, in
|
|
3674
|
+
* which case the caller must not inject it into the component's JSX.
|
|
3675
|
+
*/
|
|
3676
|
+
$deferRootPlaceholder$(scriptNode: JSXNodeInternal<string>): boolean;
|
|
3580
3677
|
write(text: string): void;
|
|
3581
3678
|
openContainer(): void;
|
|
3582
3679
|
closeContainer(): ValueOrPromise<void>;
|
|
@@ -3593,18 +3690,24 @@ declare interface SSRContainer extends _Container {
|
|
|
3593
3690
|
textNode(text: string): void;
|
|
3594
3691
|
htmlNode(rawHtml: string): void;
|
|
3595
3692
|
commentNode(text: string): void;
|
|
3596
|
-
addRoot(obj: any): number | undefined;
|
|
3693
|
+
addRoot(obj: any): number | string | undefined;
|
|
3597
3694
|
getOrCreateLastNode(): ISsrNode;
|
|
3598
3695
|
addUnclaimedProjection(frame: ISsrComponentFrame, name: string, children: JSXChildren): void;
|
|
3599
3696
|
isStatic(): boolean;
|
|
3600
3697
|
render(jsx: JSXOutput): Promise<void>;
|
|
3601
|
-
renderJSX(jsx: JSXOutput, options:
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
|
|
3698
|
+
renderJSX(jsx: JSXOutput, options: SSRRenderJSXOptions): Promise<void>;
|
|
3699
|
+
$runQueuedRender$<T>(render: () => ValueOrPromise<T>): ValueOrPromise<T>;
|
|
3700
|
+
nextOutOfOrderId(): number;
|
|
3701
|
+
emitOutOfOrderSegmentScripts(scripts: string): void;
|
|
3702
|
+
segment(segmentId: string, jsx: JSXOutput, options: SSRRenderJSXOptions): Promise<SSROutOfOrderSegment>;
|
|
3703
|
+
queueOutOfOrderSegment(segment: Promise<void>): void;
|
|
3704
|
+
emitOutOfOrderExecutorIfNeeded(): void;
|
|
3705
|
+
emitInlineScript(script: string): void;
|
|
3706
|
+
writeScript(attrs: Props, body?: string): void;
|
|
3605
3707
|
emitPreloaderPre(): void;
|
|
3606
3708
|
emitQwikLoaderAtTopIfNeeded(): void;
|
|
3607
3709
|
emitPatchDataIfNeeded(): void;
|
|
3710
|
+
emitBackpatchDataAndExecutorIfNeeded(): void;
|
|
3608
3711
|
addBackpatchEntry(ssrNodeId: string, attrName: string, serializedValue: string | boolean | null): void;
|
|
3609
3712
|
}
|
|
3610
3713
|
|
|
@@ -3613,23 +3716,56 @@ export declare type SSRHintProps = {
|
|
|
3613
3716
|
dynamic?: boolean;
|
|
3614
3717
|
};
|
|
3615
3718
|
|
|
3616
|
-
/**
|
|
3617
|
-
declare
|
|
3618
|
-
id:
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
};
|
|
3719
|
+
/** @internal */
|
|
3720
|
+
declare interface SSRInternalStreamWriter extends StreamWriter {
|
|
3721
|
+
writeRootRef(id: number): ValueOrPromise<void>;
|
|
3722
|
+
writeRootRefPath(path: number[]): ValueOrPromise<void>;
|
|
3723
|
+
toString(remap?: number[]): string;
|
|
3724
|
+
}
|
|
3623
3725
|
|
|
3624
3726
|
declare const enum SsrNodeFlags {
|
|
3625
3727
|
Updatable = 1
|
|
3626
3728
|
}
|
|
3627
3729
|
|
|
3730
|
+
declare type SSROutOfOrderSegment = SegmentRenderContext;
|
|
3731
|
+
|
|
3628
3732
|
/** @public */
|
|
3629
3733
|
export declare const SSRRaw: FunctionComponent<{
|
|
3630
3734
|
data: string;
|
|
3631
3735
|
}>;
|
|
3632
3736
|
|
|
3737
|
+
declare interface SSRRenderJSXOptions {
|
|
3738
|
+
currentStyleScoped: string | null;
|
|
3739
|
+
parentComponentFrame: ISsrComponentFrame | null;
|
|
3740
|
+
}
|
|
3741
|
+
|
|
3742
|
+
declare type SSRRevealSlotProps = {
|
|
3743
|
+
coordinator: OutOfOrderRevealCoordinator;
|
|
3744
|
+
};
|
|
3745
|
+
|
|
3746
|
+
/** @internal */
|
|
3747
|
+
declare interface SSRRootRefPathChunk {
|
|
3748
|
+
readonly path: number[];
|
|
3749
|
+
}
|
|
3750
|
+
|
|
3751
|
+
declare interface SSRSegmentContainer extends SSRContainer {
|
|
3752
|
+
$rootContainer$: SSRContainer;
|
|
3753
|
+
$recordExternalRootEffect$(producer: unknown, effect: EffectSubscription, prop: string | symbol | null, sourceEffects?: Map<string | symbol, Set<EffectSubscription>>): void;
|
|
3754
|
+
$finalizeOutOfOrderSegment$(segmentId: string, segment: SSROutOfOrderSegment): Promise<{
|
|
3755
|
+
html: string;
|
|
3756
|
+
scripts: string;
|
|
3757
|
+
}>;
|
|
3758
|
+
}
|
|
3759
|
+
|
|
3760
|
+
/** @internal */
|
|
3761
|
+
declare type SSRSegmentWriteChunk = string | {
|
|
3762
|
+
readonly type: 'root-ref';
|
|
3763
|
+
readonly localId: number;
|
|
3764
|
+
} | {
|
|
3765
|
+
readonly type: 'root-ref-path';
|
|
3766
|
+
readonly localPath: number[];
|
|
3767
|
+
};
|
|
3768
|
+
|
|
3633
3769
|
/** @public */
|
|
3634
3770
|
export declare const SSRStream: FunctionComponent<SSRStreamProps>;
|
|
3635
3771
|
|
|
@@ -3651,6 +3787,13 @@ export declare interface SSRStreamWriter {
|
|
|
3651
3787
|
write(chunk: JSXOutput): void;
|
|
3652
3788
|
}
|
|
3653
3789
|
|
|
3790
|
+
/** @internal */
|
|
3791
|
+
declare type SSRWriteChunk = string | number | SSRRootRefPathChunk;
|
|
3792
|
+
|
|
3793
|
+
declare type StackFn = () => ValueOrPromise<void>;
|
|
3794
|
+
|
|
3795
|
+
declare type StackValue = ValueOrPromise<JSXOutput | StackFn | Promise<JSXOutput> | typeof Promise | AsyncGenerator | typeof MaybeAsyncSignal>;
|
|
3796
|
+
|
|
3654
3797
|
declare type StopPropagation = {
|
|
3655
3798
|
[K in keyof HTMLElementEventMap as `stoppropagation:${K}`]?: boolean;
|
|
3656
3799
|
};
|
|
@@ -3674,10 +3817,14 @@ export declare class _SubscriptionData {
|
|
|
3674
3817
|
}
|
|
3675
3818
|
|
|
3676
3819
|
/** @internal */
|
|
3677
|
-
export declare
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3820
|
+
export declare class _SubscriptionPatch {
|
|
3821
|
+
rootId: number;
|
|
3822
|
+
subscriptions: Set<EffectSubscription> | Map<string | symbol, Set<EffectSubscription>>;
|
|
3823
|
+
constructor(rootId?: number, subscriptions?: Set<EffectSubscription> | Map<string | symbol, Set<EffectSubscription>>);
|
|
3824
|
+
}
|
|
3825
|
+
|
|
3826
|
+
/** @internal */
|
|
3827
|
+
export declare const _suC: (props: SuspenseProps) => JSXNodeInternal<string>[];
|
|
3681
3828
|
|
|
3682
3829
|
/** @public @experimental */
|
|
3683
3830
|
export declare const Suspense: typeof _suC;
|
|
@@ -4842,7 +4989,7 @@ export declare const _VAR_PROPS: unique symbol;
|
|
|
4842
4989
|
export declare const _verifySerializable: <T>(value: T, preMessage?: string) => T;
|
|
4843
4990
|
|
|
4844
4991
|
/**
|
|
4845
|
-
* 2.0.0-beta.
|
|
4992
|
+
* 2.0.0-beta.36-dev+3268fab
|
|
4846
4993
|
*
|
|
4847
4994
|
* @public
|
|
4848
4995
|
*/
|
|
@@ -5013,10 +5160,7 @@ declare type VNodeOperation = DeleteOperation | RemoveAllChildrenOperation | Set
|
|
|
5013
5160
|
export declare const _waitUntilRendered: (container: _Container) => Promise<void>;
|
|
5014
5161
|
|
|
5015
5162
|
/** @internal */
|
|
5016
|
-
export declare function _walkJSX(ssr: SSRContainer, value: JSXOutput, options:
|
|
5017
|
-
currentStyleScoped: string | null;
|
|
5018
|
-
parentComponentFrame: ISsrComponentFrame | null;
|
|
5019
|
-
}): Promise<void>;
|
|
5163
|
+
export declare function _walkJSX(ssr: SSRContainer, value: JSXOutput, options: SSRRenderJSXOptions): Promise<void>;
|
|
5020
5164
|
|
|
5021
5165
|
/**
|
|
5022
5166
|
* Override the `getLocale` with `lang` within the `fn` execution.
|