Skip to content

[Roadmap] Declarative Two.js web-scene feature parity #35

Description

@jonobr1

Goal

Track the remaining work required for a React application to reproduce a Two.js web scene declaratively and keep it correct through React updates.

This roadmap treats imperative access through useTwo() and refs as an escape hatch, not as proof that the React surface is complete.

Definition of feature complete

  • A representative Two.js scene can be expressed without manual parent.add(...) calls.
  • React remains authoritative after prop changes, prop removal, child reorder, reparenting, and unmount.
  • Masks, gradients, texture-backed objects, imported SVG, and custom/existing objects have lifecycle-safe declarative paths.
  • SVG, Canvas, and WebGL accept the documented configuration and produce equivalent scene structure where Two.js supports it.
  • Pointer targeting follows the rendered scene graph.
  • Every exported component has checked property and lifecycle coverage.

Foundation

Scene relationships and resources

Object coverage and escape hatches

Canvas and importing

Interaction correctness

Follow-on React ergonomics

These are valuable but are not blockers for core Two.js web-scene parity:

React Native is a separate renderer/platform initiative and remains tracked independently in #6.

Already delivered

Recommended sequence

  1. Land [Parity] Reconcile the Two.js scene graph with React updates #29 first because ordering, ownership, replacement, and cleanup affect most later work.
  2. Complete property coverage ([Parity] Complete declarative prop coverage for Two.js objects #30) alongside mask semantics (Feature Request: Add useClipMask hook for declarative clipping masks #9).
  3. Build resource composition ([Parity] Add declarative gradient stops and resource composition #31) and async texture loading (Feature Request: Add useTexture hook for async texture loading with states #12) on the shared lifecycle.
  4. Finish Canvas/import correctness ([Bug] Normalize Canvas renderer aliases and define constructor-prop updates #32 and [Bug] Finish <SVG> shallow loading and lifecycle semantics #8).
  5. Add Arc and the generic escape hatch (Feature Request: Add Arc component for open arc shapes #10 and [Parity] Add a Primitive escape hatch for existing and custom Two.js objects #33).
  6. Complete interaction parity in [Bug] Align pointer events with Two.js coordinates and scene order #34 against the reconciled scene graph.

Non-goals

  • Restoring the removed Canvas.container prop. The current styling API is intentional.
  • Requiring helper/gizmo or React Native work before declaring core web scene parity.
  • Wrapping every Two.js method as JSX when useTwo() or refs are the appropriate advanced API.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions