@effect/ui: expose node-to-component ownership lookup for custom renderers

Aperta
#11,086 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
56/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
typescript

Direzione di ricerca

Start from the custom Renderer.Host and the browser picker’s BrowserHost.instanceAt implementation referenced in the issue, then trace how mounted nodes map to component instances and how unmounting clears that ownership. Add a non-DOM host test with two keyed Counter children: looking up the second button should return its child instance, and looking up its node after unmount should return no owner.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

What is the problem this feature would solve?

In our AppKit inspector, clicking a native control should show the model and last update of the component instance that rendered it. AppKit tells us which view was clicked, and MessageLog tells us which instances updated. The missing link is going from the host node to its owning instance in that session.

Effect-TS/ui#465 solved this for DOM nodes with BrowserHost.instanceAt(root, node). In the UI revision checked we couldn't find an equivalent public lookup for a custom Renderer.Host.

What is the feature you are proposing to solve the problem?

Expose a read-only lookup for a mounted root and a host node. The result should identify the owning instance so tools can correlate it with MessageLog, using the same ownership rules as the browser picker. Hit testing and inspector UI can stay in the host.

A concrete acceptance case:

  1. Mount two keyed Counter children in a non-DOM host, each rendering a button titled Count: 0.
  2. Look up the second button's node. The result should identify the second child, not its sibling or the root.
  3. Unmount that child and look up the old node. It should have no owner.
What alternatives have you considered?

Our inspector walks private renderer records. This works, but makes the integration sensitive to internal changes. Walking the native view hierarchy alone isn't enough: it records layout, not which Effect component authored a node.

Lingua principale
TypeScript
Stelle
16.7k
Fork
808
Merge medio
21h 22m
PR unite (30g)
486

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Effect-TS/effect

Tutte le issue di Effect-TS/effect

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.