@sigx/lynx-runtime-main 0.4.6 → 0.4.8
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/ops-apply.js +29 -0
- package/package.json +2 -2
package/dist/ops-apply.js
CHANGED
|
@@ -213,6 +213,35 @@ export function applyOps(ops) {
|
|
|
213
213
|
__SetAttribute(el, 'text', text);
|
|
214
214
|
break;
|
|
215
215
|
}
|
|
216
|
+
case OP.INVOKE_UI_METHOD: {
|
|
217
|
+
const id = ops[i++];
|
|
218
|
+
const method = ops[i++];
|
|
219
|
+
const rawParams = ops[i++];
|
|
220
|
+
// The ops array is decoded wire data — coerce anything that isn't a
|
|
221
|
+
// plain key/value object (null, primitives, arrays) to {} rather
|
|
222
|
+
// than letting the host widget crash on it.
|
|
223
|
+
const params = rawParams !== null
|
|
224
|
+
&& typeof rawParams === 'object'
|
|
225
|
+
&& !Array.isArray(rawParams)
|
|
226
|
+
? rawParams
|
|
227
|
+
: {};
|
|
228
|
+
const el = elements.get(id);
|
|
229
|
+
// Fire-and-forget: used for imperative element state that attributes
|
|
230
|
+
// can't reach (e.g. <input> setValue after the user has edited the
|
|
231
|
+
// field — the value attribute is initial-only there, see #143).
|
|
232
|
+
// Failures (method unknown to the host widget, element not yet
|
|
233
|
+
// attached) are intentionally swallowed — there is no BG-side caller
|
|
234
|
+
// awaiting a result. The try/catch covers hosts that throw
|
|
235
|
+
// synchronously instead of reporting via the callback, so one bad
|
|
236
|
+
// invoke can't abort the rest of the ops batch.
|
|
237
|
+
if (el && typeof __InvokeUIMethod === 'function') {
|
|
238
|
+
try {
|
|
239
|
+
__InvokeUIMethod(el, method, params, () => { });
|
|
240
|
+
}
|
|
241
|
+
catch { /* swallow — see above */ }
|
|
242
|
+
}
|
|
243
|
+
break;
|
|
244
|
+
}
|
|
216
245
|
case OP.SET_EVENT: {
|
|
217
246
|
const id = ops[i++];
|
|
218
247
|
const eventType = ops[i++];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sigx/lynx-runtime-main",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.8",
|
|
4
4
|
"description": "Main Thread (Lepus) entry and ops applier for SignalX Lynx renderer",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"url": "https://github.com/signalxjs/lynx/issues"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@sigx/lynx-runtime-internal": "0.4.
|
|
45
|
+
"@sigx/lynx-runtime-internal": "0.4.8"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"@lynx-js/types": ">=3.0.0"
|