Skip to content

upgrade packages, support Figma Dev Mode exports and harden variable alias handling#339

Open
0m4r wants to merge 6 commits intolukasoppermann:mainfrom
0m4r:main
Open

upgrade packages, support Figma Dev Mode exports and harden variable alias handling#339
0m4r wants to merge 6 commits intolukasoppermann:mainfrom
0m4r:main

Conversation

@0m4r
Copy link
Copy Markdown
Collaborator

@0m4r 0m4r commented Mar 18, 2026

** DISCLAIMER ** AI tools have helped here! ** DISCLAIMER **

  • Upgraded the build and test pipeline to current tooling, including Node 22, newer Webpack/Jest/TypeScript/Figma typings, and a new flat ESLint config. Also tightened npm scripts to use && so lint, unit tests, and integration tests fail fast instead of continuing after an earlier error.

  • Added Figma Dev Mode and VS Code launch support by updating the manifest to include editorType: ["figma", "dev"] plus capabilities: ["inspect", "vscode"], and by introducing launch-context detection that routes Dev Mode inspect sessions into the existing export flow. Reference: Figma Dev Mode docs.

  • Made plugin/UI startup more resilient by centralizing launch command handling, opening external links from the plugin runtime instead of the iframe, merging default settings before rendering/export, and adding better plugin/UI logging around initialization, export, and file download behavior.

  • Improved export reliability for dynamically loaded documents by explicitly loading pages at the export entry point and then removing the redundant second loadAllPagesAsync() call inside token traversal. This aligns the implementation with Figma’s dynamic-loading model and avoids extra work on large files. Reference: Figma dynamic loading guide.

  • Fixed same-collection variable alias detection so it is actually awaited before export continues. This ensures aliases in the same collection are marked correctly and can include the active mode in the generated reference path when that experimental setting is enabled.

  • Hardened variable alias resolution against broken data by handling missing alias targets, missing variable collections, and aliases with no resolved values without crashing the export. Unresolvable aliases now warn and are skipped cleanly. References: getVariableByIdAsync, getVariableCollectionByIdAsync.

  • Refreshed test coverage around the new and risky paths: Dev Mode launch selection, empty/failed downloads, page loading behavior, same-collection alias handling, unresolved alias safety, and alias null-return branches. This replaces earlier weaker assertions with behavior-focused checks that better protect against regressions.

  • Updated example outputs and integration fixtures to match the upgraded pipeline and current export behavior, including generated CSS and platform example artifacts.

This should address #338

@0m4r 0m4r requested a review from lukasoppermann March 18, 2026 16:14
@0m4r 0m4r self-assigned this Mar 18, 2026
@0m4r 0m4r added the Improvement Enhancement or code cleanup label Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Improvement Enhancement or code cleanup

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant