unstale

npm / @figma/code-connect

@figma/code-connect

What changed in @figma/code-connect 1 to 2, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-23.

15 breaking2 deprecations33 new APIs and options1 performance11 behavior and defaults8 tooling39 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli 0.3.1 on npm

@figma/code-connect 222 changes

Breaking changes 9

  • Running the command now shows available commands instead of the interactive setup wizard.

    2.1.0release notes

  • When more than one layer matches, nestedProps now returns the first match in layer order.

    2.1.0release notes

  • With traverseInstances: true, layers are returned in layer order instead of sibling layers being returned in reverse order.

    2.1.0release notes

  • When more than one layer matches, traverseInstances: true now returns the first match in layer order.

    2.1.0release notes

  • The interactive setup wizard was removed; the notes recommend the figma-code-connect skill as its replacement.

    2.1.0release notes

  • The command always generates a parserless template file, including in projects configured for a framework-specific parser.

    2.0.2release notes

  • Unsupported output filenames are rejected with guidance to use .figma.ts or .figma.js.

    2.0.2release notes

  • Framework-specific parsers can now be used only with migrate and unpublish; other commands exit with guidance to migrate to template files.

    2.0.0release notes

  • Framework-specific parsers will no longer receive updates or support; template files are the only actively maintained way to use Code Connect.

    2.0.0release notes

New APIs and options 3

  • Set this environment variable to 1 to disable telemetry of preflight validation failure counts sent by figma connect publish.

    2.0.2release notes

  • Running a command with this flag shows the stack trace for a network request failure.

    2.0.2release notes

  • The command now accepts a component template file declared in a .figma.batch.json file, allowing that component to be previewed individually.

    2.0.1release notes

Performance 1

  • Performance optimizations were made for the preview command.

    2.0.0release notes

Behavior and default changes 4

  • Requests consistently identify the Code Connect package and installed version, making them easier to recognize in network logs.

    2.1.0release notes

  • JSON output now includes each connection's source file.

    2.0.2release notes

  • Publishing now sends preflight validation failure counts to Figma; set DO_NOT_TRACK=1 to disable this telemetry.

    2.0.2release notes

  • On Professional plans, publishing now confirms the active library and framework when they are first selected, and explains how to change the selection or upgrade if the limit is exceeded.

    2.0.2release notes

Fixes and other changes 5

  • Errors now list matched files that were not recognized as templates and separately explain when no files matched the configuration.

    2.1.0release notes

  • File discovery now works in project folders with special characters while preserving configured exclusions and project-relative includes with a leading slash.

    2.0.2release notes

  • The command leaves existing template files unchanged and reports success when no components need migrating.

    2.0.2release notes

  • Filtering text layers by parent path no longer crashes, including when the text is inside nested instances.

    2.0.2release notes

  • Network request failures now show the underlying reason, such as a timeout or connection error, instead of only “fetch failed.”

    2.0.2release notes

@figma/code-connect 187 changes

Breaking changes 6

  • The migrate-only positional glob argument has been removed.

    1.4.8release notes

  • The migrate command now removes __props metadata blocks by default; pass --include-props to preserve them.

    1.4.3release notes

  • When using --typescript, the migrate command now outputs ESM syntax with import figma from "figma".

    1.4.3release notes

  • The migrate command now outputs TypeScript (.figma.ts) files by default; use --javascript to output JavaScript (.figma.js) files instead.

    1.4.3release notes

  • The migrate command now outputs JavaScript files by default.

    1.4.2release notes

  • The flag is removed because detected template files are now always included.

    1.4.0release notes

Deprecations 2

  • Legacy parsers for React, iOS, Android, and Web Components will no longer be updated or actively maintained after August 17, 2026; new users should use the template format.

    1.5.0release notes

  • The flag now shows a deprecation warning instead of causing an error; template files are included automatically by default.

    1.4.2release notes

New APIs and options 30

  • Adds --unique to hide duplicate outputs, similar to --all.

    1.5.3release notes

  • Adds id to expose the instance's Figma node ID, matching Plugin API SceneNode.id, including stable paths for nested instance sublayers.

    1.5.3release notes

  • The --delete option deletes source Code Connect files after they are successfully migrated.

    1.5.0release notes

  • Renders every combination of a component's variant and boolean properties and requires a specific component file argument.

    1.5.0release notes

  • Prints a component's properties and variants without rendering a snippet.

    1.5.0release notes

  • Limits how many combinations are rendered when using --all.

    1.5.0release notes

  • Renders a component for a specified property combination; unspecified properties keep their defaults, and invalid variant values are reported with valid options.

    1.5.0release notes

  • TypeScript and JavaScript template files can import local helper modules using relative import syntax; helper code is bundled for standalone use, while external packages are unsupported.

    1.5.0release notes

  • A template type-definition entry for projects with @types/node avoids overriding Node's require type and can be added to the main tsconfig.json types array.

    1.4.9release notes

  • Slot values can expose their code-connected instances through connectedInstances in a props object, allowing them to be rendered inline.

    1.4.9release notes

  • The value returned by getSlot now exposes the connected instances directly in the slot, allowing their templates to be rendered inline.

    1.4.9release notes

  • Compatible large source files with 10 or more Code Connect docs are attempted automatically; --batch all forces a batch attempt and --batch none disables it.

    1.4.8release notes

  • Preview a Code Connect file locally without publishing it using npx figma connect preview {fileUrl}.

    1.4.4release notes

  • Publishing warns when Figma has UI-created mappings for nodes; use --force to overwrite them with Code Connect files from your codebase.

    1.4.4release notes

  • Batch templates use a shared template and an array of component entries to Code Connect many similar components without individual template files; .figma.batch.ts is also supported, with per-entry data available via figma.batch.

    1.4.4release notes

  • Added an option to process a single Code Connect file instead of the entire project.

    1.4.3release notes

  • Added an option to process a single Code Connect file instead of the entire project.

    1.4.3release notes

  • Added an option to process a single Code Connect file instead of the entire project.

    1.4.3release notes

  • Set this in figma.config.json when the default branch cannot be detected automatically, including when its name is not master or main.

    1.4.2release notes

  • Add this entry to the types array in tsconfig.json to enable types for the figma API.

    1.4.2release notes

  • Raw template files can now use TypeScript.

    1.4.2release notes

  • The Figma API now supports ESM import syntax.

    1.4.2release notes

  • Pass this option to the migrate command to output TypeScript (.figma.ts) files.

    1.4.2release notes

  • Parserless templates support an optional component comment field.

    1.4.0release notes

  • Add support for mapping Figma slot layer properties in Code Connect files.

    1.4.0release notes

  • Templates can use instance.getSlot(name) to reference slot properties.

    1.4.0release notes

  • Parserless templates support an optional source comment field.

    1.4.0release notes

  • Use a different Code Connect API endpoint.

    1.3.13release notes

  • Configure a different Code Connect API endpoint in figma.config.json.

    1.3.13release notes

  • Override the syntax highlighting language in figma.config.json.

    1.3.13release notes

Behavior and default changes 7

  • When every Code Connect file is a parserless template, the CLI no longer invokes the Swift or Compose parser; projects with native source files still run the parser.

    1.4.9release notes

  • When the CLI cannot infer a React, HTML, Swift, or Compose parser, it proceeds without one and uses the default template-file globs.

    1.4.8release notes

  • The --file (-f) option on publish, unpublish, and parse accepts multiple files, allowing several Code Connect files to be targeted in one command.

    1.4.7release notes

  • The command can now generate template files.

    1.4.4release notes

  • Publishing with this option retries automatically on rate-limit and server errors, respecting Retry-After when present.

    1.4.2release notes

  • Parserless/template files now use .figma.js by default; .figma.template.js remains supported for backwards compatibility.

    1.4.0release notes

  • The publish command now displays succeeded and failed nodes in its response.

    1.3.9release notes

Tooling 8

  • Migrated template files no longer include unused generated prop constants.

    1.5.0release notes

  • The CLI now discovers Storybook files with .ts, .jsx, and .js extensions, in addition to .stories.tsx files.

    1.4.4release notes

  • The template migration script can now migrate Storybook connections.

    1.4.3release notes

  • Type-only imports are now supported in raw template files.

    1.4.2release notes

  • The script handles variant restrictions by inlining them into one template file with if/else blocks.

    1.4.2release notes

  • A beta migration script migrates parser-based Code Connect files to parserless templates.

    1.4.0release notes

  • Parserless templates receive syntax highlighting and formatting when published with a known label, such as React.

    1.3.13release notes

  • A new Compose plugin version works with JDK 17.

    1.3.7release notes

Fixes and other changes 34

  • Rendering of nested arrow function callbacks is fixed.

    1.5.3release notes

  • JavaScript template files authored with import figma from 'figma' no longer publish an unexecutable import.

    1.5.2release notes

  • Nested rendered examples are no longer dropped or incorrectly formatted when interpolated directly or passed to child-rendering helpers.

    1.5.0release notes

  • Parser invocation no longer fails when a path or argument contains a space, including for Swift, Compose, and custom parsers.

    1.4.9release notes

  • The supported upper bound now allows the 603.x release, preventing silent downgrades in projects using Swift 6.3; older toolchains remain supported.

    1.4.9release notes

  • Node.js-only modules are imported dynamically only when needed by CLI commands, preventing browser-environment import failures in Storybook or webpack.

    1.4.8release notes

  • The migrate command now applies the same --dir and --file filtering behavior as publish, parse, and unpublish.

    1.4.8release notes

  • Migration preserves text-layer rendering when the layer is found and shows a clear error when it is missing.

    1.4.8release notes

  • A missing instance-swap property now renders an inline error instead of causing the template to fail.

    1.4.8release notes

  • Kotlin source parsing runs in an isolated worker process, fixing crashes with Kotlin 2.3 or newer and avoiding conflicts with the host project's Kotlin Gradle Plugin.

    1.4.7release notes

  • Code Connect Gradle tasks now work with Gradle's configuration cache enabled and reuse the configuration cache entry.

    1.4.7release notes

  • Retry behavior was adjusted to reduce 429 errors when publishing.

    1.4.7release notes

  • Shared flags now work before or after the subcommand name, so placing them before the subcommand no longer silently ignores them.

    1.4.7release notes

  • In multi-module Gradle projects, task arguments are resolved against the root project so subprojects can find CLI inputs written at the build root.

    1.4.7release notes

  • Prints a clearer single-line message when the preview service is temporarily unavailable, instead of repeating a per-file error.

    1.4.5release notes

  • Splits requests into smaller chunks when previewing many components, preventing “Payload Too Large” errors for large component libraries.

    1.4.5release notes

  • Batch data is now picked up when rendering Code Connect snippets.

    1.4.4release notes

  • This option is now respected for template files (.figma.ts / .figma.js).

    1.4.4release notes

  • Fixed some TypeScript discrepancies in the figma.* API in template files.

    1.4.3release notes

  • In template files, getBoolean() now returns false when a boolean property is set to false instead of returning undefined.

    1.4.3release notes

  • Fixed inconsistent arguments that could cause errors during template rendering.

    1.4.3release notes

  • The CLI processes longer substitution keys first, fixing incorrect substitutions when one key is a prefix of another.

    1.4.2release notes

  • Files with this extension are no longer incorrectly treated as template files.

    1.4.2release notes

  • Fixed publishing template files that do not have a source value.

    1.4.1release notes

  • Fixes a crash when the provided Figma file has no components.

    1.3.13release notes

  • Fixed parsing failure for Compose in Windows.

    1.3.12release notes

  • Fixed path alias imports incorrectly importing index files.

    1.3.12release notes

  • Fixed a corner case where the Swift parser generated invalid Code Connect code.

    1.3.11release notes

  • Fixed a parsing failure in the create command.

    1.3.9release notes

  • The parser now recognizes multiple modules/files connecting to the same FigmaNode instead of only the first one.

    1.3.8release notes

  • Path alias imports are now resolved.

    1.3.7release notes

  • The parser now escapes special characters properly, preventing snippets from failing to evaluate.

    1.3.7release notes

  • The dependency now includes support for 602.0.0.

    1.3.7release notes

  • The command no longer reports success in cases where the action did not complete properly.

    1.3.7release notes