# Code Connect v2.1.1 (20 November 2026) ## Features ### General - Preview can now vary only the properties you care about with `--all Size "Has Icon"`, holding all other properties at their own defaults before applying the 500-combination limit. The selection applies across all selected components and can also be supplied directly to `--unique`, for example `--unique Size "Has Icon"`. Bare `--all` still varies every Boolean and Variant property. Place component file arguments before `--all` or `--unique`; quote property names containing spaces. Ambiguous or unsupported names, names unmatched across all selected components, and unavailable property definitions cause an error before rendering. ## Changed ### General - The CLI now uses Zod 4 to check the output of parsers, for example during `figma connect migrate`. Error messages for invalid parser output are worded differently, and every prop in `templateData.props` must include `args`. ## Fixed ### General - Preview keeps identical snippets from separate batch templates distinct with `--unique`. - Templates that `figma connect migrate` creates from SwiftUI and Compose Code Connect no longer fail to load in Dev Mode when a text property is missing from the component. The migrated template now shows the missing property instead of the error `replace is not a function`. - The CLI now respects the `NO_PROXY` environment variable. Hosts listed in it are reached directly instead of through the proxy set in `HTTPS_PROXY` or `HTTP_PROXY`. - `figma connect create` now correctly escapes component property names and variant options that contain quotes, backslashes, or line breaks. Previously these characters could produce a generated template file containing broken or unintended code. - Security update: upgraded glob to v14 and minimatch to v11 to fix a denial-of-service vulnerability in minimatch ([CVE-2026-118764](https://github.com/advisories/GHSA-g3hv-75wg-m249)). The ts-morph dependency still uses minimatch v10 until ts-morph releases an update. - `figma connect create` and `client.getComponents()` now keep `#` characters that are part of a property name, removing only the ID Figma adds to the end. For example, a property named `Tab #2` is now referenced as `"Tab #2"` instead of `"Tab "`, which the generated template could not find. Properties such as `Tab #1` and `Tab #2` also no longer share one name in `client.getComponents()` results. # Code Connect v2.1.0 (26 October 2026) ## 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. # Code Connect v2.0.2 (14 October 2026) ## 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. # Code Connect v2.0.1 (10 September 2026) ## 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. # Code Connect v2.0.0 (18 August 2026) > [!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` # Code Connect v1.5.3 (12 August 2026) ## Fixed ### React - Fixed rendering of nested arrow function callbacks ## Features ### General - Adds `figma connect preview --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. # Code Connect v1.5.2 (3 August 2026) ## Fixed - Fixed JavaScript template files authored with `import figma from 'figma'` publishing an unexecutable import. # Code Connect v1.5.1 (29 July 2026) - Copy tweaks for CLI support notice # Code Connect v1.5.0 (29 July 2026) > [!WARNING] > Framework-specific parsers will no longer receive updates or support from August 17th, 2026. Template files will be 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/ ## 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 --inspect` prints the component's properties and variants — name, type, variant options, and default — without rendering a snippet. - `figma connect preview --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 --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 ` to render fewer combinations when the full set is large. # Code Connect v1.4.9 (6 July 2026) ## 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 }`. # Code Connect v1.4.8 (8 June 2026) ## 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 parserless 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. # Code Connect v1.4.7 (28 May 2026) ## 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. # Code Connect v1.4.5 (13 May 2026) ## 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. # Code Connect v1.4.4 (22 April 2026) ## 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`. # Code Connect v1.4.3 (1st April 2026) ## 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 # Code Connect v1.4.2 (16th March 2026) ## 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`. - TypeScript files are the default output of the `migrate` command. Can pass `--javascript` to output JavaScript (`.figma.js`) files instead. # Code Connect v1.4.1 (20th February 2026) ## Fixed - Fixed issue with publishing template files without a `source` value # Code Connect v1.4.0 (18th February 2026) ## 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`) # Code Connect v1.3.13 (29th January 2026) ## 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. # Code Connect v1.3.12 (10th December 2025) ### General ## Fixed - Fixed a problem with path alias imports incorrectly importing index files - Fixed parsing failure for Compose in Windows. # Code Connect v1.3.11 (26th November 2025) ### Swift - Fixed a corner case where the swift parser generated invalid code-connect code. # Code Connect v1.3.10 (19th November 2025) ## Fixed ### General - Updated glob dependency to 11.0.4 to fix security vulnerability # Code Connect v1.3.9 (14th November 2025) ## Fixed ### General - Improve response of publish command to display succeeded and failed nodes ### Compose / Swift - Fixed parsing failure in `create` command # Code Connect v1.3.8 (29th October 2025) ## Fixed - Display both failed and succeeded components details when publishing. ### Compose - Fixed an issue where if there were multiple modules/files connecting to the same FigmaNode the parser only recognize the first module/file found. - Update `libs.versions.toml` Kotlin version to `2.2.21`. # Code Connect v1.3.7 (22nd October 2025) ## Fixed ### General - `unpublish` command showing success message in certain cases where the action didn't complete properlty. - Fixed path alias imports not being resolved. ### Compose - Released a new [Code Connect plugin](https://mvnrepository.com/artifact/com.figma.code.connect/plugin) version (1.2.3) that works with JDK 17. - Fixed an issue that was happening in the parser where special characters weren't escaped properly, causing snippets to fail to evaluate. ### SwiftUI - Fixed `swift-syntax` dependency to include support for 602.0.0. Thanks to @luispadron for the [PR](https://github.com/figma/code-connect/pull/327) # Code Connect v1.3.6 (26th September 2025) ## Fixed ### General - Updated `npx connect unpublish --node` to require a `--label` param so it can unpublish any label type. ### Compose - Fixed parsing issue with multi-module projects. ### SwiftUI - Updated `swift-syntax` to support 602.0.0. Thanks to @luispadron for the [PR](https://github.com/figma/code-connect/pull/274) - Fixed protocol inheritance for Swift 6.2. Thanks to @rmenezes for the [PR](https://github.com/figma/code-connect/pull/317) # Code Connect v1.3.5 (4th September 2025) ## Fixed ### General - Fixed "Failed to fetch embeddings" error if empty payload in interactive setup - Retain the temporary file and directory when `--verbose` is enabled for improved debugging. ### SwiftUI - Fixed SourcePackages directory not found. - Added optional sourcePackagesPath parameter for when the default derived data folder is not used. - Updated `swift-syntax` to support 601.0.1. # Code Connect v1.3.4 (26th June 2025) ## Fixed ### React - Support getProps inside nestedProps # Code Connect v1.3.3 (22nd May 2025) ## Features ### Compose - Enhanced `--verbose` command to output detailed stacktrace. ## Fixed ### General - Bumped Undici version to address security issue # Code Connect v1.3.2 (4th April 2025) ## Fixed ### General - Added support for GitHub Enterprise source links (fixes https://github.com/figma/code-connect/issues/259) ### React - Fixed incompatibility issue with React 19 (fixes https://github.com/figma/code-connect/issues/265) - Fixed issue with numeric characters in property names ### HTML - Allow examples to return strings to support icon IDs (fixes https://github.com/figma/code-connect/issues/252) # Code Connect v1.3.1 (14th February 2025) ## Fixed - Allow .gradle files to be detected as Android/Compose projects. Thanks to @sebastienrouif for the [PR](https://github.com/figma/code-connect/pull/237) - Remove prompts patching (fixes https://github.com/figma/code-connect/issues/241) ## Features - Added `interactiveSetupFigmaFileUrl` to the interactive setup, allowing you to specify the Figma file to use for connecting components in your `figma.config.json` file. - Rename `--include-raw-templates` flag to `--include-template-files`. Further details of this feature can be found in the [documentation](https://www.figma.com/code-connect-docs/no-parser/). ### SwiftUI - Updated `swift-syntax` to point to the new URL. Thanks to @pontusJPaf for the [PR](https://github.com/figma/code-connect/pull/239). # Code Connect v1.3.0 (28th January 2025) ## Features - Add support for JSX Figma connection files. - Added an option to automatically create or append the access token to the project's .env file - Add better handling of many figma components in the wizard (grouping per page) - Allow variant restrictions to use boolean-like properties ### General - Added support for Bitbucket, Gitlab and Azure DevOps for generated source file URLs ## Fixed - Don't show a red-cross when the file-matching prompt is finished in the wizard - Add default values for `@FigmaEnum` declarations in SwiftUI ### SwiftUI - Fixed a formatting error when running the CLI ### React - Fix nested objects and arrays in props not rendering properly in code snippets - Fixed a type issue when passing functions as values to `figma.boolean` - Add support for multiple exports per file in the wizard ### Storybook - Add support for different props per example (fixes https://github.com/figma/code-connect/issues/143) - Add support for `links` and `imports` (fixes https://github.com/figma/code-connect/issues/142) # Code Connect v1.2.4 (5th December 2024) ## Fixed - Fix issue with CLI not working on some cases in 1.2.3 # Code Connect v1.2.3 ## Features ## Fixed - In the interactive setup, the automatic file linking now matches components exported from index files ### React - Fix issue where React component references in `props` would serialize to strings when accessed with `getProps()` - Fix issue with nesting `figma.boolean` and `getProps` # Code Connect v1.2.2 (5th November 2024) ## Features ### General - Added support to create Custom parsers. Those allow users to add support for languages which aren't natively supported by Code Connect. Check the [documentation](https://github.com/figma/code-connect/blob/main/docs/custom.md) for more details. ## Fixed ### React - Only show AI question for React - Fix error in autolinking in reduce function # Code Connect v1.2.1 (23rd October 2024) ### General - Added a `--exit-on-unreadable-files` flag to all commands to exit if any Code Connect files cannot be parsed. We recommend using this option for CI/CD. ## Fixed ### React - Fixed a bug introduced in 1.2.0 where `nestedProps` referencing a hidden layer would result in an error rendering Code Connect ### SwiftUI - Fixed potential "index is out of bounds" error. ### General - Changed how the extension makes HTTP requests to resolve issues when connecting through a proxy. Please [submit a support ticket](https://help.figma.com/hc/en-us/requests/new?ticket_form_id=360001744374) if you continue to have connection issues after this update. ### Compose - Fixed some parsing errors when running the `create` and `publish` commands # Code Connect v1.2.0 ## Features ### General - The interactive setup now offers AI support for accurate prop mapping between Figma and code components. Users will now be given the option to use AI during the setup process, which if chosen will assist in creating Code Connect files and attempting to accurately map your code to Figma properties. Data is used only for mapping and is not stored or used for training. To learn more, visit https://help.figma.com/hc/en-us/articles/23920389749655-Code-Connect ### React - Added support for returning strings or React components from the `example` function, in addition to JSX - Added `getProps` on `figma.instance()` which can be used to access props of a nested connected component - Added `render` on `figma.instance()` which can be used to render a nested connected component dynamically - Added support for including any custom props in the `props` object, that can be accessed with `getProps` in a parent component ## Fixed ### HTML - Case of attribute names is now preserved to support Angular (fixes https://github.com/figma/code-connect/issues/172) - Fixed a bug with `nestedProps` (fixes https://github.com/figma/code-connect/issues/176) ## Fixed # Code Connect v1.1.4 (26th September 2024) ## Fixed ### React - Fixed a Prettier bug with the interactive setup - Removed empty enum mappings from generated Code Connect in interactive setup - Fixed an issue with props not rendering correctly in the Figma UI if used in the body of a component (e.g. as a hook argument). Any Code Connect with this issue will need republishing to be fixed. (fixes https://github.com/figma/code-connect/issues/167) - Support mapping from an enum value to a boolean prop in CLI Assistant ## Features ### Compose - The dependencies required to author Code Connect files now live in a separate module from the plugin and are hosted on Maven Central. Refer to the [documentation](docs/compose.md) for updated instructions on adding Code Connect to your project. ### SwiftUI - Updated the swift-syntax dependency to include 600.0.0 (Swift 6) # Code Connect v1.1.3 (11th September 2024) ## Fixed ### HTML - Fixed an issue where `imports` was incorrectly not included in the TypeScript interface - Added a note in the [documentation](docs/html.md) that HTML support requires `moduleResolution: "NodeNext"` ### React - Fixed an issue where `imports` was incorrectly not included in the TypeScript interface (fixes https://github.com/figma/code-connect/issues/159) ## Features ### React - Code Connect files created in the CLI assistant will now start try to use auto-generated prop mappings in the component props. This is an early feature and support for different types is limited. # Code Connect v1.1.2 (10th September 2024) ## Fixed ### React - Fixed an issue with `client` export used by the icon script (fixes https://github.com/figma/code-connect/issues/156) # Code Connect v1.1.1 (10th September 2024) ## Fixed ### General - Fixed an issue where the `@figma/code-connect@1.1.0` npm package had an incorrect README # Code Connect v1.1.0 (10th September 2024) ## Features ### HTML - Added support for documenting HTML-based frameworks (including Web Components, Angular and Vue), using the new `html` parser. See the [documentation](docs/html.md) for more information. HTML support for Code Connect is in preview, and the API is liable to change during this period. Please let us know your feedback via [GitHub Issues](https://github.com/figma/code-connect/issues/new/choose). ### SwiftUI - Added a `swiftPackagePath` configuration option to specify a custom path to a `Package.swift` file to run Code Connect from. ### React - Code Connect files created in the CLI assistant will now start including some auto-generated prop mappings between Figma properties and linked code props. This is an early feature and support for different prop types is limited. ### General - Restructured the Code Connect documentation. All documentation can now be found in the [docs](docs) directory. ## Fixed ### React - `figma.nestedProps` can now be used in conjunction with `figma.boolean` for conditionally hidden nested instances (fixes https://github.com/figma/code-connect/issues/118, https://github.com/figma/code-connect/issues/89) - Fixed an issue where backticks could not be used in the example code (fixes https://github.com/figma/code-connect/issues/139) - Fixed an issue with wildcard paths in import mappings - Fixed an error when trying to use the icon script with component sets # Code Connect v1.0.6 (21st August 2024) ## Fixed ### React - Fixed issue where props with special characters such as hyphens would not render properly. (https://github.com/figma/code-connect/issues/116) ## Features ### React - figma.enum now supports floating point numbers ### Compose - Update the dependency for Code Connect to use Kotlin 2.0 libraries # Code Connect v1.0.5 (13th August 2024) ## Fixed ### React - Fixed an issue around creation of Code Connect files from the CLI assistant (fixes https://github.com/figma/code-connect/issues/125) # Code Connect v1.0.4 (7th August 2024) ## Fixed ### React - Fixed rendering of identifiers, functions and objects when used as children ### SwiftUI - Updated the `component` definition in FigmaConnect protocol to be optional and have a default implementation. ### Compose - Added a more helpful error message when the JDK version is too low. ## Features ### General - Added error message to suggest splitting publish when request too large - CLI assistant support for selecting file exports to use in Code Connect template - New --batch-size argument for publish command in order to split uploading into smaller "batches". This will allow for large uploads without having to split running the publish command with different directories. # Code Connect v1.0.3 (23th July 2024) ## Fixed ### General ### React - Add support for hyphens in prop names (fixes https://github.com/figma/code-connect/issues/97) ### SwiftUI - Fixed `checkouts` folder resolution edge case ### Compose - Fixed issue with `create` command creating invalid code - Added import resolution for components ## Features ### General - Added support for SwiftUI and Compose in the CLI Assistant - Added `--skip-update-check` flag - Added `--label` flag to the `publish` and `unpublish` commands to publish or unpublish to a custom label - We now print the label used when running the `publish` command - Improved autolinking algorithm # Code Connect v1.0.2 (10th July 2024) ## Fixed ### General - Improvements to CLI Assistant ### React - Prevent rendering empty strings as prop values (Fixes: https://github.com/figma/code-connect/issues/67) - Fix output when there are multiple return statements - Fix wildcard importPaths mappings with nested folders - Fix boolean mappings for lowercase boolean-like strings (Fixes: https://github.com/figma/code-connect/issues/70) - Fix boolean-like keys in enums (Fixes: https://github.com/figma/code-connect/issues/74) ### SwiftUI - Fix spaces in Xcode file path # Code Connect v1.0.1 (20th June 2024) ## Fixed ### General - The automatic update check introduced in v1.0.0 did not show the correct update command for React users with the `@figma/code-connect` package installed locally – it always showed the command for globally updating the package. We now show both `npm install @figma/code-connect@latest` and `npm install -g @figma/code-connect@latest` as options. React users with the package installed locally should use `npm install @figma/code-connect@latest`, and users of other targets (or with the package installed globally) should use `npm install -g @figma/code-connect@latest`. We have temporarily removed the `update` command added in v1.0.0. # Code Connect v1.0.0 (19th June 2024) ## Features ### General - Added [documentUrlSubstitutions](README.md#documenturlsubstitutions) config option ### Jetpack Compose - Added support for Android Jetpack Compose. See the [README](compose/README.md) to get started ### React - Interactive setup flow, launched by running `figma connect`, which guides you through the setup process and auto-connects your components ## Fixed ### General - Automatic config migration (added in v0.2.0) now correctly preserves `include`/`exclude` config options - Icon script helpers moved to a named export so they can be imported correctly (see [README](cli/scripts/README.md)) ### React - Nested helpers within `figma.nestedProps` now work as expected - Props can now be rendered in nested object props ### SwiftUI - `create` now outputs Swift files with the correct syntax # Code Connect v0.2.1 (17th June 2024) ## Fixed ### React - Fixed a bug in v0.2.0 where source paths for components could be incorrect - Fixed a bug in v0.2.0 where Code Connect files using the new prop types failed to validate ### SwiftUI - Fixed parsing of Code Connect files using `@FigmaChildren` annotations # Code Connect v0.2.0 (14th June 2024) ## Breaking changes - Code Connect now uses a single CLI tool for all supported targets. This ensures consistency and feature parity, and provides the foundations for our upcoming Android Compose and extensibility support. For Code Connect Swift users, you should follow the updated [CLI installation instructions](README.md#cli-installation) to install the new CLI version, and update your Code Connect Swift package to `v0.2.0` by following the [Swift installation instructions](swiftui/README.md#installation). For Code Connect React users, no change to installation is necessary, and you can simply update the npm dependency to `v0.2.0`. If you have a Code Connect configuration file, you will need to ensure it is located in your React or SwiftUI project root (e.g. alongside your `package.json` or `.xcodeproj` file), and you will need to update it to remove the top level `react` or `swiftui` key. The Code Connect CLI will offer to update your config file for you, but in unusual cases a manual migration may be necessary. This allows us to simplify configuration going forward, as each target now has its own configuration file, situated in the project root. Please let us know via [GitHub Issues](https://github.com/figma/code-connect/issues) if you encounter any problems. ## Features ### General - Added `--outDir` option to `connect create` to specify output directory for created files ### React - Added support for [nested properties](docs/react.md#nested-properties), using `figma.nestedProps` - Added support for [concatenating strings for CSS class names](docs/react.md#classname), using `figma.className` - Added support for [text content from layers](docs/react.md#text-content), using `figma.textContent` - Added support for [wildcards](docs/react.md#wildcard-match) with `figma.children` ### SwiftUI - Added a new API for [prop mapping](swiftui/README.md#prop-mapping), using `@FigmaString`, `@FigmaBoolean` and `@FigmaEnum` instead of `@FigmaProp`. The old syntax is still supported, but we recommend using the new syntax going forward. - Added support for [nested children](swiftui/README.md#instance-children), using the `@FigmaChildren` property wrapper - Added support for rendering single-statement nested Code Connect inline ## Fixed ### General - Fixed detection of default git branch name - Nested components now honour variant restrictions (fixes https://github.com/figma/code-connect/issues/54) ### React - Multiline JSX and strings are now supported in `figma.enum` values - Added support for objects, JSX and functions in `figma.boolean` enums - Imported values referenced from a `figma.enum` (e.g. values from an object or `enum`) now render correctly (fixes https://github.com/figma/code-connect/issues/55)