During CI execution on #19923 (job/118770140013), test/playwright/e2e/core/DistEsmWorkspaceBoot.spec.mjs:186:5 (the same workspace boots from source, where HtmlTemplateProcessor parses the template at runtime) failed with:
Live latest-open sweep: checked latest 20 open issues in neomjs/neo (sort: 'created') at 2026-10-20T18:21:45Z; no equivalent found.
A2A in-flight claim sweep: checked latest 30 messages (status: 'all') at 2026-10-20T18:21:50Z; no competing claim found.
Memory Core rationale & own-assignment sweeps: queried DeltaUpdates changeNodeName updateNode nodeName textContent clone replaceChild (surfaced original changeNodeName implementation in #8597 / #8598 / #8600) and checked open assigned issues (0 in neomjs/neo).
The Problem
When a single VDom updateNode delta changes both nodeName and any property ordered after nodeName on Neo.vdom.VNode (scrollLeft, scrollTop, style, innerHTML, or textContent), the properties after nodeName are applied to the detached old DOM element instead of the newly created replacement element in the live DOM.
In DistEsmWorkspaceBoot.spec.mjs:186, Greeting (Neo.functional.component.Base with enableHtmlTemplates: true) dynamically imports HtmlTemplateProcessor.mjs in initAsync(). When Viewport's initial mount completes before import('./HtmlTemplateProcessor.mjs') resolves, Greeting mounts its placeholder {id: 'neo-functional-component-1'} (<div id="neo-functional-component-1"></div>). Once HtmlTemplateProcessor.mjs loads, afterSetIsReady(true, false) re-runs vdomEffect and emits a single updateNode delta:
node is resolved to <div id="neo-functional-component-1">.
case 'cls' adds greeting to node.classList.
case 'nodeName' calls me.changeNodeName(node, 'p'), which creates clone = document.createElement('p'), copies attributes (class="greeting", id="neo-functional-component-1") and existing child nodes onto clone, and executes node.parentNode.replaceChild(clone, node) — without returning clone or updating node in updateNode.
case 'textContent' executes node.textContent = 'Hello, workspace!' on the detached <div> (node), leaving <p class="greeting" id="neo-functional-component-1"></p> empty in the live DOM.
The Architectural Reality
Design authority:src/main/DeltaUpdates.mjs:857-858 — "Updates various properties of an existing DOM node based on the provided delta. This includes updating attributes, class names, inner HTML, node name, and inline styles."
Neo.vdom.VNode (src/vdom/VNode.mjs:94-111) assigns attributes, className, nodeName, scrollLeft, scrollTop, style, and innerHTML / textContent in that exact property order.
Neo.vdom.Helper#compareAttributes (src/vdom/Helper.mjs:76-198) iterates Object.keys(vnode) in VNode property order, so nodeName always precedes scrollLeft, scrollTop, style, innerHTML, and textContent in the emitted delta object, and any caller passing a delta where nodeName precedes attributes or cls would similarly lose those mutations if node is not updated to the replacement element.
The Fix
In src/main/DeltaUpdates.mjs:
Update changeNodeName(node, nodeName) (:157-198) to return clone (the newly created replacement HTMLElement, or null if !node).
Update updateNode(delta) (:915-917) to assign node = me.changeNodeName(node, value) so all subsequent property mutations in the same updateNode loop (textContent, innerHTML, style, scrollLeft, scrollTop, cls, attributes) operate on the live replacement element in the DOM.
Add a Playwright unit test verifying that DeltaUpdates#updateNode with {id, cls, nodeName, style, textContent} (and {id, nodeName, innerHTML, attributes}) applies every property to the replaced live DOM element rather than the detached old element.
Returns the newly created replacement HTMLElement (clone) after replaceChild(clone, node)
Returns null when node is falsy
JSDoc @returns {HTMLElement|null} on changeNodeName
Playwright unit test in test/playwright/unit/
Neo.main.DeltaUpdates#updateNode(delta)
src/main/DeltaUpdates.mjs:872-946
Rebinds node = me.changeNodeName(node, value) on case 'nodeName' so subsequent keys in delta mutate the live replacement element
Unchanged when delta.nodeName is absent
JSDoc on updateNode
Playwright unit test in test/playwright/unit/
Decision Record impact:none (bugfix restoring DeltaUpdates#updateNode contract when nodeName and content/style properties co-occur in one delta).
Acceptance Criteria
AC-1:Neo.main.DeltaUpdates#changeNodeName(node, nodeName) returns the newly created HTMLElement (clone) that replaced node in node.parentNode.
AC-2:Neo.main.DeltaUpdates#updateNode(delta) updates its node reference to the return value of me.changeNodeName(node, value) so properties processed after nodeName in the same delta (textContent, innerHTML, style, scrollLeft, scrollTop, cls, attributes) land on the live replacement element in the DOM.
AC-3: Unit test coverage verifies that an updateNode delta combining nodeName with cls, style, attributes, and textContent / innerHTML leaves all properties present on the live DOM element after replacement.
Out of Scope
Changing Neo.functional.component.Base#initAsync lazy-loading of HtmlTemplateProcessor.mjs.
Changing Neo.vdom.VNode property ordering.
Related
Surfaced on #19923 (DistEsmWorkspaceBoot.spec.mjs:186:5)
Context
During CI execution on
#19923(job/118770140013),test/playwright/e2e/core/DistEsmWorkspaceBoot.spec.mjs:186:5(the same workspace boots from source, where HtmlTemplateProcessor parses the template at runtime) failed with:Locator: locator('p.greeting') Expected: "Hello, workspace!" Received: "" 10 × locator resolved to <p class="greeting" id="neo-functional-component-1"></p>neomjs/neo(sort: 'created') at2026-10-20T18:21:45Z; no equivalent found.status: 'all') at2026-10-20T18:21:50Z; no competing claim found.DeltaUpdates changeNodeName updateNode nodeName textContent clone replaceChild(surfaced originalchangeNodeNameimplementation in#8597/#8598/#8600) and checked open assigned issues (0inneomjs/neo).The Problem
When a single VDom
updateNodedelta changes bothnodeNameand any property ordered afternodeNameonNeo.vdom.VNode(scrollLeft,scrollTop,style,innerHTML, ortextContent), the properties afternodeNameare applied to the detached old DOM element instead of the newly created replacement element in the live DOM.In
DistEsmWorkspaceBoot.spec.mjs:186,Greeting(Neo.functional.component.BasewithenableHtmlTemplates: true) dynamically importsHtmlTemplateProcessor.mjsininitAsync(). WhenViewport's initial mount completes beforeimport('./HtmlTemplateProcessor.mjs')resolves,Greetingmounts its placeholder{id: 'neo-functional-component-1'}(<div id="neo-functional-component-1"></div>). OnceHtmlTemplateProcessor.mjsloads,afterSetIsReady(true, false)re-runsvdomEffectand emits a singleupdateNodedelta:{ cls : {add: ['greeting']}, nodeName : 'p', textContent: 'Hello, workspace!', id : 'neo-functional-component-1' }In
Neo.main.DeltaUpdates#updateNode:nodeis resolved to<div id="neo-functional-component-1">.case 'cls'addsgreetingtonode.classList.case 'nodeName'callsme.changeNodeName(node, 'p'), which createsclone = document.createElement('p'), copies attributes (class="greeting",id="neo-functional-component-1") and existing child nodes ontoclone, and executesnode.parentNode.replaceChild(clone, node)— without returningcloneor updatingnodeinupdateNode.case 'textContent'executesnode.textContent = 'Hello, workspace!'on the detached<div>(node), leaving<p class="greeting" id="neo-functional-component-1"></p>empty in the live DOM.The Architectural Reality
src/main/DeltaUpdates.mjs:857-858— "Updates various properties of an existing DOM node based on the provided delta. This includes updating attributes, class names, inner HTML, node name, and inline styles."Neo.vdom.VNode(src/vdom/VNode.mjs:94-111) assignsattributes,className,nodeName,scrollLeft,scrollTop,style, andinnerHTML/textContentin that exact property order.Neo.vdom.Helper#compareAttributes(src/vdom/Helper.mjs:76-198) iteratesObject.keys(vnode)inVNodeproperty order, sonodeNamealways precedesscrollLeft,scrollTop,style,innerHTML, andtextContentin the emitteddeltaobject, and any caller passing a delta wherenodeNameprecedesattributesorclswould similarly lose those mutations ifnodeis not updated to the replacement element.The Fix
src/main/DeltaUpdates.mjs:changeNodeName(node, nodeName)(:157-198) to returnclone(the newly created replacementHTMLElement, ornullif!node).updateNode(delta)(:915-917) to assignnode = me.changeNodeName(node, value)so all subsequent property mutations in the sameupdateNodeloop (textContent,innerHTML,style,scrollLeft,scrollTop,cls,attributes) operate on the live replacement element in the DOM.DeltaUpdates#updateNodewith{id, cls, nodeName, style, textContent}(and{id, nodeName, innerHTML, attributes}) applies every property to the replaced live DOM element rather than the detached old element.Contract Ledger
Neo.main.DeltaUpdates#changeNodeName(node, nodeName)src/main/DeltaUpdates.mjs:157-198HTMLElement(clone) afterreplaceChild(clone, node)nullwhennodeis falsy@returns {HTMLElement|null}onchangeNodeNametest/playwright/unit/Neo.main.DeltaUpdates#updateNode(delta)src/main/DeltaUpdates.mjs:872-946node = me.changeNodeName(node, value)oncase 'nodeName'so subsequent keys indeltamutate the live replacement elementdelta.nodeNameis absentupdateNodetest/playwright/unit/none(bugfix restoringDeltaUpdates#updateNodecontract whennodeNameand content/style properties co-occur in one delta).Acceptance Criteria
Neo.main.DeltaUpdates#changeNodeName(node, nodeName)returns the newly createdHTMLElement(clone) that replacednodeinnode.parentNode.Neo.main.DeltaUpdates#updateNode(delta)updates itsnodereference to the return value ofme.changeNodeName(node, value)so properties processed afternodeNamein the same delta (textContent,innerHTML,style,scrollLeft,scrollTop,cls,attributes) land on the live replacement element in the DOM.updateNodedelta combiningnodeNamewithcls,style,attributes, andtextContent/innerHTMLleaves all properties present on the live DOM element after replacement.Out of Scope
Neo.functional.component.Base#initAsynclazy-loading ofHtmlTemplateProcessor.mjs.Neo.vdom.VNodeproperty ordering.Related
#19923(DistEsmWorkspaceBoot.spec.mjs:186:5)changeNodeNamework:#8597,#8598,#8600Origin Session ID: 2d742cad-83f2-415e-a6f1-12dc4a906d85 Retrieval Hint: "DeltaUpdates updateNode changeNodeName detached node textContent HtmlTemplateProcessor DistEsmWorkspaceBoot"