Objective
Enable a "silent" VNode creation mode where the VDOM worker can create VNodes without calculating deltas or triggering autoMount/updateVdom events.
Problem
In the current Neo.worker.Manager implementation, onWorkerMessage unconditionally calls promiseForwardMessage if data.data exists. This pauses execution until resolveDomOperationPromise is called.
However, resolveDomOperationPromise is typically triggered by automount or updateVdom event listeners. If neither autoMount nor updateVdom is true (as in the manual/silent VNode creation case), no event is fired, the promise is never resolved, and the message forwarding hangs indefinitely (deadlock).
Solution
Modify src/worker/Manager.mjs inside onWorkerMessage to conditionally use promiseForwardMessage. It should only be used if autoMount or updateVdom is true, indicating a DOM operation that needs to be waited on. Otherwise, the message should be forwarded immediately.
Implementation Details
if (!promise) {
if (data.data) {
if (data.data.autoMount || data.data.updateVdom) {
data.data.autoMount && me.fire('automount', data);
data.data.updateVdom && me.fire('updateVdom', data);
me.promiseForwardMessage(data).then(msgData => {
me.sendMessage(msgData.destination, msgData)
})
} else {
me.sendMessage(dest, data)
}
}
}
This logic has already been verified in src/worker/Manager.mjs. This ticket tracks the formal acceptance and documentation of this capability.
Objective
Enable a "silent" VNode creation mode where the VDOM worker can create VNodes without calculating deltas or triggering
autoMount/updateVdomevents.Problem
In the current
Neo.worker.Managerimplementation,onWorkerMessageunconditionally callspromiseForwardMessageifdata.dataexists. This pauses execution untilresolveDomOperationPromiseis called. However,resolveDomOperationPromiseis typically triggered byautomountorupdateVdomevent listeners. If neitherautoMountnorupdateVdomis true (as in the manual/silent VNode creation case), no event is fired, the promise is never resolved, and the message forwarding hangs indefinitely (deadlock).Solution
Modify
src/worker/Manager.mjsinsideonWorkerMessageto conditionally usepromiseForwardMessage. It should only be used ifautoMountorupdateVdomis true, indicating a DOM operation that needs to be waited on. Otherwise, the message should be forwarded immediately.Implementation Details
if (!promise) { if (data.data) { if (data.data.autoMount || data.data.updateVdom) { data.data.autoMount && me.fire('automount', data); data.data.updateVdom && me.fire('updateVdom', data); // We want to delay the message until the rendering queue has processed it // See: https://github.com/neomjs/neo/issues/2864 me.promiseForwardMessage(data).then(msgData => { me.sendMessage(msgData.destination, msgData) }) } else { me.sendMessage(dest, data) } } }This logic has already been verified in
src/worker/Manager.mjs. This ticket tracks the formal acceptance and documentation of this capability.