@qwik.dev/core 2.0.0-beta.42 → 2.0.0-beta.43
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 +2 -2
- package/dist/core-internal.d.ts +1 -1
- package/dist/core.min.mjs +11 -11
- package/dist/core.mjs +17 -42
- package/dist/core.mjs.map +1 -1
- package/dist/core.prod.mjs +2173 -2182
- package/dist/loader/package.json +1 -1
- package/dist/optimizer.mjs +11 -8
- package/dist/server.mjs +2 -2
- package/dist/server.prod.mjs +192 -192
- package/dist/testing/index.mjs +13 -31
- package/dist/testing/package.json +1 -1
- package/dist/worker/package.json +1 -1
- package/package.json +3 -3
package/dist/core.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* @qwik.dev/core 2.0.0-beta.
|
|
3
|
+
* @qwik.dev/core 2.0.0-beta.43-dev+e478dfb
|
|
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
|
|
@@ -189,9 +189,6 @@ const isString = (v) => {
|
|
|
189
189
|
const isFunction = (v) => {
|
|
190
190
|
return typeof v === 'function';
|
|
191
191
|
};
|
|
192
|
-
const isPrimitiveOrNullUndefined = (v) => {
|
|
193
|
-
return (typeof v !== 'object' && typeof v !== 'function') || v === null || v === undefined;
|
|
194
|
-
};
|
|
195
192
|
|
|
196
193
|
const baseUrl = 'https://qwikdev-build-v2.qwik-8nx.pages.dev/docs/errors/#q';
|
|
197
194
|
const codeToText = (code, ...parts) => {
|
|
@@ -475,6 +472,7 @@ const QDefaultSlot = '';
|
|
|
475
472
|
const ELEMENT_ID = 'q:id';
|
|
476
473
|
const ELEMENT_KEY = 'q:key';
|
|
477
474
|
const ELEMENT_PROPS = 'q:props';
|
|
475
|
+
const USE_ON_PLACEHOLDER_KEY = ':useOn';
|
|
478
476
|
/** @internal */
|
|
479
477
|
const ELEMENT_SEQ = 'q:seq';
|
|
480
478
|
const ELEMENT_SEQ_IDX = 'q:seqIdx';
|
|
@@ -1281,7 +1279,7 @@ const COMMA = ',';
|
|
|
1281
1279
|
*
|
|
1282
1280
|
* @public
|
|
1283
1281
|
*/
|
|
1284
|
-
const version = "2.0.0-beta.
|
|
1282
|
+
const version = "2.0.0-beta.43-dev+e478dfb";
|
|
1285
1283
|
|
|
1286
1284
|
const isNode = (value) => {
|
|
1287
1285
|
return value && typeof value.nodeType === 'number';
|
|
@@ -5528,11 +5526,14 @@ function cleanup(container, journal, vNode, cursorRoot = null) {
|
|
|
5528
5526
|
const obj = seq[i];
|
|
5529
5527
|
if (isObject(obj)) {
|
|
5530
5528
|
const objIsTask = isTask(obj);
|
|
5531
|
-
if (objIsTask
|
|
5532
|
-
obj
|
|
5533
|
-
|
|
5534
|
-
|
|
5535
|
-
|
|
5529
|
+
if (objIsTask) {
|
|
5530
|
+
clearAllEffects(container, obj);
|
|
5531
|
+
if (obj.$flags$ & 1 /* TaskFlags.VISIBLE_TASK */) {
|
|
5532
|
+
obj.$flags$ |= 16 /* TaskFlags.NEEDS_CLEANUP */;
|
|
5533
|
+
markVNodeDirty(container, vCursor, 128 /* ChoreBits.CLEANUP */, cursorRoot);
|
|
5534
|
+
// don't call cleanupDestroyable yet, do it by the scheduler
|
|
5535
|
+
continue;
|
|
5536
|
+
}
|
|
5536
5537
|
}
|
|
5537
5538
|
// Stores and plain signals are only producers; their subscriptions are removed
|
|
5538
5539
|
// when cleaning the consumers that read them. They don't own reactive backrefs.
|
|
@@ -5988,43 +5989,16 @@ function findFirstElementNode(jsx) {
|
|
|
5988
5989
|
* This is necessary for headless components (components that don't render a real DOM element) to
|
|
5989
5990
|
* have an anchor point for `useOn` event listeners that target the document or window.
|
|
5990
5991
|
*
|
|
5991
|
-
* @param jsx The JSX output
|
|
5992
|
+
* @param jsx The JSX output of the component.
|
|
5992
5993
|
* @param placeholder The placeholder element to inject.
|
|
5993
|
-
* @returns The
|
|
5994
|
+
* @returns The JSX output with the placeholder as its last sibling.
|
|
5994
5995
|
*/
|
|
5995
5996
|
function injectPlaceholderElement(jsx, placeholder) {
|
|
5996
|
-
|
|
5997
|
-
if (isJSXNode(jsx)) {
|
|
5998
|
-
// Inline components may ignore children, while component$ children become projections.
|
|
5999
|
-
if (jsx.type !== Fragment) {
|
|
6000
|
-
return _jsxSorted(Fragment, null, null, [jsx, placeholder], 0, null);
|
|
6001
|
-
}
|
|
6002
|
-
if (jsx.children == null) {
|
|
6003
|
-
jsx.children = placeholder;
|
|
6004
|
-
}
|
|
6005
|
-
else if (isArray(jsx.children)) {
|
|
6006
|
-
jsx.children.push(placeholder);
|
|
6007
|
-
}
|
|
6008
|
-
else {
|
|
6009
|
-
jsx.children = [jsx.children, placeholder];
|
|
6010
|
-
}
|
|
6011
|
-
return jsx;
|
|
6012
|
-
}
|
|
6013
|
-
// For primitives, we can't add children, so we wrap them in a fragment.
|
|
6014
|
-
if (isPrimitiveOrNullUndefined(jsx)) {
|
|
6015
|
-
return _jsxSorted(Fragment, null, null, [jsx, placeholder], 0, null);
|
|
6016
|
-
}
|
|
6017
|
-
// For an array of nodes, we inject the placeholder into the first element.
|
|
6018
|
-
if (isArray(jsx) && jsx.length > 0) {
|
|
6019
|
-
injectPlaceholderElement(jsx[0], placeholder);
|
|
6020
|
-
return jsx;
|
|
6021
|
-
}
|
|
6022
|
-
// For anything else we do nothing.
|
|
6023
|
-
return jsx;
|
|
5997
|
+
return isArray(jsx) ? [...jsx, placeholder] : [jsx, placeholder];
|
|
6024
5998
|
}
|
|
6025
5999
|
/** @returns An empty <script> element for adding qwik metadata attributes to */
|
|
6026
6000
|
function createPlaceholderScriptNode() {
|
|
6027
|
-
return new JSXNodeImpl('script', null, { hidden: '' }, null, 0,
|
|
6001
|
+
return new JSXNodeImpl('script', null, { hidden: '' }, null, 0, USE_ON_PLACEHOLDER_KEY);
|
|
6028
6002
|
}
|
|
6029
6003
|
|
|
6030
6004
|
function collectChildren(first, last = null) {
|
|
@@ -15196,7 +15170,8 @@ class DomContainer extends _SharedContainer {
|
|
|
15196
15170
|
if (!__EXPERIMENTAL__.errorBoundary) {
|
|
15197
15171
|
const errorStore = host && this.resolveContext(host, ERROR_CONTEXT);
|
|
15198
15172
|
if (!errorStore) {
|
|
15199
|
-
|
|
15173
|
+
logErrorAndThrowAsync(err);
|
|
15174
|
+
return;
|
|
15200
15175
|
}
|
|
15201
15176
|
errorStore.error = err;
|
|
15202
15177
|
return;
|