@qwik.dev/core 2.0.0-beta.32 → 2.0.0-beta.34
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 +12 -6
- 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 +71 -5
- package/dist/core.min.mjs +2 -2
- package/dist/core.mjs +97 -94
- package/dist/core.mjs.map +1 -1
- package/dist/core.prod.mjs +2159 -2164
- package/dist/loader/package.json +1 -1
- package/dist/optimizer.mjs +724 -719
- package/dist/preloader.mjs +64 -89
- package/dist/server.d.ts +0 -54
- package/dist/server.mjs +112 -487
- package/dist/server.prod.mjs +204 -616
- package/dist/testing/index.d.ts +2 -1
- package/dist/testing/index.mjs +766 -3522
- package/dist/testing/package.json +1 -1
- package/package.json +3 -3
package/dist/backpatch/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const QWIK_BACKPATCH_EXECUTOR_MINIFIED = "const t='script[type=\"qwik/backpatch\"]'
|
|
2
|
-
const QWIK_BACKPATCH_EXECUTOR_DEBUG = "const BACKPATCH_DATA_SELECTOR = 'script[type=\"qwik/backpatch\"]';\
|
|
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.querySelector(t);if(n){const t=JSON.parse(n.textContent||\"[]\"),r=e.createTreeWalker(o,NodeFilter.SHOW_ELEMENT);let c=r.currentNode,i=c.hasAttribute(\":\")?0:-1;for(let e=0;e<t.length;e+=3){const n=t[e],o=t[e+1];let s=t[e+2];for(;i<n&&(c=r.nextNode(),c);)c.hasAttribute(\":\")&&i++;const a=c;null==s||!1===s?a.removeAttribute(o):(\"boolean\"==typeof s&&(s=\"\"),a.setAttribute(o,s))}}}}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 script = container.querySelector(BACKPATCH_DATA_SELECTOR);\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 };
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
const BACKPATCH_DATA_SELECTOR = 'script[type="qwik/backpatch"]';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const container = executorScript.closest(
|
|
5
|
-
"[q\\:container]:not([q\\:container=html]):not([q\\:container=text])"
|
|
6
|
-
);
|
|
2
|
+
function executeBackpatch(doc, containerElement) {
|
|
3
|
+
const container = containerElement || doc.querySelector("[q\\:container]:not([q\\:container=html]):not([q\\:container=text])");
|
|
7
4
|
if (container) {
|
|
8
5
|
const script = container.querySelector(BACKPATCH_DATA_SELECTOR);
|
|
9
6
|
if (script) {
|
|
10
7
|
const data = JSON.parse(script.textContent || "[]");
|
|
11
|
-
const walker =
|
|
8
|
+
const walker = doc.createTreeWalker(container, NodeFilter.SHOW_ELEMENT);
|
|
12
9
|
let currentNode = walker.currentNode;
|
|
13
10
|
let currentNodeIdx = currentNode.hasAttribute(":") ? 0 : -1;
|
|
14
11
|
for (let i = 0; i < data.length; i += 3) {
|
|
@@ -37,3 +34,12 @@ if (executorScript) {
|
|
|
37
34
|
}
|
|
38
35
|
}
|
|
39
36
|
}
|
|
37
|
+
const executorScript = document.currentScript;
|
|
38
|
+
if (executorScript) {
|
|
39
|
+
const container = executorScript.closest(
|
|
40
|
+
"[q\\:container]:not([q\\:container=html]):not([q\\:container=text])"
|
|
41
|
+
);
|
|
42
|
+
if (container) {
|
|
43
|
+
executeBackpatch(document, container);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const t='script[type="qwik/backpatch"]'
|
|
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.querySelector(t);if(n){const t=JSON.parse(n.textContent||"[]"),r=e.createTreeWalker(o,NodeFilter.SHOW_ELEMENT);let c=r.currentNode,i=c.hasAttribute(":")?0:-1;for(let e=0;e<t.length;e+=3){const n=t[e],o=t[e+1];let s=t[e+2];for(;i<n&&(c=r.nextNode(),c);)c.hasAttribute(":")&&i++;const a=c;null==s||!1===s?a.removeAttribute(o):("boolean"==typeof s&&(s=""),a.setAttribute(o,s))}}}}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.34-dev+8b055bb
|
|
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
|
|
@@ -12953,7 +12953,7 @@ async function printHelp(app) {
|
|
|
12953
12953
|
await runCommand2(Object.assign(app, { task: args[0], args }));
|
|
12954
12954
|
}
|
|
12955
12955
|
function printVersion() {
|
|
12956
|
-
console.log("2.0.0-beta.
|
|
12956
|
+
console.log("2.0.0-beta.34-dev+8b055bb");
|
|
12957
12957
|
}
|
|
12958
12958
|
export {
|
|
12959
12959
|
runCli,
|
package/dist/core-internal.d.ts
CHANGED
|
@@ -1215,6 +1215,11 @@ export declare interface CSSProperties extends CSS_2.Properties<string | number>
|
|
|
1215
1215
|
[v: `--${string}`]: string | number | undefined;
|
|
1216
1216
|
}
|
|
1217
1217
|
|
|
1218
|
+
declare class DeleteOperation {
|
|
1219
|
+
target: Element | Text;
|
|
1220
|
+
constructor(target: Element | Text);
|
|
1221
|
+
}
|
|
1222
|
+
|
|
1218
1223
|
declare interface DescriptorBase<T = unknown, B = unknown> extends BackRef {
|
|
1219
1224
|
$flags$: number;
|
|
1220
1225
|
$index$: number;
|
|
@@ -1667,6 +1672,13 @@ export declare const inlinedQrl: <T>(symbol: T | null, symbolName: string, lexic
|
|
|
1667
1672
|
/** @internal */
|
|
1668
1673
|
export declare const inlinedQrlDEV: <T = any>(symbol: T, symbolName: string, opts: QRLDev, lexicalScopeCapture?: Readonly<unknown[]>) => QRL<T>;
|
|
1669
1674
|
|
|
1675
|
+
declare class InsertOrMoveOperation {
|
|
1676
|
+
target: Element | Text;
|
|
1677
|
+
parent: Element;
|
|
1678
|
+
beforeTarget: Element | Text | null;
|
|
1679
|
+
constructor(target: Element | Text, parent: Element, beforeTarget: Element | Text | null);
|
|
1680
|
+
}
|
|
1681
|
+
|
|
1670
1682
|
/**
|
|
1671
1683
|
* These are the HTML tags with handlers allowing plain callbacks, to be used for the JSX interface
|
|
1672
1684
|
*
|
|
@@ -1761,9 +1773,10 @@ export declare const _isTask: (value: any) => value is Task;
|
|
|
1761
1773
|
|
|
1762
1774
|
/** @internal */
|
|
1763
1775
|
declare interface IStreamHandler {
|
|
1764
|
-
flush(): void
|
|
1776
|
+
flush(): ValueOrPromise<void>;
|
|
1777
|
+
waitForPendingFlush(): ValueOrPromise<void>;
|
|
1765
1778
|
streamBlockStart(): void;
|
|
1766
|
-
streamBlockEnd(): void
|
|
1779
|
+
streamBlockEnd(): ValueOrPromise<void>;
|
|
1767
1780
|
}
|
|
1768
1781
|
|
|
1769
1782
|
/**
|
|
@@ -2736,7 +2749,10 @@ export declare type QwikWheelEvent<T = Element> = NativeWheelEvent;
|
|
|
2736
2749
|
|
|
2737
2750
|
declare type QwikWindowEventMap = Omit<WindowEventHandlersEventMap, keyof QwikDocumentEventMap> & QwikDocumentEventMap;
|
|
2738
2751
|
|
|
2739
|
-
/**
|
|
2752
|
+
/**
|
|
2753
|
+
* @deprecated Use `Readonly<Signal<T>>` instead.
|
|
2754
|
+
* @public
|
|
2755
|
+
*/
|
|
2740
2756
|
export declare interface ReadonlySignal<T = unknown> {
|
|
2741
2757
|
readonly value: T;
|
|
2742
2758
|
}
|
|
@@ -2765,6 +2781,11 @@ declare type RefFnInterface<EL> = {
|
|
|
2765
2781
|
*/
|
|
2766
2782
|
export declare const _regSymbol: (symbol: any, hash: string) => any;
|
|
2767
2783
|
|
|
2784
|
+
declare class RemoveAllChildrenOperation {
|
|
2785
|
+
target: Element;
|
|
2786
|
+
constructor(target: Element);
|
|
2787
|
+
}
|
|
2788
|
+
|
|
2768
2789
|
/**
|
|
2769
2790
|
* Remove an external projection from its parent and clean up.
|
|
2770
2791
|
*
|
|
@@ -3100,6 +3121,15 @@ declare class SerializerSignalImpl<T, S> extends ComputedSignalImpl<T> {
|
|
|
3100
3121
|
*/
|
|
3101
3122
|
export declare const SerializerSymbol: unique symbol;
|
|
3102
3123
|
|
|
3124
|
+
declare class SetAttributeOperation {
|
|
3125
|
+
target: Element;
|
|
3126
|
+
attrName: string;
|
|
3127
|
+
attrValue: any;
|
|
3128
|
+
scopedStyleIdPrefix: string | null;
|
|
3129
|
+
isSvg: boolean;
|
|
3130
|
+
constructor(target: Element, attrName: string, attrValue: any, scopedStyleIdPrefix: string | null, isSvg: boolean);
|
|
3131
|
+
}
|
|
3132
|
+
|
|
3103
3133
|
/** @internal */
|
|
3104
3134
|
export declare function _setEvent(serializationCtx: SerializationContext, key: string, rawValue: unknown, hasMovedCaptures: boolean): string | null;
|
|
3105
3135
|
|
|
@@ -3125,6 +3155,12 @@ export declare const setPlatform: (plt: CorePlatform) => CorePlatform;
|
|
|
3125
3155
|
*/
|
|
3126
3156
|
export declare function _setProjectionTarget(vnode: _VirtualVNode, targetElement: Element): void;
|
|
3127
3157
|
|
|
3158
|
+
declare class SetTextOperation {
|
|
3159
|
+
target: Text;
|
|
3160
|
+
text: string;
|
|
3161
|
+
constructor(target: Text, text: string);
|
|
3162
|
+
}
|
|
3163
|
+
|
|
3128
3164
|
/** @internal */
|
|
3129
3165
|
export declare abstract class _SharedContainer implements _Container {
|
|
3130
3166
|
readonly $version$: string;
|
|
@@ -3576,7 +3612,8 @@ declare type StoreTarget = Record<string | symbol, any>;
|
|
|
3576
3612
|
|
|
3577
3613
|
/** @internal */
|
|
3578
3614
|
export declare interface StreamWriter {
|
|
3579
|
-
write(chunk: string): void
|
|
3615
|
+
write(chunk: string): ValueOrPromise<void>;
|
|
3616
|
+
waitForDrain?(): ValueOrPromise<void>;
|
|
3580
3617
|
}
|
|
3581
3618
|
|
|
3582
3619
|
/** @file Shared types */
|
|
@@ -4739,7 +4776,7 @@ export declare const _VAR_PROPS: unique symbol;
|
|
|
4739
4776
|
export declare const _verifySerializable: <T>(value: T, preMessage?: string) => T;
|
|
4740
4777
|
|
|
4741
4778
|
/**
|
|
4742
|
-
* 2.0.0-beta.
|
|
4779
|
+
* 2.0.0-beta.34-dev+8b055bb
|
|
4743
4780
|
*
|
|
4744
4781
|
* @public
|
|
4745
4782
|
*/
|
|
@@ -4778,9 +4815,24 @@ export declare const _vnode_ensureElementInflated: (container: _Container, vnode
|
|
|
4778
4815
|
/** @internal */
|
|
4779
4816
|
export declare const _vnode_getAttrKeys: (container: _Container, vnode: _ElementVNode | _VirtualVNode) => string[];
|
|
4780
4817
|
|
|
4818
|
+
/** @internal */
|
|
4819
|
+
export declare const _vnode_getElementName: (vnode: _ElementVNode) => string;
|
|
4820
|
+
|
|
4781
4821
|
/** @internal */
|
|
4782
4822
|
export declare const _vnode_getFirstChild: (vnode: _VNode) => _VNode | null;
|
|
4783
4823
|
|
|
4824
|
+
/** @internal */
|
|
4825
|
+
export declare const _vnode_getProp: <T = unknown>(vNode: _VNode, key: string, getObject: ((id: string) => unknown) | null) => T | null;
|
|
4826
|
+
|
|
4827
|
+
/** @internal */
|
|
4828
|
+
export declare const _vnode_getVNodeForChildNode: (vNode: _ElementVNode, childElement: Element) => _ElementVNode;
|
|
4829
|
+
|
|
4830
|
+
/** @internal */
|
|
4831
|
+
export declare const _vnode_insertBefore: (journal: _VNodeJournal, parent: _ElementVNode | _VirtualVNode, newChild: _VNode, insertBefore: _VNode | null) => void;
|
|
4832
|
+
|
|
4833
|
+
/** @internal */
|
|
4834
|
+
export declare const _vnode_isElementVNode: (vNode: _VNode) => vNode is _ElementVNode;
|
|
4835
|
+
|
|
4784
4836
|
/** @internal */
|
|
4785
4837
|
export declare const _vnode_isMaterialized: (vNode: _VNode) => boolean;
|
|
4786
4838
|
|
|
@@ -4790,6 +4842,15 @@ export declare const _vnode_isTextVNode: (vNode: _VNode) => vNode is _TextVNode;
|
|
|
4790
4842
|
/** @internal */
|
|
4791
4843
|
export declare const _vnode_isVirtualVNode: (vNode: _VNode) => vNode is _VirtualVNode;
|
|
4792
4844
|
|
|
4845
|
+
/** @internal */
|
|
4846
|
+
export declare const _vnode_newVirtual: () => _VirtualVNode;
|
|
4847
|
+
|
|
4848
|
+
/** @internal */
|
|
4849
|
+
export declare const _vnode_remove: (journal: _VNodeJournal, vParent: _ElementVNode | _VirtualVNode, vToRemove: _VNode, removeDOM: boolean) => void;
|
|
4850
|
+
|
|
4851
|
+
/** @internal */
|
|
4852
|
+
export declare const _vnode_setProp: (vNode: _VNode, key: string, value: unknown) => void;
|
|
4853
|
+
|
|
4793
4854
|
/** @internal */
|
|
4794
4855
|
export declare function _vnode_toString(this: _VNode | null, depth?: number, offset?: string, materialize?: boolean, siblings?: boolean, colorize?: boolean, container?: _Container | null): string;
|
|
4795
4856
|
|
|
@@ -4877,6 +4938,11 @@ export declare const enum _VNodeFlags {
|
|
|
4877
4938
|
HasTargetElement = 2048
|
|
4878
4939
|
}
|
|
4879
4940
|
|
|
4941
|
+
/** @internal */
|
|
4942
|
+
export declare type _VNodeJournal = Array<VNodeOperation>;
|
|
4943
|
+
|
|
4944
|
+
declare type VNodeOperation = DeleteOperation | RemoveAllChildrenOperation | SetTextOperation | InsertOrMoveOperation | SetAttributeOperation;
|
|
4945
|
+
|
|
4880
4946
|
/** @internal */
|
|
4881
4947
|
export declare const _waitUntilRendered: (container: _Container) => Promise<void>;
|
|
4882
4948
|
|