Skip to content

Stable keys for text content? (And possibly any figma node and other things?) #194

Open
@cixzhang

Description

@cixzhang

Hey, I'm working on Meta's internal design system with @vjeux.

We have a large number of components to connect and our system is in continuous development so one concern we have is around the stability of our code connect definitions and how to keep figma and code in sync while preserving our ability to work efficiently in a large system.

At the moment, the way we connect code to figma involves:

  • text describing the contents of a figma text node for figma.textContent
  • text describing the "name" of a figma node/instance for figma.children and figma.instance
  • a node id pointing to the component set which is unclear how stable that id would remain over time

The textContent worries me the most since this text content is visible in how the components present to our users in figma so it's a user-readable string and can change if we decide on better content to show later on. I don't know if there's a good way to assign some stable key to a textContent node that is not as likely to change.

For figma nodes and instances, they're by the "name" of the node which isn't part of how components present to our users so it's more likely these can remain stable, but if there's a clear way to retrieve nodes and textContent by stable key, it could be possible for us to codegen more of our code connections and have designers make updates in figma to assign stable keys to the right nodes.

What if we allow designs to annotate their nodes in figma with stable keys? If designers make updates later to restructure/improve our figma components, it would be less likely for our code connections to become unstable.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions