---
name: Code Connect
slug: figma-code-connect
type: github
source_url: https://github.com/figma/code-connect
changelog_url: https://github.com/figma/code-connect/blob/HEAD/CHANGELOG.md
organization: Figma
organization_slug: figma
total_releases: 51
latest_version: v2.1.0
latest_date: 2026-10-26
last_updated: 2026-11-06
tracking_since: 2024-04-16
canonical: https://releases.sh/figma/figma-code-connect
organization_url: https://releases.sh/figma
---

<Summary type="rolling" window-days="90" release-count="4">
Code Connect shifted toward making template-based workflows smoother and more flexible. The team added `figma.slot()` support for React to map Figma slot properties, shipped a migration script to help teams move from parser-based files to the newer parserless template format, and expanded branch detection to handle non-standard default branch names beyond `master` and `main`. Along the way, fixes landed for prefix collision bugs in URL substitutions and automatic retry logic for rate-limited publishes.
</Summary>

<Release version="v2.1.0" date="October 26, 2026" published="2026-10-26T16:35:39.000Z" url="https://github.com/figma/code-connect/releases/tag/v2.1.0">
## Code Connect 2.1.0

## Removed

- Removed the interactive setup wizard. Running `figma connect` now shows the available commands. We recommend the [`figma-code-connect` skill](https://github.com/figma/mcp-server-guide/blob/main/skills/figma-code-connect/SKILL.md), included in the Figma plugin for your AI coding agent, as its replacement.

## Fixed

### General

- Parser rejection errors now list matched files that were not recognized as templates, and separately explain when no files matched the configuration.
- CLI network requests now consistently identify the Code Connect package and installed version, making them easier to recognize in network logs.

### Template files

- `findConnectedInstances` and `findLayers` with `traverseInstances: true` now return layers in layer order. Previously, sibling layers were returned in reverse order.
- When more than one layer matches, `findInstance`, `findText` and `findConnectedInstance` with `traverseInstances: true`, and `figma.nestedProps`, now return the first match in layer order.

</Release>

<Release version="v2.0.2" date="October 14, 2026" published="2026-10-14T18:40:49.000Z" url="https://github.com/figma/code-connect/releases/tag/v2.0.2">
## Code Connect 2.0.2

## Features

### General

- Code Connect publishing on Professional plans now confirms the active library and framework when they are first selected. If a publish exceeds the one-library, one-framework limit, the CLI explains the restriction and how a plan admin can change the selection or upgrade.
- `figma connect publish` now sends preflight validation failure counts to Figma. Set `DO_NOT_TRACK=1` to disable this telemetry.

## Fixed

### General

- `figma connect migrate` now leaves existing template files unchanged and reports success when no components need migrating.
- Fixed Code Connect file discovery in project folders whose names contain special characters, while preserving configured file exclusions and project-relative includes with a leading slash.
- Network request failures now include the underlying reason, such as a timeout or a connection error, instead of only showing "fetch failed". Run the command with `--verbose` to see the stack trace.
- `figma connect create` now always generates a parserless template file, including in projects configured for a framework-specific parser. Unsupported output filenames are rejected with guidance to use `.figma.ts` or `.figma.js`.
- JSON output from `figma connect preview` now includes each connection's source file.

### Template files

- Fixed `findLayers` crashing when filtering text layers by parent path, including text inside nested instances.

</Release>

<Release version="v2.0.1" date="September 10, 2026" published="2026-09-10T14:24:37.000Z" url="https://github.com/figma/code-connect/releases/tag/v2.0.1">
## Code Connect 2.0.1

## Fixed

### General

- `figma connect preview` now accepts the template file of a component declared in a `.figma.batch.json` file. Previously it rejected the template path with "Not a valid Code Connect file", so the only way to preview a batch component was to preview every component in the batch file at once.

</Release>

<Release version="v2.0.0" date="August 18, 2026" published="2026-08-18T14:05:22.000Z" url="https://github.com/figma/code-connect/releases/tag/v2.0.0">
## Code Connect 2.0.0

> [!WARNING]
> Framework-specific parsers will no longer receive updates or support. Template files are now the only actively maintained way of using Code Connect. See our migration guide for more information and instructions on migrating parser-based Code Connect:
> https://developers.figma.com/docs/code-connect/templates-migration-guide/

## Breaking changes

- Framework-specific parsers can now only be used by `figma connect migrate` and `figma connect unpublish`. Other commands exit with guidance to migrate parser-based Code Connect to template files. If you wish to continue using framework-specific parsers, install Code Connect v1 with `npm install --save-dev @figma/code-connect@1`.

## Fixed

### General

- Performance optimizations for `figma connect preview`

</Release>

<Release version="v1.5.3" date="August 12, 2026" published="2026-08-12T12:10:47.000Z" url="https://github.com/figma/code-connect/releases/tag/v1.5.3">
## Code Connect 1.5.3

## Fixed

### React

- Fixed rendering of nested arrow function callbacks

## Features

### General

- Adds `figma connect preview <file> --unique`, which is similar to `--all` but hides duplicate outputs.

### Template files

- Added `id` to `InstanceHandle` to expose the instance's Figma node ID. It matches the Plugin API's `SceneNode.id`, including stable paths for nested instance sublayers.

</Release>

<Release version="v1.5.2" date="August 3, 2026" published="2026-08-03T13:16:41.000Z" url="https://github.com/figma/code-connect/releases/tag/v1.5.2">
## Code Connect 1.5.2

## Fixed

- Fixed JavaScript template files authored with `import figma from 'figma'` publishing an unexecutable import.
</Release>

<Release version="v1.5.0" date="July 29, 2026" published="2026-07-29T14:32:10.000Z" url="https://github.com/figma/code-connect/releases/tag/v1.5.0">
## Code Connect 1.5.0

> [!WARNING]
> Previously, Code Connect required framework-specific parsers for React, iOS, Android and Web Components. Late in 2025, we introduced a new [template API](https://developers.figma.com/docs/code-connect/template-api/) that removed framework requirements and allows users to more flexibly control how code snippets are rendered inside of Figma. Going forward, new users should opt for this template format and we recommend existing users to follow our [migration guide](https://developers.figma.com/docs/code-connect/templates-migration-guide/) to move to the new format. Following August 17th, 2026, we will no longer be updating or actively maintaining the legacy parsers.


## Fixed

### Template files

- Fixed nested rendered examples being dropped or formatted incorrectly when interpolated directly or passed to the React, Swift, and Kotlin child-rendering helpers.
- Migrated template files no longer include unused generated prop constants.

## Features

### Template files

- Added a `--delete` option to `figma connect migrate` that deletes source Code Connect files after they are successfully migrated.
- Template files (TypeScript and JavaScript) now support importing local helper modules via relative paths (for example, `./shared-helpers`) to promote reuse of shared formatting and utility logic. Helper code is bundled into the published template so it can run standalone, and helpers may import other local helpers to organize shared logic across multiple files. Only relative imports within the project are supported (external packages are not), and helpers must be brought in with `import` syntax — `require` remains available for the Figma API itself. Helper code you don't actually use is left out of the published template, and if the bundled output exceeds the maximum template size, the CLI fails before publishing.

### General

- `figma connect preview` can now render a component in states beyond its default, and inspect its properties:
  - `figma connect preview <file> --inspect` prints the component's properties and variants — name, type, variant options, and default — without rendering a snippet.
  - `figma connect preview <file> --props Name=Value …` renders a single specific property combination. Pairs are space-separated arguments (quote a pair only when its name or value contains spaces, e.g. `"Has Icon Start=true"`). Property names and variant values are matched case-insensitively, unspecified properties keep their defaults, and an invalid variant value is reported along with the valid options. To target a property when two properties share a name but differ in type, prefix the pair with the type, e.g. `"BOOLEAN:textMsg=false" "TEXT:textMsg=Hello"`; the prefix is optional and only needed to disambiguate.
  - `figma connect preview <file> --all` renders every property combination of the component — the cartesian product of its variant and boolean properties. Requires a specific component file argument. Use `--max-combinations <number>` to render fewer combinations when the full set is large.

</Release>

<Release version="v1.4.9" date="July 6, 2026" published="2026-07-06T11:16:13.000Z" url="https://github.com/figma/code-connect/releases/tag/v1.4.9">
## Fixed

### General

- Fixed parser invocation failing when a path or argument contained a space. This affected the Swift parser (Xcode project / Swift package paths), the Compose parser (Gradle wrapper paths), and the custom parser (any user-provided `parserCommand` referencing a path with spaces).

### Template files

- Fixed template-only projects unnecessarily building and running a native parser. When every Code Connect file is a parserless template (`.figma.ts`/`.figma.js`), the CLI no longer invokes the Swift or Compose parser — which is slow at best and can fail outright (for example a Swift package targeting macOS 12 whose `Figma` dependency requires macOS 13, producing "the library '...' requires macos 12.0, but depends on the product 'Figma' which requires macos 13.0"). Projects that also contain native source files are unaffected and still run the parser.

### Swift

- Raised the supported `swift-syntax` upper bound to allow the 603.x release. Previously the cap below 603 could silently downgrade `swift-syntax` in projects that depend on both Code Connect and `swift-syntax` (directly or transitively) on a Swift 6.3 toolchain. Older toolchains remain supported.

## Features

### General

- Added `@figma/code-connect/figma-types-no-require`, a variant of the template type definitions for projects that have `@types/node` installed. The default `@figma/code-connect/figma-types` entry declares a global `require` (so `const figma = require('figma')` works without `@types/node`), but that declaration overrides Node's own `require` type and causes errors like `Property 'resolve' does not exist` on `require.resolve(...)` elsewhere in projects that use `@types/node`. Such projects can now use `"@figma/code-connect/figma-types-no-require"` in their `types` array instead, adding it to their main `tsconfig.json` without a separate config. The default entry is unchanged, so no existing setup needs to change.

### Template files

- Augmented the `getSlot` API: `getSlot('SlotName')` still renders the same way, and the returned value now also exposes `connectedInstances` (the connected instances directly in the slot). This lets you render a slot's connected children inline. For example `getSlot('body').connectedInstances.map((c) => c.executeTemplate().example)`.

### React & HTML
- Augmented the `figma.slot` API: `figma.slot('SlotName')` still maps the slot the same way, and you can now also write `figma.slot('SlotName').connectedInstances` in a `props` object to render the slot's code-connected instances inline. For example `props: { content: figma.slot('Content').connectedInstances }`.
</Release>

<Release version="v1.4.8" date="June 8, 2026" published="2026-06-08T16:12:30.000Z" url="https://github.com/figma/code-connect/releases/tag/v1.4.8">
## Code Connect 1.4.8

## Fixed

### General

- Fixed browser compatibility issues where importing `@figma/code-connect` in Storybook or webpack environments would fail with "Can't resolve 'child_process'" or "Console is not a constructor" errors. Node.js-only modules (`child_process`, `console`) are now imported dynamically only when needed by CLI commands, making the package safe to use in browser environments.

### Template files

- Fixed template projects failing to publish or parse when Code Connect could not infer a React, HTML, Swift, or Compose parser. The CLI now proceeds without a parser and uses the default template-file globs.
- Fixed a "`getInstanceSwap(...)?.executeTemplate is not a function`" error that could break a template when `getInstanceSwap('prop')` referenced an instance-swap property that isn't present on the selected node (for example a property that is conditionally hidden by a boolean). The missing property now renders an inline error, consistent with the other accessors, instead of failing the whole template.
- Fixed migrated text-layer references (from the React/HTML `figma.textContent('...')` helper) producing a TypeScript error and silently rendering nothing when the layer was missing. Migration now preserves the original behavior — the text renders when the layer is found, and a clear error is shown when it isn't.

## Features

### Template files

- The `figma connect migrate` command now uses the same `--dir` and `--file` filtering behavior as `publish`, `parse`, and `unpublish`. The migrate-only positional glob argument has been removed.
- The `figma connect migrate` command can now migrate compatible large source files into batch template files. Files with 10 or more Code Connect docs are attempted automatically, `--batch all` forces a batch attempt, and `--batch none` disables batch migration.

</Release>

<Release version="v1.4.7" date="May 28, 2026" published="2026-05-28T14:25:06.000Z" url="https://github.com/figma/code-connect/releases/tag/v1.4.7">
## Code Connect 1.4.7

## Fixed

### General

- The `--file` (`-f`) option on `figma connect publish`, `unpublish`, and `parse` now accepts multiple files, so you can target several Code Connect files in one command (e.g. `figma connect publish --file a.figma.ts b.figma.ts`). Previously only a single file path was accepted.
- Tweak retry behavior for `publish` command to reduce 429s errors
- Shared flags (`--verbose`, `--token`, `--config`, `--dir`, `--file`, `--out-file`, `--out-dir`, `--api-url`, `--skip-update-check`, `--exit-on-unreadable-files`, `--dry-run`) now work whether you write them before or after the subcommand name. Previously, only `figma connect publish -v` toggled verbose mode; `figma connect -v publish` was silently ignored.

### Compose

- Fixed a crash that prevented the Code Connect Gradle plugin from being used with projects on Kotlin 2.3 or newer. The plugin now runs Kotlin source parsing in an isolated worker process, so it no longer ships an embedded Kotlin compiler in the consumer's build environment and cannot conflict with the host project's Kotlin Gradle Plugin across version upgrades.
- Fixed `parseCodeConnect` / `createCodeConnect` failing in multi-module Gradle projects when the plugin is applied to more than one subproject. The task now resolves the `-PfilePath`/`-PoutputDir` arguments against the root project so every subproject finds the input the CLI wrote at the build root.
- The Code Connect Gradle tasks now work cleanly with Gradle's configuration cache enabled. Previously, enabling `--configuration-cache` caused an opaque serialization error; the tasks now store and reuse the configuration cache entry as expected.
</Release>

<Release version="v1.4.5" date="May 13, 2026" published="2026-05-13T16:34:44.000Z" url="https://github.com/figma/code-connect/releases/tag/v1.4.5">
## Code Connect 1.4.5

## Fixed

### General

- The `preview` command now prints a clearer single-line message if the preview service is temporarily unavailable, instead of repeating a per-file error.
- `figma connect preview` now splits requests into smaller chunks when previewing many components at once, so previews of large component libraries no longer fail with “Payload Too Large” errors.

</Release>

<Release version="1.4.4" date="April 23, 2026" published="2026-04-23T15:17:38.000Z" url="https://github.com/figma/code-connect/releases/tag/1.4.4">
## Code Connect 1.4.4

## Fixed

### General

- Bumped Lodash version from 4.17 to 4.18 to address vulnerability [CVE-2021-23337](https://www.cve.org/CVERecord?id=)

### Storybook

- Storybook files with `.ts`, `.jsx`, or `.js` extensions (e.g. `Button.stories.jsx`) are now discovered by the CLI. Previously only `.stories.tsx` files were picked up.

### Template files

- `--exit-on-unreadable-files` is now respected for template files (`.figma.ts` / `.figma.js`)
- Fixed batch data not being picked up when rendering Code Connect snippets

## Features

### General

- Added `--force` flag to `figma connect publish`. When Figma already has UI-created Code Connect mappings for one or more nodes, publishing will now show a warning instead of failing silently. Use `--force` to overwrite those existing mappings with the Code Connect files from your codebase.
- The `connect create` command can now generates template files.
- Added `preview` command: you can now run `npx figma connect preview {fileUrl}` to locally preview a Code Connect file without having to publish it.

### Template files

- Added batch template support (`.figma.batch.json` + `.figma.batch.ts`). A batch file defines a shared template and an array of component entries, allowing hundreds of similar components (e.g. icons) to be Code Connected without individual template files. Per-entry data is available in the template via `figma.batch`.
</Release>

<Release version="v1.4.3" date="April 1, 2026" published="2026-04-01T18:28:55.000Z" url="https://github.com/figma/code-connect/releases/tag/v1.4.3">
## Code Connect 1.4.3

## Fixed

### Template files

- Fixed `getBoolean()` returning `undefined` instead of `false` when a boolean property is set to `false` in a template file.
- Fixed some TS discrepancies in the `figma.*` API in template files
- Some fixes for the migration script

### Swift & Compose

- Fixed args inconsistency in Swift and Compose helpers that could cause errors during template rendering.

## Features

### CLI

- Added `--file` (`-f`) option to `parse`, `publish`, and `unpublish` commands to process a single Code Connect file instead of the entire project (e.g. `figma connect parse --file=src/Button.figma.tsx`).

### Template files

- The `migrate` command now outputs TypeScript (`.figma.ts`) files by default. Pass `--javascript` to output JavaScript (`.figma.js`) files instead.
- The `migrate` command now outputs `import figma from "figma"` (ESM syntax) when using the `--typescript` flag
- The `migrate` command now removes `__props` metadata blocks by default. Pass `--include-props` to preserve them.
- Storybook connections can now be migrated by the template migration script

</Release>

<Release version="v1.4.2" date="March 17, 2026" published="2026-03-17T10:22:30.000Z" url="https://github.com/figma/code-connect/releases/tag/v1.4.2">
## Code Connect 1.4.2

## Fixed

### General

- Fixed incorrect `documentUrlSubstitutions` when one key is a prefix of another (e.g. `SearchInput` and `SearchInputMenu`). The CLI now processes longer keys first so the correct substitution is applied.
- Publishing with `--batch-size` now retries automatically on rate-limit (429) and server error (5xx) responses, respecting the `Retry-After` header when present, rather than failing immediately
- Fixed an issue around `.figma.js`/`.figma.ts` files being incorrectly treated as template files

### CLI

- The `--include-template-files` flag now shows a deprecation warning instead of causing an error. The flag is no longer necessary as template files are automatically included by default.

## Features

### General

- Code Connect now supports default branch names other than `master`/`main`. For cases where it can't be detected automatically, you can set `defaultBranch` in your `figma.config.json`.

### Template files

- Variant restrictions are now handled by the `migrate` script. These are inlined into one template file with if/else blocks.
- TypeScript is now supported for raw template files (`.figma.template.ts` / `.figma.ts`).
  - ESM import syntax is now supported for the Figma API: `import figma from 'figma'`
  - Type-only imports (`import type`) are supported
  - Other module imports are not yet supported
  - To enable types for the `figma` API, add `"@figma/code-connect/figma-types"` to the `types` array in your `tsconfig.json`.
  - JavaScript files are the default output of the `migrate` command. Can pass `--typescript` to output TypeScript (`.figma.ts`) files instead.

</Release>

<Release version="v1.4.1" date="February 20, 2026" published="2026-02-20T15:23:39.000Z" url="https://github.com/figma/code-connect/releases/tag/v1.4.1">
## Code Connect 1.4.1

## Fixed

- Fixed issue with publishing template files without a `source` value
</Release>

<Release version="v1.4.0" date="February 18, 2026" published="2026-02-18T12:15:08.000Z" url="https://github.com/figma/code-connect/releases/tag/v1.4.0">
## Code Connect 1.4.0

## Features

### React

- Add support for `figma.slot()` to map Figma slot layer properties in Code Connect files.

### Parserless

- Added a beta migration script to migrate parser-based Code Connect files to parserless templates under `figma connect migrate`.
- The default extension for parserless/template files is now `.figma.js` instead of `.figma.template.js`. The old `.figma.template.js` extension is still fully supported for backwards compatibility.
- Removed `--include-template-files` flag. Template files (`.figma.js` and `.figma.template.js`) are now always included when detected.
- Add support for `instance.getSlot(name)` in templates to reference "slot" properties.
- Parserless templates now support optional `component` and `source` comment fields (e.g., `// component=Button`)

</Release>

<Release version="v1.3.13" date="February 2, 2026" published="2026-02-02T14:20:51.000Z" url="https://github.com/figma/code-connect/releases/tag/v1.3.13">
## Code Connect 1.3.13

## Features

- Add --api-url option to use a different code-connect api endpoint. This option can also be configured in figma.config.json with the `apiUrl` field
- Add `language` config option to override syntax highlighting language in figma.config.json

### Parserless

- Syntax highlighting + formatting for parserless templates when publishing with a known label (e.g. React)

## Fixed

- Fix crash that occurs when the provided Figma file has no components
- Set version number for annotations gradle plugin
- Security update: upgraded undici to fix CVE-2026-22036. Roll back and report if you encounter networking issues.
- Security update: upgraded lodash to fix CVE-2025-13465.
</Release>

<Release version="v1.3.12" date="December 10, 2025" published="2025-12-10T13:53:58.000Z" url="https://github.com/figma/code-connect/releases/tag/v1.3.12">
## Code Connect 1.3.12

## Fixed

### General

- Fixed a problem with path alias imports incorrectly importing index files
- Fixed parsing failure for Compose in Windows.
</Release>

<Release version="v1.3.11" date="November 26, 2025" published="2025-11-26T10:51:40.000Z" url="https://github.com/figma/code-connect/releases/tag/v1.3.11">
## Code Connect 1.3.11

### Swift

- Fixed a corner case where the swift parser generated invalid code-connect code.
</Release>

<Release version="v1.3.10" date="November 19, 2025" published="2025-11-19T15:18:00.000Z" url="https://github.com/figma/code-connect/releases/tag/v1.3.10">
## Code Connect 1.3.10

### General

- Updated glob dependency to 11.0.4 to fix security vulnerability
</Release>

<Pagination cursor="2025-11-19T15:18:00.000Z|2026-03-31T14:15:02.282Z|rel_S0RDY8VpOmfukyaboZq1F" next="https://releases.sh/figma/figma-code-connect.md?cursor=2025-11-19T15%3A18%3A00.000Z%7C2026-03-31T14%3A15%3A02.282Z%7Crel_S0RDY8VpOmfukyaboZq1F&limit=20" />
