[LayerNext 3] Make layer prop and presentation updates predictable

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

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

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

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
react, typescript
領域
frontend

調査の方向性

Start by reading the LayerNext implementation, the useLayer React integration, and the related strict-readiness work in #364 and #365. Identify how constructor resources, presentation props, graph/layer replacement, attach/detach cleanup, and consumer fixtures are structured before choosing signatures or reset semantics. Done means supported updates affect the existing live layer without resource recreation or duplicate subscriptions, immutable options are rejected or clearly unsupported, and source, packed consumer, runtime, and migration checks cover the stated lifecycle cases.

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

説明

Parent: #373. Status: deferred. Target branch: v2.

Dependencies: #374, #375. Coordinate addon defaults with #364 and #365; do not duplicate their strict-readiness work.

Problem

A layer can receive setProps updates, but resources created in its constructor do not automatically reflect new classes, zIndex or dimensions. Some addons capture values only during construction. User props and Canvas creation options share an object even though their update capabilities differ.

Scope

  • Define a typed public updateProps(patch) operation for LayerNext that updates the existing instance.
  • Separate mutable user/presentation props from immutable resource creation options, such as 2D context attributes. Document unsupported mutations explicitly instead of silently ignoring them.
  • Define defaults, omitted/undefined values, object/array replacement and reset semantics before implementation. Reuse the established v2 settings policy where appropriate; do not invent a separate reset API without a demonstrated need.
  • Normalize defaulted values into complete runtime values while keeping consumer input partial/optional where appropriate.
  • Apply supported common presentation updates to the actual DOM/canvas and schedule redraws. Preserve declared resources and listeners during ordinary prop updates.
  • Ensure React useLayer updates the current live layer without recreating it or sending updates to a disposed/replaced instance.

Acceptance criteria

  • Source and packed consumer fixtures reject invalid patch keys/values and preserve custom generic prop inference.
  • Updating one prop preserves unrelated defaults and values; omitted and undefined values follow the documented policy.
  • Supported class/zIndex/size changes affect the existing elements and rendering, with no duplicated subscriptions or resource recreation.
  • Immutable creation options cannot appear to succeed while leaving the original resource unchanged.
  • React updates follow the active instance across graph/layer replacement and cleanup.
  • Runtime and consumer checks cover updates before attach, while attached and after detach; migration docs and strict checks remain current.

The exact update/reset signatures and list of mutable common options are design decisions for this future issue.

主要言語
TypeScript
スター
145
フォーク
12
平均マージ
1日 14時間
マージ済み PR(30日)
43

環境構築

はじめの一歩

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

gravity-ui/graph のほかの issue

gravity-ui/graph の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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