Skip to content

Replace double-casts with honest derived types in the render engine #332

Description

@nathanacurtis

Problem

Sixteen call sites coerce values through blanket double-casts, hiding real shape differences between spec types and erasing type safety exactly where the render engine meets the canvas API.

Solution

Each cast is replaced with an honest derived type or a narrow typed helper — small declared interfaces for canvas API gaps, derived types for spec-shape differences — so the compiler verifies what each call site actually relies on.

Acceptance criteria

  • No double-casts remain in the package
  • Spec-shape differences are modeled as named derived types

Impacted code

16 sites across packages/figma-from-specs/src/: Component, Styles primitives/composites, Elements, Effects, Subcomponents.


Implementation details are tracked internally.

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions