Skip to content

Render: create unbound (inferred number/string) props #270

Description

@nathanacurtis

Remaining work

Props that are not bound to any element (no content/visibility/instanceOf binding) are never created as Figma component properties on render — the whole props: block is missing from round-tripped specs. The reader does not require a binding: an orphan TEXT property with a default value round-trips fine, and inferNumberProps re-types numeric defaults on read.

Approach

In Props.apply(), after the bound-type pass, create a plain TEXT property for unbound string/number props (stringified default/example as the Figma default value). Skip code-only, slot, and variant props as today. Number-guard fixtures (notANumberParens, notANumberVersion) must stay strings — inference is read-side.

Affected fixtures

testNumberProp, testPropExamples

Verification

Round-trip diffs show the props blocks restored with correct types on the fixtures above.

Where (code)

  • specs-from-figma/packages/figma-from-specs/src/Props/Props.tsapply() (bound-type loop + the unbound skip), inferBoundTypes(), textDefault()
  • Reader counterpart (no binding required): specs-from-figma/packages/specs-from-figma/src/Component/Props/Props.ts (numeric re-typing per ADR-029 / inferNumberProps)

Shared verification loop and working context: see parent #208.

Metadata

Metadata

Assignees

Labels

generatorspecs-from-figma processing engine

Type

No type

Projects

Status
Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions