@stencil/core 5.0.0-beta.10 → 5.0.0-beta.11
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-Db2rdxUM.mjs → client-CdFmjaQa.mjs} +6 -2
- package/dist/compiler/browser.js +1 -1
- 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-PoywOlbq.mjs → compiler-2EypBn_Y.mjs} +92 -10
- package/dist/declarations/stencil-public-compiler.d.ts +4 -0
- package/dist/declarations/stencil-public-runtime.d.ts +57 -55
- package/dist/{index-BXAcVN2j.d.ts → index-BHciXst1.d.ts} +57 -55
- package/dist/{index-BAP9T4CB.d.mts → index-CKnzMkZC.d.mts} +1 -1
- package/dist/{index-BvF31nqP.d.mts → index-Cw1NW9FW.d.mts} +4 -0
- package/dist/index.mjs +1 -1
- package/dist/jsx-runtime.mjs +1 -1
- package/dist/{node-BKtLn2R9.mjs → node-HKfDhPR3.mjs} +1 -1
- package/dist/runtime/client/lazy.js +25 -13
- package/dist/runtime/client/runtime.d.ts +57 -55
- package/dist/runtime/client/runtime.js +25 -13
- package/dist/runtime/index.d.ts +1 -1
- package/dist/runtime/index.js +25 -13
- package/dist/runtime/server/index.d.mts +2 -1
- package/dist/runtime/server/index.mjs +45 -26
- package/dist/runtime/server/runner.mjs +8 -5
- package/dist/signals/index.d.ts +11 -2
- package/dist/signals/index.js +11 -1
- 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 +4 -0
- package/dist/testing/index.mjs +26 -14
- package/package.json +4 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BUILD, BUILD as BUILD$1, Env, NAMESPACE, NAMESPACE as NAMESPACE$1 } from "@stencil/core/app-data";
|
|
2
2
|
import { globalScripts, globalStyles } from "@stencil/core/app-globals";
|
|
3
|
-
import
|
|
3
|
+
import * as SignalsCore from "@preact/signals-core";
|
|
4
4
|
const MEMBER_FLAGS = {
|
|
5
5
|
String: 1,
|
|
6
6
|
Number: 2,
|
|
@@ -1311,6 +1311,13 @@ const isComplexType = (o) => {
|
|
|
1311
1311
|
return o === "object" || o === "function";
|
|
1312
1312
|
};
|
|
1313
1313
|
//#endregion
|
|
1314
|
+
//#region src/runtime/signals-core.ts
|
|
1315
|
+
const getCore = () => globalThis[Symbol.for("stencil.preact-signals-core")] ??= SignalsCore;
|
|
1316
|
+
const effect = (fn, options) => getCore().effect(fn, options);
|
|
1317
|
+
function signal(value, options) {
|
|
1318
|
+
return getCore().signal(value, options);
|
|
1319
|
+
}
|
|
1320
|
+
//#endregion
|
|
1314
1321
|
//#region src/runtime/event-emitter.ts
|
|
1315
1322
|
const createEvent = (ref, name, flags) => {
|
|
1316
1323
|
const elm = getElement(ref);
|
|
@@ -1380,7 +1387,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialR
|
|
|
1380
1387
|
attrMap.get(memberName)?.();
|
|
1381
1388
|
if (!signalAttrDisposers.has(elm)) signalAttrDisposers.set(elm, attrMap);
|
|
1382
1389
|
let prevVal = oldValue;
|
|
1383
|
-
attrMap.set(memberName, effect
|
|
1390
|
+
attrMap.set(memberName, effect(() => {
|
|
1384
1391
|
const curVal = newValue.value;
|
|
1385
1392
|
setAccessor(elm, memberName, prevVal, curVal, isSvg, flags);
|
|
1386
1393
|
prevVal = curVal;
|
|
@@ -1619,7 +1626,7 @@ const disposeTextSignal = (textNode) => {
|
|
|
1619
1626
|
* @param textSig the signal to subscribe to
|
|
1620
1627
|
*/
|
|
1621
1628
|
const wireTextSignal = (textNode, textSig) => {
|
|
1622
|
-
signalNodeDisposers.set(textNode, effect
|
|
1629
|
+
signalNodeDisposers.set(textNode, effect(() => {
|
|
1623
1630
|
textNode.data = String(textSig.value);
|
|
1624
1631
|
}));
|
|
1625
1632
|
};
|
|
@@ -1913,7 +1920,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh, isInitialRender = fal
|
|
|
1913
1920
|
}
|
|
1914
1921
|
if (BUILD$1.vdomKey && idxInOld >= 0) {
|
|
1915
1922
|
elmToMove = oldCh[idxInOld];
|
|
1916
|
-
if (elmToMove.$tag$ !== newStartVnode.$tag$) node = createElm(oldCh && oldCh[newStartIdx], newVNode,
|
|
1923
|
+
if (elmToMove.$tag$ !== newStartVnode.$tag$) node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx);
|
|
1917
1924
|
else {
|
|
1918
1925
|
patch(elmToMove, newStartVnode, isInitialRender);
|
|
1919
1926
|
oldCh[idxInOld] = void 0;
|
|
@@ -2716,8 +2723,7 @@ const initializeSignals = (elm, hostRef, cmpMeta) => {
|
|
|
2716
2723
|
const instance = BUILD$1.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
2717
2724
|
for (const [memberName, [memberFlags]] of Object.entries(cmpMeta.$members$ ?? {})) {
|
|
2718
2725
|
if (!(memberFlags & MEMBER_FLAGS.PropLike)) continue;
|
|
2719
|
-
const
|
|
2720
|
-
const sig = signal(initialVal);
|
|
2726
|
+
const sig = signal(hostRef.$instanceValues$.get(memberName));
|
|
2721
2727
|
hostRef.$signalValues$.set(memberName, sig);
|
|
2722
2728
|
let prevScheduleVal = sig.peek();
|
|
2723
2729
|
disposers.push(effect(() => {
|
|
@@ -4019,16 +4025,21 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
4019
4025
|
});
|
|
4020
4026
|
return;
|
|
4021
4027
|
}
|
|
4022
|
-
const
|
|
4028
|
+
const parsedValue = parsePropertyValue(newValue, memberFlags, BUILD$1.formAssociated && !!(cmpMeta.$flags$ & CMP_FLAGS.formAssociated));
|
|
4029
|
+
const setterSetVal = (val) => {
|
|
4023
4030
|
const currentValue = ref.$lazyInstance$[memberName];
|
|
4024
4031
|
if (!ref.$instanceValues$.get(memberName) && currentValue) ref.$instanceValues$.set(memberName, currentValue);
|
|
4025
|
-
ref.$lazyInstance$[memberName] =
|
|
4032
|
+
ref.$lazyInstance$[memberName] = val;
|
|
4026
4033
|
setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
|
|
4027
4034
|
};
|
|
4028
|
-
if (ref.$lazyInstance$) setterSetVal();
|
|
4029
|
-
else
|
|
4030
|
-
|
|
4031
|
-
|
|
4035
|
+
if (ref.$lazyInstance$) setterSetVal(parsedValue);
|
|
4036
|
+
else {
|
|
4037
|
+
ref.$instanceValues$.set(memberName, parsedValue);
|
|
4038
|
+
ref.$fetchedCbList$.push(() => {
|
|
4039
|
+
const pendingValue = ref.$instanceValues$.get(memberName);
|
|
4040
|
+
if (ref.$lazyInstance$[memberName] !== pendingValue) setterSetVal(pendingValue);
|
|
4041
|
+
});
|
|
4042
|
+
}
|
|
4032
4043
|
}
|
|
4033
4044
|
} });
|
|
4034
4045
|
} else if (BUILD$1.lazyLoad && BUILD$1.method && flags & PROXY_FLAGS.isElementConstructor && memberFlags & MEMBER_FLAGS.Method) Object.defineProperty(prototype, memberName, { value(...args) {
|
|
@@ -4081,8 +4092,9 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
4081
4092
|
if (BUILD$1.reflect && propMemberFlags & MEMBER_FLAGS.ReflectAttr && propMemberFlags & MEMBER_FLAGS.Any && !isComplexType(this[propName]) && reflectedAttrValue(this[propName]) === newValue) return;
|
|
4082
4093
|
const isSpuriousBooleanRemoval = isBooleanTarget && newValue === null && this[propName] === void 0;
|
|
4083
4094
|
if (isBooleanTarget) newValue = !(newValue === null || newValue === "false");
|
|
4095
|
+
const currentValue = BUILD$1.lazyLoad && propMemberFlags & MEMBER_FLAGS.Setter ? hostRef.$instanceValues$.get(propName) : this[propName];
|
|
4084
4096
|
const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
|
|
4085
|
-
if (!isSpuriousBooleanRemoval && newValue !=
|
|
4097
|
+
if (!isSpuriousBooleanRemoval && newValue != currentValue && (!propDesc.get || !!propDesc.set)) this[propName] = newValue;
|
|
4086
4098
|
});
|
|
4087
4099
|
};
|
|
4088
4100
|
Cstr.observedAttributes = Array.from(/* @__PURE__ */ new Set([...Object.keys(cmpMeta.$watchers$ ?? {}), ...members.filter(([_, m]) => m[0] & MEMBER_FLAGS.HasAttribute).map(([propName, m]) => {
|
|
@@ -5086,8 +5098,9 @@ function forceUpdate$1() {}
|
|
|
5086
5098
|
* @param results The results object to store the hydration results.
|
|
5087
5099
|
* @param afterSsr The callback to be called after SSR is complete.
|
|
5088
5100
|
* @param resolve The resolve function to be called when SSR is complete.
|
|
5101
|
+
* @param abortController The AbortController to use for aborting in-flight fetch() calls and other cancellable work when SSR times out.
|
|
5089
5102
|
*/
|
|
5090
|
-
function ssrApp(win, opts, results, afterSsr, resolve) {
|
|
5103
|
+
function ssrApp(win, opts, results, afterSsr, resolve, abortController) {
|
|
5091
5104
|
const connectedElements = /* @__PURE__ */ new Set();
|
|
5092
5105
|
const createdElements = /* @__PURE__ */ new Set();
|
|
5093
5106
|
const waitingElements = /* @__PURE__ */ new Set();
|
|
@@ -5097,6 +5110,10 @@ function ssrApp(win, opts, results, afterSsr, resolve) {
|
|
|
5097
5110
|
setScopedSsr(opts);
|
|
5098
5111
|
let tmrId;
|
|
5099
5112
|
let ranCompleted = false;
|
|
5113
|
+
const abortedPromise = new Promise((res) => {
|
|
5114
|
+
if (abortController.signal.aborted) res();
|
|
5115
|
+
else abortController.signal.addEventListener("abort", () => res(), { once: true });
|
|
5116
|
+
});
|
|
5100
5117
|
function hydratedComplete() {
|
|
5101
5118
|
$nativeClearTimeout(tmrId);
|
|
5102
5119
|
createdElements.clear();
|
|
@@ -5116,6 +5133,7 @@ function ssrApp(win, opts, results, afterSsr, resolve) {
|
|
|
5116
5133
|
}
|
|
5117
5134
|
function hydratedError(err) {
|
|
5118
5135
|
renderCatchError(opts, results, err);
|
|
5136
|
+
abortController.abort();
|
|
5119
5137
|
hydratedComplete();
|
|
5120
5138
|
}
|
|
5121
5139
|
function timeoutExceeded() {
|
|
@@ -5160,7 +5178,7 @@ function ssrApp(win, opts, results, afterSsr, resolve) {
|
|
|
5160
5178
|
if (isValidComponent(elm, opts) && results.hydratedCount < opts.maxHydrateCount) {
|
|
5161
5179
|
if (!connectedElements.has(elm) && shouldHydrate(elm)) {
|
|
5162
5180
|
connectedElements.add(elm);
|
|
5163
|
-
return hydrateComponent.call(elm, win, results, elm.nodeName, elm, waitingElements);
|
|
5181
|
+
return hydrateComponent.call(elm, win, results, elm.nodeName, elm, waitingElements, abortedPromise);
|
|
5164
5182
|
}
|
|
5165
5183
|
}
|
|
5166
5184
|
return resolved;
|
|
@@ -5189,7 +5207,7 @@ function ssrApp(win, opts, results, afterSsr, resolve) {
|
|
|
5189
5207
|
hydratedError(e);
|
|
5190
5208
|
}
|
|
5191
5209
|
}
|
|
5192
|
-
async function hydrateComponent(win, results, tagName, elm, waitingElements) {
|
|
5210
|
+
async function hydrateComponent(win, results, tagName, elm, waitingElements, aborted) {
|
|
5193
5211
|
tagName = tagName.toLowerCase();
|
|
5194
5212
|
const Cstr = loadModule({
|
|
5195
5213
|
$tagName$: tagName,
|
|
@@ -5204,16 +5222,17 @@ async function hydrateComponent(win, results, tagName, elm, waitingElements) {
|
|
|
5204
5222
|
addHostEventListeners(this, hostRef, cmpMeta.$listeners$);
|
|
5205
5223
|
try {
|
|
5206
5224
|
connectedCallback(elm);
|
|
5207
|
-
await elm.componentOnReady()
|
|
5208
|
-
|
|
5209
|
-
|
|
5210
|
-
|
|
5211
|
-
|
|
5212
|
-
|
|
5213
|
-
|
|
5214
|
-
|
|
5215
|
-
|
|
5216
|
-
|
|
5225
|
+
if (!await Promise.race([elm.componentOnReady().then(() => false), aborted.then(() => true)])) {
|
|
5226
|
+
results.hydratedCount++;
|
|
5227
|
+
const ref = getHostRef(elm);
|
|
5228
|
+
const modeName = !ref?.$modeName$ ? "$" : ref?.$modeName$;
|
|
5229
|
+
if (!results.components.some((c) => c.tag === tagName && c.mode === modeName)) results.components.push({
|
|
5230
|
+
tag: tagName,
|
|
5231
|
+
mode: modeName,
|
|
5232
|
+
count: 0,
|
|
5233
|
+
depth: -1
|
|
5234
|
+
});
|
|
5235
|
+
}
|
|
5217
5236
|
} catch (e) {
|
|
5218
5237
|
win.console.error(e);
|
|
5219
5238
|
}
|
|
@@ -11927,11 +11927,14 @@ function resetWindow(win) {
|
|
|
11927
11927
|
if (win.document != null) try {
|
|
11928
11928
|
win.document.defaultView = win;
|
|
11929
11929
|
} catch {}
|
|
11930
|
-
|
|
11931
|
-
|
|
11932
|
-
|
|
11933
|
-
win.
|
|
11934
|
-
win.
|
|
11930
|
+
const windowDestroyed = () => {
|
|
11931
|
+
throw new Error("MockWindow was already destroyed");
|
|
11932
|
+
};
|
|
11933
|
+
win.fetch = windowDestroyed;
|
|
11934
|
+
win.Headers = windowDestroyed;
|
|
11935
|
+
win.Request = windowDestroyed;
|
|
11936
|
+
win.Response = windowDestroyed;
|
|
11937
|
+
win.FetchError = windowDestroyed;
|
|
11935
11938
|
}
|
|
11936
11939
|
}
|
|
11937
11940
|
function resetWindowDimensions(win) {
|
package/dist/signals/index.d.ts
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as SignalsCore from "@preact/signals-core";
|
|
2
|
+
import { ReadonlySignal, Signal } from "@preact/signals-core";
|
|
2
3
|
import "rolldown";
|
|
3
4
|
import "typescript";
|
|
5
|
+
//#region src/runtime/signals-core.d.ts
|
|
6
|
+
declare const batch: typeof SignalsCore.batch;
|
|
7
|
+
declare const computed: typeof SignalsCore.computed;
|
|
8
|
+
declare const effect: typeof SignalsCore.effect;
|
|
9
|
+
declare const untracked: typeof SignalsCore.untracked;
|
|
10
|
+
declare function signal<T>(value: T, options?: SignalsCore.SignalOptions<T>): SignalsCore.Signal<T>;
|
|
11
|
+
declare function signal<T = undefined>(): SignalsCore.Signal<T | undefined>;
|
|
12
|
+
//#endregion
|
|
4
13
|
//#region src/runtime/signals.d.ts
|
|
5
14
|
declare const STENCIL_SIGNALS_SYMBOL: unique symbol;
|
|
6
15
|
//#endregion
|
|
@@ -22,7 +31,7 @@ declare const STENCIL_SIGNALS_SYMBOL: unique symbol;
|
|
|
22
31
|
* @param prop - the `@Prop` member name
|
|
23
32
|
* @returns the `ReadonlySignal` for the prop, or `null` if not found / not signal-backed
|
|
24
33
|
*/
|
|
25
|
-
declare const getSignal: <T = unknown>(elm: Element, prop: string) => ReadonlySignal
|
|
34
|
+
declare const getSignal: <T = unknown>(elm: Element, prop: string) => ReadonlySignal<T> | null;
|
|
26
35
|
/**
|
|
27
36
|
* Marks a class method as a reactive effect. Wraps the method in `effect()` after
|
|
28
37
|
* signal initialization and registers cleanup on disconnect. Dependencies are
|
package/dist/signals/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as SignalsCore from "@preact/signals-core";
|
|
2
2
|
//#region src/app-data/index.ts
|
|
3
3
|
/**
|
|
4
4
|
* A collection of default build flags for a Stencil project.
|
|
@@ -140,6 +140,16 @@ const consoleDevWarn = (...m) => console.warn(...STENCIL_DEV_MODE, ...m);
|
|
|
140
140
|
(typeof window !== "undefined" ? window : {}).HTMLElement;
|
|
141
141
|
BUILD.constructableCSS;
|
|
142
142
|
//#endregion
|
|
143
|
+
//#region src/runtime/signals-core.ts
|
|
144
|
+
const getCore = () => globalThis[Symbol.for("stencil.preact-signals-core")] ??= SignalsCore;
|
|
145
|
+
const batch = (fn) => getCore().batch(fn);
|
|
146
|
+
const computed = (fn, options) => getCore().computed(fn, options);
|
|
147
|
+
const effect = (fn, options) => getCore().effect(fn, options);
|
|
148
|
+
const untracked = (fn) => getCore().untracked(fn);
|
|
149
|
+
function signal(value, options) {
|
|
150
|
+
return getCore().signal(value, options);
|
|
151
|
+
}
|
|
152
|
+
//#endregion
|
|
143
153
|
//#region src/runtime/signals.ts
|
|
144
154
|
const STENCIL_SIGNALS_SYMBOL = Symbol.for("stencil.signals");
|
|
145
155
|
BUILD.lazyLoad || globalThis.HTMLElement;
|
package/dist/sys/node/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as setupNodeProcess, r as createNodeLogger, t as createNodeSys } from "../../node-
|
|
1
|
+
import { n as setupNodeProcess, r as createNodeLogger, t as createNodeSys } from "../../node-HKfDhPR3.mjs";
|
|
2
2
|
export { createNodeLogger, createNodeSys, setupNodeProcess };
|
package/dist/sys/node/worker.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { l as createWorkerMessageHandler } from "../../compiler-
|
|
2
|
-
import { t as createNodeSys } from "../../node-
|
|
1
|
+
import { l as createWorkerMessageHandler } from "../../compiler-2EypBn_Y.mjs";
|
|
2
|
+
import { t as createNodeSys } from "../../node-HKfDhPR3.mjs";
|
|
3
3
|
//#region src/sys/node/node-worker-thread.ts
|
|
4
4
|
/**
|
|
5
5
|
* Initialize a worker thread, setting up various machinery for managing
|
package/dist/testing/index.d.mts
CHANGED
|
@@ -2475,6 +2475,10 @@ interface OutputTargetSsr extends OutputTargetBase {
|
|
|
2475
2475
|
*/
|
|
2476
2476
|
cjs?: boolean;
|
|
2477
2477
|
}
|
|
2478
|
+
/**
|
|
2479
|
+
* Compiles the SSR hydrate app to a WASM plugin (via `extism-js`/QuickJS-ng) that can run
|
|
2480
|
+
* outside of Node
|
|
2481
|
+
*/
|
|
2478
2482
|
interface OutputTargetSsrWasm extends OutputTargetBase {
|
|
2479
2483
|
type: 'ssr-wasm';
|
|
2480
2484
|
/** Output directory. @default 'dist/ssr-wasm' */
|
package/dist/testing/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { MockWindow, setupGlobal } from "@stencil/mock-doc";
|
|
|
3
3
|
import "typescript";
|
|
4
4
|
import fs from "node:fs";
|
|
5
5
|
import "picomatch";
|
|
6
|
-
import
|
|
6
|
+
import * as SignalsCore from "@preact/signals-core";
|
|
7
7
|
import path, { basename, dirname } from "path";
|
|
8
8
|
import "postcss";
|
|
9
9
|
import "postcss-safe-parser";
|
|
@@ -32,7 +32,7 @@ import "@rollup/pluginutils";
|
|
|
32
32
|
import { createHash } from "crypto";
|
|
33
33
|
import { afterAll, vi } from "vitest";
|
|
34
34
|
//#region src/version.ts
|
|
35
|
-
const version = "5.0.0-beta.
|
|
35
|
+
const version = "5.0.0-beta.11";
|
|
36
36
|
const MEMBER_FLAGS = {
|
|
37
37
|
String: 1,
|
|
38
38
|
Number: 2,
|
|
@@ -2110,6 +2110,13 @@ const hydrateScopedToShadow = () => {
|
|
|
2110
2110
|
registerStyle(scopeId, convertScopedToShadow(styleElements[i].innerHTML), allowCS);
|
|
2111
2111
|
}
|
|
2112
2112
|
};
|
|
2113
|
+
//#endregion
|
|
2114
|
+
//#region src/runtime/signals-core.ts
|
|
2115
|
+
const getCore = () => globalThis[Symbol.for("stencil.preact-signals-core")] ??= SignalsCore;
|
|
2116
|
+
const effect = (fn, options) => getCore().effect(fn, options);
|
|
2117
|
+
function signal(value, options) {
|
|
2118
|
+
return getCore().signal(value, options);
|
|
2119
|
+
}
|
|
2113
2120
|
const getRegistry = () => customElements;
|
|
2114
2121
|
//#endregion
|
|
2115
2122
|
//#region src/runtime/vdom/set-accessor.ts
|
|
@@ -2154,7 +2161,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialR
|
|
|
2154
2161
|
attrMap.get(memberName)?.();
|
|
2155
2162
|
if (!signalAttrDisposers.has(elm)) signalAttrDisposers.set(elm, attrMap);
|
|
2156
2163
|
let prevVal = oldValue;
|
|
2157
|
-
attrMap.set(memberName, effect
|
|
2164
|
+
attrMap.set(memberName, effect(() => {
|
|
2158
2165
|
const curVal = newValue.value;
|
|
2159
2166
|
setAccessor(elm, memberName, prevVal, curVal, isSvg, flags);
|
|
2160
2167
|
prevVal = curVal;
|
|
@@ -2393,7 +2400,7 @@ const disposeTextSignal = (textNode) => {
|
|
|
2393
2400
|
* @param textSig the signal to subscribe to
|
|
2394
2401
|
*/
|
|
2395
2402
|
const wireTextSignal = (textNode, textSig) => {
|
|
2396
|
-
signalNodeDisposers.set(textNode, effect
|
|
2403
|
+
signalNodeDisposers.set(textNode, effect(() => {
|
|
2397
2404
|
textNode.data = String(textSig.value);
|
|
2398
2405
|
}));
|
|
2399
2406
|
};
|
|
@@ -2687,7 +2694,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh, isInitialRender = fal
|
|
|
2687
2694
|
}
|
|
2688
2695
|
if (BUILD.vdomKey && idxInOld >= 0) {
|
|
2689
2696
|
elmToMove = oldCh[idxInOld];
|
|
2690
|
-
if (elmToMove.$tag$ !== newStartVnode.$tag$) node = createElm(oldCh && oldCh[newStartIdx], newVNode,
|
|
2697
|
+
if (elmToMove.$tag$ !== newStartVnode.$tag$) node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx);
|
|
2691
2698
|
else {
|
|
2692
2699
|
patch(elmToMove, newStartVnode, isInitialRender);
|
|
2693
2700
|
oldCh[idxInOld] = void 0;
|
|
@@ -3490,8 +3497,7 @@ const initializeSignals = (elm, hostRef, cmpMeta) => {
|
|
|
3490
3497
|
const instance = BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
3491
3498
|
for (const [memberName, [memberFlags]] of Object.entries(cmpMeta.$members$ ?? {})) {
|
|
3492
3499
|
if (!(memberFlags & MEMBER_FLAGS.PropLike)) continue;
|
|
3493
|
-
const
|
|
3494
|
-
const sig = signal(initialVal);
|
|
3500
|
+
const sig = signal(hostRef.$instanceValues$.get(memberName));
|
|
3495
3501
|
hostRef.$signalValues$.set(memberName, sig);
|
|
3496
3502
|
let prevScheduleVal = sig.peek();
|
|
3497
3503
|
disposers.push(effect(() => {
|
|
@@ -4785,16 +4791,21 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
4785
4791
|
});
|
|
4786
4792
|
return;
|
|
4787
4793
|
}
|
|
4788
|
-
const
|
|
4794
|
+
const parsedValue = parsePropertyValue(newValue, memberFlags, BUILD.formAssociated && !!(cmpMeta.$flags$ & CMP_FLAGS.formAssociated));
|
|
4795
|
+
const setterSetVal = (val) => {
|
|
4789
4796
|
const currentValue = ref.$lazyInstance$[memberName];
|
|
4790
4797
|
if (!ref.$instanceValues$.get(memberName) && currentValue) ref.$instanceValues$.set(memberName, currentValue);
|
|
4791
|
-
ref.$lazyInstance$[memberName] =
|
|
4798
|
+
ref.$lazyInstance$[memberName] = val;
|
|
4792
4799
|
setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
|
|
4793
4800
|
};
|
|
4794
|
-
if (ref.$lazyInstance$) setterSetVal();
|
|
4795
|
-
else
|
|
4796
|
-
|
|
4797
|
-
|
|
4801
|
+
if (ref.$lazyInstance$) setterSetVal(parsedValue);
|
|
4802
|
+
else {
|
|
4803
|
+
ref.$instanceValues$.set(memberName, parsedValue);
|
|
4804
|
+
ref.$fetchedCbList$.push(() => {
|
|
4805
|
+
const pendingValue = ref.$instanceValues$.get(memberName);
|
|
4806
|
+
if (ref.$lazyInstance$[memberName] !== pendingValue) setterSetVal(pendingValue);
|
|
4807
|
+
});
|
|
4808
|
+
}
|
|
4798
4809
|
}
|
|
4799
4810
|
} });
|
|
4800
4811
|
} else if (BUILD.lazyLoad && BUILD.method && flags & PROXY_FLAGS.isElementConstructor && memberFlags & MEMBER_FLAGS.Method) Object.defineProperty(prototype, memberName, { value(...args) {
|
|
@@ -4847,8 +4858,9 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
4847
4858
|
if (BUILD.reflect && propMemberFlags & MEMBER_FLAGS.ReflectAttr && propMemberFlags & MEMBER_FLAGS.Any && !isComplexType(this[propName]) && reflectedAttrValue(this[propName]) === newValue) return;
|
|
4848
4859
|
const isSpuriousBooleanRemoval = isBooleanTarget && newValue === null && this[propName] === void 0;
|
|
4849
4860
|
if (isBooleanTarget) newValue = !(newValue === null || newValue === "false");
|
|
4861
|
+
const currentValue = BUILD.lazyLoad && propMemberFlags & MEMBER_FLAGS.Setter ? hostRef.$instanceValues$.get(propName) : this[propName];
|
|
4850
4862
|
const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
|
|
4851
|
-
if (!isSpuriousBooleanRemoval && newValue !=
|
|
4863
|
+
if (!isSpuriousBooleanRemoval && newValue != currentValue && (!propDesc.get || !!propDesc.set)) this[propName] = newValue;
|
|
4852
4864
|
});
|
|
4853
4865
|
};
|
|
4854
4866
|
Cstr.observedAttributes = Array.from(/* @__PURE__ */ new Set([...Object.keys(cmpMeta.$watchers$ ?? {}), ...members.filter(([_, m]) => m[0] & MEMBER_FLAGS.HasAttribute).map(([propName, m]) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stencil/core",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.11",
|
|
4
4
|
"description": "A Compiler for Web Components and Progressive Web Apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"components",
|
|
@@ -125,9 +125,9 @@
|
|
|
125
125
|
"terser": "^5.50.0",
|
|
126
126
|
"tinyglobby": "^0.2.17",
|
|
127
127
|
"typescript": ">5.0.0 <7.0.0",
|
|
128
|
-
"@stencil/
|
|
129
|
-
"@stencil/
|
|
130
|
-
"@stencil/mock-doc": "5.0.0-beta.
|
|
128
|
+
"@stencil/cli": "5.0.0-beta.11",
|
|
129
|
+
"@stencil/dev-server": "5.0.0-beta.11",
|
|
130
|
+
"@stencil/mock-doc": "5.0.0-beta.11"
|
|
131
131
|
},
|
|
132
132
|
"devDependencies": {
|
|
133
133
|
"@ionic/prettier-config": "^4.0.0",
|