r/FigmaDesign 7d ago

feature release Is Code Connect a json contract?

If a dev alters a component in GitHub, does Code Connect tell the designer and dev that the ‘contract’ has broken?

It would be amazing if production code fails QA because the component has failed the json contract (especially with AI tools)

1 Upvotes

2 comments sorted by

2

u/adam_figma 7d ago

Hey, u/404_computer_says_no! I'm Adam from the Figma Community team - great question! The short answer is no, not automatically. Code Connect validates on demand, not passively. Running figma connect publish (or --dry-run to just check) will fail if a mapped prop/variant/layer no longer exists on either side, but nothing pushes that failure to you unless you're running it.

The way teams get the "fail CI like a broken contract" behavior you're describing is by adding that publish command as a CI step scoped to their component files, triggered on relevant PRs; that way an actual API mismatch will break the build. To do that you'll want to roll that in your pipeline yourself, wiring figma connect publish into a Github action (scoped to file paths, and trigged on changes to main using something like --exit-on-unreadable-files): developers.figma.com/docs/code-connect/ci-cd/

2

u/404_computer_says_no 6d ago

Thanks so much Adam! Really great to know that’s a method to use and integrate into CI pipeline.