[v2 DX] Introduce LayerNext and migrate the layer authoring API
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 28/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- react, typescript
Hướng nghiên cứu
Start with #374, then review #375 and #376 for the shared hosting, resource, lifecycle, and update contracts; #377 covers built-in migration, documentation, and public exports. Read the proposed LayerNext contract and its lifecycle tests before changing registration or React inference. Done means both layer models coexist, the tested resource and lifecycle semantics are explicit, built-ins and examples are migrated, migration docs are updated, and the listed strict, declaration, consumer, and CI checks pass.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Status and intent
Deferred design/implementation work. Capture the Layer DX proposal now and return to it later; do not expand the current strict-TypeScript PR or make this a prerequisite for the existing strict migration track.
Target branch: v2. Breaking layer contracts are possible before the v2 API is stabilized.
Related: #353 (strict TypeScript), #358 / #372 (current resource and lifecycle fixes), #360 (constructor/descriptor types), #363 (React inference), #364 and #365 (addon strict readiness). Reuse those improvements rather than duplicating their work.
Goal
Make custom layers straightforward to author, type, update and dispose. During development, allow the existing Layer and a new LayerNext to coexist so built-in layers can migrate incrementally.
Agreed direction
- Keep the existing
Layeroperational during the transition. - Introduce
LayerNextwith its own author-facing contract; it must not inherit the oldLayerprops/lifecycle API. - Both models share an internal hosting mechanism for registration, rendering and resource ownership. Avoid maintaining two divergent engines.
- Graph registration and React integration accept both models and preserve custom props and concrete instance/ref inference.
- Move built-in layers and examples incrementally, with migration documentation.
Proposed new-model contract to refine before implementation
- User props are separate from graph/camera/root dependencies and resource creation options.
- Canvas-only, HTML-only, combined and resource-free modes express available resources accurately. A canvas mode provides a checked drawing context without user context assertions. Exact public syntax is a design decision for the first task; do not assume additional public layer classes are required.
canvasconsistently means the layer's own canvas. Obtain the main graph canvas explicitly through the graph API rather than changing the meaning ofcontext.graphCanvasbetween subclasses.- Attachment and permanent disposal have distinct semantics. Author hooks do not require calls to
superor run from a base constructor before derived fields initialize. - Attach-scoped subscriptions, DOM resources and scheduled work have automatic cleanup; disposal also releases children and instance-lifetime resources.
- Mutable props and immutable resource creation options have documented update semantics.
LayerNext is a transition name, not a commitment to two permanent public APIs. The proposed pre-release endpoint is to promote the new model to Layer and remove the old one; confirm release exports and migration timing before that final step.
Acceptance criteria
- Both layer models work together throughout the transition without changing existing registration unexpectedly.
- Custom props and concrete methods/refs are inferred in core and React, including generic custom classes.
- Resource availability, attach/detach/reattach and permanent disposal have explicit, tested contracts.
- Built-ins and examples demonstrate the new DX and the migration guide explains breaking changes.
- Strict source/declaration checks, packed consumer contracts and required CI remain green after each independently mergeable PR.
- The final public exports and retirement of the transition API are decided explicitly before release.
Work items and delivery order
- #374 — Shared hosting, typed resources and authoring/registration contracts.
- #375 — Attach scopes, cleanup and permanent disposal (after #374).
- #376 — Predictable prop/presentation updates (after #374 and #375).
- #377 — Incremental built-in migration, docs and final public exports (after #374–#376).
- Ngôn ngữ chính
- TypeScript
- Star
- 145
- Fork
- 12
- Merge trung bình
- 1 ngày 14 giờ
- Pull request đã merge (30 ngày)
- 43
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của gravity-ui/graph
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
gravity-ui/graph#457 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
gravity-ui/graph#455 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
gravity-ui/graph#456 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
gravity-ui/graph#431 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
proposal
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
gravity-ui/graph#416 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của gravity-ui/graph
Issue tương tự
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
openclaw/openclaw#199885 · 2 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
feature needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
BoardGamesEmpire/board-games-empire-backend#1306 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
sequant-io/sequant#1689 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100