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

オープン
#11,086 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
56/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
typescript

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
TypeScript
スター
16.7k
フォーク
808
平均マージ
21時間 22分
マージ済み PR(30日)
486

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Effect-TS/effect のほかの issue

Effect-TS/effect の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。