upgrade packages, support Figma Dev Mode exports and harden variable alias handling#339
Open
0m4r wants to merge 6 commits intolukasoppermann:mainfrom
Open
upgrade packages, support Figma Dev Mode exports and harden variable alias handling#3390m4r wants to merge 6 commits intolukasoppermann:mainfrom
0m4r wants to merge 6 commits intolukasoppermann:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
** 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"]pluscapabilities: ["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