Skip to content

Render: instance elements are skipped when the subcomponent is missing from the instance manifest #276

Description

@nathanacurtis

Found while verifying #259 across the specs-testing render round-trip corpus.

Symptom: rendering a spec whose elements reference a subcomponent by name drops those elements entirely when the name has no entry in the instance manifest. The render still reports success — the only signal is a console warning:

⚠ [writer] instance element "dsButton": no manifest entry for "dsButton" — skipping
⚠ [writer] instance element "instance1": no manifest entry for "laidOutComponent" — skipping
⚠ [writer] instance element "instance2": no manifest entry for "laidOutComponent" — skipping

Everything on the skipped node is lost with it — sizing, dimensions, propConfigurations — so the round-trip reads as broad fidelity loss that is really one missing lookup.

Reach: 3 fixtures in the current corpus.

  • testStylesSizing (dsButton)
  • testElementsNestedInstances (dsButton)
  • testElementsNestedInstancesLayout (instance1, instance2laidOutComponent)

Where: the manifest lookup in Elements.createChild bails before any node is created, so no sizing or style code is involved.

Notes:

  • A silent success is the worst part — the render exits 0 and the loss surfaces only on a diff.
  • Worth deciding whether a missing manifest entry should fail the render, or resolve the subcomponent on demand the way Component.write already writes subcomponents before their dependents.

Verification: round-trip the three fixtures above; their instance elements must survive with sizing intact.

Part of #204.

Metadata

Metadata

Assignees

No one assigned

    Labels

    generatorspecs-from-figma processing engine

    Type

    No type

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions