LearnNewsExamplesServices
Frontmatter
id5518
titlevdom.Helper: createDeltas() => add support for replacing a node with an array of child nodes
stateClosed
labels
bug
assigneestobiu
createdAtJul 3, 2024, 3:59 PM
updatedAtJul 3, 2024, 7:23 PM
githubUrlhttps://github.com/neomjs/neo/issues/5518
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJul 3, 2024, 7:23 PM

vdom.Helper: createDeltas() => add support for replacing a node with an array of child nodes

Closed v8.1.0 bug
tobiu
tobiu commented on Jul 3, 2024, 3:59 PM

This is a mix of a bug report and a feature request.

The engine can handle moving a child node upwards inside the DOM tree => replacing a parent.

example:

old tree:

div id="level-1"
    div id="level-2"
        div id="level-3"

new tree:

div id="level-1"
    div id="level-3"

In this case we get a delta telling "level-3" to replace "level-2". all good.

What does not work: old tree:

div id="level-1"
    div id="level-2"
        div id="level-3-1"
        div id="level-3-2"

new tree:

div id="level-1"
    div id="level-3-1"
    div id="level-3-2"

In this case we get the same delta as before: "level-3-1" will replace "level-2" and all other siblings "level-3-x" will get lost.

The desired output would be to move all "level-3-x" nodes into the parentNode "level-1" and then delete the node "level-2".

We need it for layout.Cube, in case we want to switch the owner container to a different layout (e.g. VBox). We might need this one for the Portal App.

I will write a breaking Siesta Test first, then take a look into the engine. If there is not an easy (and not too expensive performance wise) way to fix it, I will do it.

Otherwise we could manually create the desired deltas.

tobiu added the bug label on Jul 3, 2024, 3:59 PM
tobiu assigned to @tobiu on Jul 3, 2024, 3:59 PM
tobiu referenced in commit 7ed8782 - "#5518 Siesta test cases: on Jul 3, 2024, 5:20 PM
tobiu cross-referenced by #5517 on Jul 3, 2024, 5:33 PM
tobiu referenced in commit 5cda40c - "vdom.Helper: createDeltas() => add support for replacing a node with an array of child nodes #5518" on Jul 3, 2024, 6:25 PM
tobiu referenced in commit 1bbb0fd - "#5518 on Jul 3, 2024, 7:23 PM
tobiu
tobiu Jul 3, 2024, 7:23 PM

Screenshot 2024-07-03 at 19 22 52

tobiu closed this issue on Jul 3, 2024, 7:23 PM