Skip to content

Remove the $extensions.com.figma.imageHash fallback from transform image resolution #365

Description

@nathanacurtis

Problem

Transform output for React, Web Components, and CSS still reads a Figma-specific extension field to resolve images. When an images-registry entry has no resolved src, all three transforms fall back to $extensions.com.figma.imageHash and match a file in _images/. That makes transform output dependent on where the spec came from, rather than on the spec's own portable data.

Solution

The images registry always carries a resolvable src, so the hash fallback — and the type declarations that exist only to support it — can be deleted. Transform output then reads no com.figma extension data at all.

Problems

  • The same fallback is mirrored in three places, so it can drift independently
  • Type declarations exist solely to make the extension read type-check
  • A spec authored outside Figma has no imageHash, so image resolution silently depends on provenance

Acceptance criteria

  • Image resolution in the React, Web Components, and CSS transforms reads only the images-registry src
  • No transform code path reads $extensions.com.figma
  • Extension-only type declarations are removed
  • Components with image fills transform with correct asset paths

Impacted code

  • react-from-specsSpec/composition.ts (image resolution + type declaration)
  • webcomponents-from-specsSpec/composition.ts (same)
  • specs CLI — transforms/Css.ts (same), transforms/examples.ts (type declaration)

Notes

Audit finding: this is the only remaining com.figma dependency across the transforms. Nothing else — no variant, prop, layout, or naming logic — touches it. The fallback is the ADR-063 image-support path, and is pre-existing rather than newly introduced.


Implementation details are tracked internally.

Activity

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

Metadata

Metadata

Assignees

Labels

react-from-specsTransformer from specs into React code

Type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions