@stencil/core 5.0.0-beta.0 → 5.0.0-beta.10
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/app-data/index.d.ts +1 -1
- package/dist/{client-BRu0GtRn.mjs → client-Db2rdxUM.mjs} +34 -13
- package/dist/compiler/browser.d.ts +1534 -0
- package/dist/compiler/browser.js +16472 -0
- package/dist/compiler/index.d.mts +1 -1
- package/dist/compiler/index.mjs +2 -2
- package/dist/compiler/utils/index.d.mts +1 -1
- package/dist/{compiler-NrvbUOX1.mjs → compiler-PoywOlbq.mjs} +570 -176
- package/dist/declarations/stencil-public-compiler.d.ts +20 -4
- package/dist/declarations/stencil-public-runtime.d.ts +21 -5
- package/dist/{index-BOrz3rbJ.d.mts → index-BAP9T4CB.d.mts} +1 -1
- package/dist/{index-DnISpqrd.d.ts → index-BXAcVN2j.d.ts} +3 -11
- package/dist/{index-RrQfiPWK.d.mts → index-BvF31nqP.d.mts} +20 -4
- package/dist/index.d.mts +2 -0
- package/dist/index.mjs +82 -2
- package/dist/jsx-runtime.mjs +1 -1
- package/dist/{node-75gQKkFz.mjs → node-BKtLn2R9.mjs} +1 -1
- package/dist/runtime/client/lazy.js +137 -26
- package/dist/runtime/client/runtime.d.ts +30 -12
- package/dist/runtime/client/runtime.js +137 -26
- package/dist/runtime/index.d.ts +28 -2
- package/dist/runtime/index.js +137 -26
- package/dist/runtime/server/index.d.mts +27 -1
- package/dist/runtime/server/index.mjs +135 -24
- package/dist/sys/node/index.d.mts +1 -1
- package/dist/sys/node/index.mjs +1 -1
- package/dist/sys/node/worker.mjs +2 -2
- package/dist/testing/index.d.mts +19 -3
- package/dist/testing/index.mjs +58 -68
- package/package.json +9 -5
package/dist/app-data/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as Env, r as NAMESPACE, t as BUILD } from "../index-
|
|
1
|
+
import { n as Env, r as NAMESPACE, t as BUILD } from "../index-BXAcVN2j.js";
|
|
2
2
|
export { BUILD, Env, NAMESPACE };
|
|
@@ -996,16 +996,33 @@ const signalNodeDisposers = /* @__PURE__ */ new WeakMap();
|
|
|
996
996
|
const disposeSignalVNode = (vnode) => {
|
|
997
997
|
const elm = vnode.$elm$;
|
|
998
998
|
if (elm) {
|
|
999
|
-
|
|
1000
|
-
if (dispose) {
|
|
1001
|
-
dispose();
|
|
1002
|
-
signalNodeDisposers.delete(elm);
|
|
1003
|
-
}
|
|
999
|
+
disposeTextSignal(elm);
|
|
1004
1000
|
disposeAllSignalAttrs(elm);
|
|
1005
1001
|
}
|
|
1006
1002
|
vnode.$children$?.forEach(disposeSignalVNode);
|
|
1007
1003
|
};
|
|
1008
1004
|
/**
|
|
1005
|
+
* Tear down a text node's signal subscription, if it has one.
|
|
1006
|
+
* @param textNode the text node to unsubscribe
|
|
1007
|
+
*/
|
|
1008
|
+
const disposeTextSignal = (textNode) => {
|
|
1009
|
+
const dispose = signalNodeDisposers.get(textNode);
|
|
1010
|
+
if (dispose) {
|
|
1011
|
+
dispose();
|
|
1012
|
+
signalNodeDisposers.delete(textNode);
|
|
1013
|
+
}
|
|
1014
|
+
};
|
|
1015
|
+
/**
|
|
1016
|
+
* Subscribe a text node to a signal, keeping its `data` in sync on every change.
|
|
1017
|
+
* @param textNode the text node to keep in sync
|
|
1018
|
+
* @param textSig the signal to subscribe to
|
|
1019
|
+
*/
|
|
1020
|
+
const wireTextSignal = (textNode, textSig) => {
|
|
1021
|
+
signalNodeDisposers.set(textNode, effect(() => {
|
|
1022
|
+
textNode.data = String(textSig.value);
|
|
1023
|
+
}));
|
|
1024
|
+
};
|
|
1025
|
+
/**
|
|
1009
1026
|
* Create a DOM Node corresponding to one of the children of a given VNode.
|
|
1010
1027
|
*
|
|
1011
1028
|
* @param oldParentVNode the parent VNode from the previous render
|
|
@@ -1027,13 +1044,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
|
1027
1044
|
if (BUILD.isDev && newVNode.$elm$) consoleDevError(`The JSX ${newVNode.$text$ !== null ? `"${newVNode.$text$}" text` : `"${String(newVNode.$tag$)}" element`} node should not be shared within the same renderer. The renderer caches element lookups in order to improve performance. However, a side effect from this is that the exact same JSX node should not be reused. For more information please see https://stenciljs.com/docs/templating-jsx#avoid-shared-jsx-nodes`);
|
|
1028
1045
|
if (BUILD.vdomText && newVNode.$text$ != null) {
|
|
1029
1046
|
elm = newVNode.$elm$ = win.document.createTextNode(newVNode.$text$);
|
|
1030
|
-
if (BUILD.vdomSignals && newVNode.$signal$)
|
|
1031
|
-
const textSig = newVNode.$signal$;
|
|
1032
|
-
const textNode = elm;
|
|
1033
|
-
signalNodeDisposers.set(textNode, effect(() => {
|
|
1034
|
-
textNode.data = String(textSig.value);
|
|
1035
|
-
}));
|
|
1036
|
-
}
|
|
1047
|
+
if (BUILD.vdomSignals && newVNode.$signal$) wireTextSignal(elm, newVNode.$signal$);
|
|
1037
1048
|
} else if (BUILD.slotRelocation && newVNode.$flags$ & VNODE_FLAGS.isSlotReference) {
|
|
1038
1049
|
elm = newVNode.$elm$ = BUILD.isDebug || BUILD.hydrateServerSide ? slotReferenceDebugNode(newVNode) : win.document.createTextNode("");
|
|
1039
1050
|
if (typeof newVNode.$attrs$?.slot === "string") elm["s-sa"] = newVNode.$attrs$.slot;
|
|
@@ -1394,7 +1405,17 @@ const patch = (oldVNode, newVNode, isInitialRender = false) => {
|
|
|
1394
1405
|
else if (BUILD.hydrateClientSide && isInitialRender && BUILD.updatable && oldChildren !== null && newChildren === null) newVNode.$children$ = oldChildren;
|
|
1395
1406
|
if (BUILD.svg && isSvgMode && tag === "svg") isSvgMode = false;
|
|
1396
1407
|
} else if (BUILD.vdomText && BUILD.slotRelocation && (defaultHolder = elm["s-cr"])) defaultHolder.parentNode.textContent = text;
|
|
1397
|
-
else if (BUILD.vdomText
|
|
1408
|
+
else if (BUILD.vdomText) {
|
|
1409
|
+
if (BUILD.vdomSignals && newVNode.$signal$) {
|
|
1410
|
+
if (newVNode.$signal$ !== oldVNode.$signal$) {
|
|
1411
|
+
disposeTextSignal(elm);
|
|
1412
|
+
wireTextSignal(elm, newVNode.$signal$);
|
|
1413
|
+
}
|
|
1414
|
+
} else {
|
|
1415
|
+
if (BUILD.vdomSignals && oldVNode.$signal$) disposeTextSignal(elm);
|
|
1416
|
+
if (oldVNode.$text$ !== text) elm.data = text;
|
|
1417
|
+
}
|
|
1418
|
+
}
|
|
1398
1419
|
};
|
|
1399
1420
|
/**
|
|
1400
1421
|
* Component-global information about nodes which are either currently being
|