You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+22-1Lines changed: 22 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,28 @@
1
-
# Code Connect v1.4.7 (28 May 2026)
1
+
# Code Connect v1.4.8 (8 June 2026)
2
+
3
+
## Fixed
4
+
5
+
### General
6
+
7
+
- 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.
8
+
9
+
### Template files
10
+
11
+
- 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.
12
+
- 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.
13
+
- 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.
2
14
3
15
## Features
4
16
17
+
### Template files
18
+
19
+
- 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.
20
+
- 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.
21
+
22
+
# Code Connect v1.4.7 (28 May 2026)
23
+
24
+
## Fixed
25
+
5
26
### General
6
27
7
28
- 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.
@@ -167,9 +174,8 @@ export function addConnectCommandToProgram(program: commander.Command) {
167
174
addBaseCommand(
168
175
connectCommand,
169
176
'migrate',
170
-
'Parse Code Connect files and migrate their templates into .figma.js files that can be published directly without parsing.',
177
+
'Parse Code Connect files and migrate their templates into .figma.ts or .figma.js files that can be published directly without parsing.',
171
178
)
172
-
.argument('[pattern]','glob pattern to match files (optional, uses config if not provided)')
173
179
.option(
174
180
'--include-props',
175
181
'preserve __props metadata blocks in migrated templates (removed by default). Use if your templates use the React .getProps() or .render() modifiers, or read executeTemplate().metadata.__props from the migrated components',
@@ -178,6 +184,14 @@ export function addConnectCommandToProgram(program: commander.Command) {
178
184
'--javascript',
179
185
'output migrated templates as JavaScript (.figma.js) instead of TypeScript (.figma.ts)',
180
186
)
187
+
.addOption(
188
+
newcommander.Option(
189
+
'--batch <mode>',
190
+
'batch migration mode: auto attempts files with 10 or more Code Connect docs; all attempts every source file; none disables batch migration',
191
+
)
192
+
.choices(['auto','all','none'])
193
+
.default('auto'),
194
+
)
181
195
.action(withUpdateCheck(handleMigrate))
182
196
183
197
addBaseCommand(
@@ -364,6 +378,15 @@ export async function getCodeConnectObjects(
364
378
}
365
379
rawTemplateDocs.push(doc)
366
380
}catch(e){
381
+
// A url-less file containing `codeProperties` is not Code Connect (e.g.
382
+
// Make's code component property definitions). Log and skip it instead
383
+
// of failing — never exit, not even with --exit-on-unreadable-files.
"If you'd like to create batch files for these, we recommend using a coding agent. See example prompt: https://developers.figma.com/docs/code-connect/template-files/#migration-script",
916
+
)
917
+
}
918
+
863
919
// Summary
864
920
console.log('')
865
921
logger.info(
@@ -877,3 +933,10 @@ async function handleMigrate(
0 commit comments