Skip to content

Redesign NGSwitchComponent as dynamic component references — keyed, not path-faked #47

Open

Description

@hugithordarson
No description provided.

Activity

  1. converted this from a draft issue on Mar 26, 2023
  2. moved this from Todo to Testing in ng-objects-0.1.0on Mar 26, 2023
  3. added this to the 0.1.0 milestone on Apr 16, 2023
  4. changed the title [-]Implement SwitchComponent[/-] [+]Redesign NGSwitchComponent as dynamic component references — keyed, not path-faked[/+] on Aug 22, 2026
  5. hugithordarson commented on Aug 22, 2026

    @hugithordarson
    CollaboratorAuthor

    Repurposing this issue (2026-08-22): the switch component exists (NGSwitchComponent, based on ERXWOSwitchComponent) — what remains is fixing its design.

    The mechanism today is elementID path-faking: each distinct component name is assigned a number on first use, and the switch fakes a structural elementID branch (addBranchAndSet) around every phase to keep per-case component instances and senderIDs apart. Two problems with that:

    1. ID minting had a check-then-act race — fixed in 760de94 (atomic minting via computeIfAbsent).
    2. IDs are minted in first-encounter order, so the name→ID mapping is traffic-dependent across JVM restarts and app instances. Harmless today only because sessions are in-memory; becomes silent wrong-component action dispatch under persistent sessions (Session resurrection: framework support for rebuilding sessions across restarts #49) or cross-instance session sharing. Documented in a FIXME on the field.

    The redesign: dynamic component names should be a capability of the component reference itself (<wo:component name="$componentName">), with per-case child instances kept apart by keying, not path-faking — the child-instance key becomes (elementID, resolved name) instead of a mutated elementID path. That removes the global name→ID registry, the ordering dependence, and the element-level mutable state in one stroke. Composes with the action-references/render-receipts direction, under which elementID-stability tricks stop mattering entirely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions