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

Abierto
#11,086 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
56/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
typescript

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
TypeScript
Estrellas
16.7k
Forks
808
Merge medio
21 h 22 min
PR fusionados (30 d)
486

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Effect-TS/effect

Todos los issues de Effect-TS/effect

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.