JavaScript

46 posts

figma2 min readCurated summary

Creating multi-brand design systems | Figma Blog

Design systems should provide consistency and speed without becoming rigid constraints. Shopify, Condé Nast, and Harry’s emphasize flexible architectures, brand-specific tokens, continuous iteration, and strong connections between design and code. The most effective system is one that adapts to changing needs while remaining simple enough for teams to use. ## Flexibility Over Rigidity - Overly prescriptive rules can limit creativity and push designers outside the system. - Harry’s uses layered architecture: - Base components offer simple, low-complexity solutions. - More advanced layers, such as starter kits, support custom work. - This approach makes the standard path efficient while preserving room for exploration. - Condé Nast uses modular components and design tokens to support brands such as *Vogue*, *The New Yorker*, and *Bon Appétit*. - A token can represent the same purpose while holding different values—for example, “prominent text” can map to a different font for each brand. ## Design Systems Must Evolve - Building a system is only the beginning; teams must observe how it performs in real use. - Analytics and usage data help identify which libraries and components are being used and where changes are needed. - Shopify aims to create systems that “bend but not break,” rather than polished artifacts that teams are afraid to modify. - Teams should watch how the system fails—including how it affects end users—in order to improve and reinvent it. ## Connecting Design to Code - Translating design components into code improves efficiency and reduces friction between designers and engineers. - Condé Nast stores its token system in JSON and uses a custom plugin to import and export token changes. - This setup helps the company launch new markets quickly while maintaining a smooth design-to-development handoff. - Even teams without multiple brands can start by associating a purpose with each value, such as naming a color or typography style by its intended use. - Purpose-based naming exposes unnecessary complexity and makes systems easier to evaluate. ## A System Designed for the Team - There is no universal design-system model. - The right structure depends on a team’s size, organization, technical environment, and priorities. - Systems should establish useful foundations while leaving enough flexibility for different products, brands, and future requirements. Teams should begin with simple, reusable foundations, connect design decisions to code where practical, and continually revise the system based on actual usage rather than treating it as a finished artifact.

Read original(opens in new tab)
figma2 min readCurated summary

An update on plugin security | Figma Blog

Figma disclosed vulnerabilities in the third-party Realms shim used to sandbox plugins. Although the vulnerabilities could have allowed plugins to escape their security boundaries, Figma found no evidence of exploitation after auditing published plugins. The company patched the issues, paused plugin publishing, and replaced the Realms shim with QuickJS running in WebAssembly. ## Plugin Security Boundaries Figma designed plugins so they can: - Run only after explicit user action. - Display UI in a plugin-specific dialog. - Read and modify data in the current Figma document. - Communicate with external internet services. Plugins should not be able to: - Run automatically or access data when inactive. - Obtain project or team information. - Read files other than the one in which they were launched. - Modify Figma’s interface outside their own dialog. Organization-tier administrators can also restrict plugin use through an allowlist. ## Response to the Vulnerabilities The Realms shim vulnerabilities could have allowed sandboxed code to bypass these restrictions. - Figma halted publication of new plugins and updates to existing plugins. - Existing plugin updates were disabled because live code changes propagate immediately to open clients. - Figma applied the publicly disclosed patch as soon as Agoric released it. - Privately disclosed vulnerabilities were fixed before the coordinated public disclosure. - Figma audited published plugins and found no evidence that the flaws had been exploited. Figma clarified that manual plugin review focuses primarily on user experience. Security is enforced through sandboxing rather than relying on human review, which can miss malicious behavior. ## Replacing the Realms Shim Figma permanently changed its plugin execution technology: - The Realms shim was removed entirely. - Plugins now run using QuickJS, a JavaScript virtual machine written in C and compiled to WebAssembly. - Figma’s architecture allowed the implementation to be swapped quickly because QuickJS had already been prepared as a backup. - The newly discovered Realms-specific vulnerability class no longer applies to the new implementation. Figma’s approach demonstrates the importance of defense-in-depth: sandboxing should enforce security boundaries, while rapid patching, controlled disclosure, plugin audits, and an interchangeable runtime architecture limit the impact of third-party vulnerabilities.

Read original(opens in new tab)
figma2 min readCurated summary

An in-depth sneak peak at what 5 plugin developers are cooking up | Figma Blog

Figma’s first Plugin Show & Tell highlighted the creativity and practical value emerging from its newly opened plugin ecosystem. The livestream featured five developers demonstrating tools for design-system quality checks, spell checking, icon management, documentation, typography, and even voice control. Figma encouraged developers to explore its Plugin API, build tools for their own workflows, and participate in future community events. ## Community Plugin Showcase - The event was created to: - Promote community-built plugins. - Encourage developers to experiment with the Figma Plugin API. - Give users an early look at upcoming tools and features. - The recorded livestream included live demos from five plugin developers. ## Design Quality and Productivity Tools - **Toybox Roller**, presented by Jono Kolnik, helps identify and correct design errors and inconsistencies against an organization’s design system. - **Tekeste Kidanu’s Spell Check plugin** brings spelling assistance into Figma. - Tekeste also demonstrated integrating **Cleanmock** directly into Figma. ## Icons, Documentation, and Object Management - **Iconify**, presented by Vjacheslav Trushkin, provides access to hundreds of icon sets for use in both design work and production workflows. - Jackie Chui demonstrated several utilities: - Improvements to **Find & Replace**. - A plugin for adding documentation links to components. - **Paste to Fill**, which converts pasted content into image fills. - A forthcoming tool for managing margins and object sizing within frames using configurable presets. ## Typography and Voice Control - Andrew Goodwin showed a plugin for selecting and applying typography rules. - He also demonstrated a voice interface for controlling Figma. - The project aimed to map the entire Figma Plugin API to voice commands, allowing users to operate many Figma features verbally. ## Resources for Plugin Developers Figma directed developers to several resources: - Setup guides explaining plugin architecture, canvas communication, browser APIs, and development workflows. - Official Plugin API documentation. - Figma Plugin DS, a dependency-free HTML, CSS, and JavaScript design system modeled after Figma’s interface. - Open-source plugin examples on GitHub. - FigPlug for TypeScript, React/JSX, asset bundling, and manifest generation. - A community Slack workspace for questions and collaboration. The event demonstrates that Figma plugins can automate repetitive work, connect external data and services, and tailor Figma to specialized team workflows. Developers interested in extending Figma should start with the API documentation and open-source examples, or build a private plugin for internal needs.

Read original(opens in new tab)
figma3 min readCurated summary

How to build a plugin system on the web and also sleep well at night | Figma Blog

Figma’s plugin system had to let untrusted third-party JavaScript interact with a powerful, browser-based design editor without compromising security, performance, or stability. The team evaluated several isolation strategies, ultimately favoring JavaScript Realms because they supported synchronous APIs and avoided the performance costs of a full interpreter. Figma later replaced that implementation with a JavaScript VM compiled to WebAssembly after a vulnerability was found in the third-party Realms shim. ## Why Plugin Isolation Was Difficult - Plugins needed access to Figma’s document model while remaining isolated from: - User data and credentials - Figma’s internal application state - Other plugins - The host page and browser APIs - Simply calling `eval(PLUGIN_CODE)` would execute arbitrary code in Figma’s main environment. - Figma’s architecture added constraints: - The editor relied heavily on WebGL and WebAssembly. - Parts of the interface used TypeScript and React. - Multiple users could edit files simultaneously. - Plugins also needed to remain performant and avoid breaking as Figma evolved. ## Attempt 1: The `<iframe>` Sandbox - The team first considered the browser’s standard isolation mechanism: sandboxed `<iframe>` elements. - An iframe could separate plugin code from Figma’s main page and restrict access using browser security policies. - Communication between the plugin and Figma would use mechanisms such as `postMessage`. - However, this created an important limitation: iframe communication is asynchronous. - Figma’s plugin API needed synchronous access to document operations, making an iframe-based architecture awkward and potentially expensive. - The iframe approach also introduced additional browser contexts and messaging overhead. ## Attempt 2: A JavaScript Interpreter Compiled to WebAssembly - The second approach was to run plugin code inside a JavaScript interpreter rather than the browser’s native JavaScript engine. - The interpreter could expose only explicitly approved Figma APIs, providing a strong security boundary. - Compiling the interpreter to WebAssembly offered a way to integrate it efficiently with Figma’s existing WebAssembly-heavy architecture. - The drawbacks included: - Interpreted JavaScript would be slower than native execution. - The interpreter would require ongoing maintenance and compatibility work. - Supporting the full JavaScript language and modern features would be difficult. - Although attractive from a security perspective, this approach appeared to impose too much performance and implementation cost at the time. ## Attempt 3: JavaScript Realms - Realms provided a separate JavaScript global environment within the same browser process. - Figma could execute plugin code in a distinct Realm while exposing a carefully controlled plugin API. - Unlike iframes, Realms allowed plugin calls to remain synchronous. - Unlike a custom interpreter, plugin code could use the browser’s native JavaScript engine. - The implementation required carefully controlling built-in objects and preventing plugins from escaping their isolated environment. - This approach offered the best balance of: - Native JavaScript performance - Synchronous API access - Isolation from Figma’s application state - A relatively small integration surface ## Later Security Change - After publication, Figma discovered a security vulnerability in the third-party Realms shim used by its original implementation. - The vulnerability was fixed before public disclosure, and Figma reported no evidence that it had been exploited. - Figma subsequently changed its sandbox to use a JavaScript VM written in C and compiled to WebAssembly. Figma’s experience shows that plugin systems require more than simply restricting access to browser APIs. The isolation boundary must also preserve performance and API usability, while being robust enough to withstand vulnerabilities in the underlying sandbox technology.

Read original(opens in new tab)
figma2 min readCurated summary

Tackle accessibility in your designs with these useful plugins | Figma Blog

Accessibility should be integrated into the design process so products do not exclude users with visual or motor impairments. Figma highlights four plugins that help designers evaluate color contrast, simulate color blindness, and plan keyboard focus order. Together, these tools make accessibility issues easier to identify and address before implementation. ## Color Contrast and WCAG Compliance - **Able** analyzes two selected objects and checks whether their contrast meets WCAG AA or AAA standards. - It updates dynamically as selections change and provides: - Text/background previews - Color-swapping controls - Simulations of different types of color blindness - Statistics showing how many people are affected by each condition - **Contrast Checker**, created by Stark, displays the contrast ratio between selected objects. - It provides contextual previews based on whether a layer contains text and shows: - AA/AA+ and AAA/AAA+ ratings - Contrast requirements for different font sizes - An indication of whether text larger than 18 points meets the relevant standard ## Simulating Color Blindness - **Color Blind** creates canvas-based simulations rather than only previewing colors in a separate interface. - It duplicates selected design elements and organizes them into named groups representing different types of color vision deficiency. - This lets designers inspect how an entire interface may appear to users with varying visual perceptions. ## Designing Keyboard Focus Order - **Focus Orderer** helps designers document the order in which a browser should move focus between interactive elements. - Designers can: - Add focus points to selected elements - Reorder them by dragging in the plugin interface - Automatically renumber annotations on the canvas - Tab through elements to test the intended navigation flow - The plugin connects accessibility planning directly with the design-to-development process. Designers should use these plugins alongside the Web Content Accessibility Guidelines (WCAG) to catch accessibility problems early. Teams can also explore Figma’s Plugin API to build custom accessibility tools.

Read original(opens in new tab)
figma3 min readCurated summary

Automate work. Bring in data. Extend what’s possible with Figma Plugins. | Figma Blog

Figma introduced plugins to make the platform more extensible, reliable, and accessible to both designers and developers. The goal was to let anyone with basic HTML and JavaScript skills build tools that automate repetitive work, bring real-world content into designs, and address needs such as accessibility. After six weeks of beta testing, more than 40 community plugins were publicly available, with private distribution also supported for organization customers. ## Why Figma Built a Plugin Platform - Designers already depended on plugins, but many were unreliable or insecure because they used unsupported APIs. - Designers without coding skills had to wait for someone else—or for engineering resources—to build the tools they needed. - Figma designed its plugin architecture to be: - Secure - Stable - Performant - Familiar to web developers - The company’s guiding idea was that anyone who could build a basic webpage should be able to create a Figma plugin. - Building a plugin system for a web-based design tool required significant architectural investment, intended to encourage more creators and experimentation. ## Plugin Availability and Distribution - Plugins became available to the entire Figma community after the beta. - Users could browse plugins within Figma and install them with one click. - Plugins could be launched from a design file’s right-click menu. - Figma Organization customers could: - Build private plugins - Distribute them across their company - Curate approved plugins - Install plugins on behalf of users ## Utility Plugins for Repetitive Tasks - **Similayer**, created by David Williames, selects layers with similar properties so designers can edit them in batches. - **Super Tidy**, created by Ismael González-Nicolás, renames frames and reorganizes them in the layers list. - These tools reduce manual “pixel-pushing” and help designers keep files organized. ## Generative Plugins for Content and Visuals - **Unsplash** lets designers insert Unsplash images directly into Figma files. - **Content Reel**, created by Microsoft, populates designs with searchable text, avatars, and icons. - These plugins help designers work with more realistic and contextual content instead of placeholders. ## Accessibility Plugins - **Contrast Checker**, from Stark, checks whether colors, visuals, and typography have sufficient contrast and readability. - **Color Blind**, created by Sam Mason de Caires, previews designs through eight types of color vision deficiency. - Together, these plugins help designers identify accessibility problems that may otherwise be difficult to notice. Figma’s plugin launch positioned extensibility as a core part of the product: designers could automate workflows, use realistic content, improve accessibility, and create custom tools instead of waiting for platform features or engineering support.

Read original(opens in new tab)
figma2 min readCurated summary

Behind the Plugins: Matt DesLauriers, Generative Artist & Creative Coder | Figma Blog

Matt DesLauriers combines programming and visual art to create generative systems that produce evolving, often unexpected imagery. He sees code as a creative tool that collaborates with the artist, expanding what humans can imagine and execute. His Figma plugins aim to make generative art and creative coding more accessible while encouraging designers and developers to cross traditional boundaries. ## Discovering Generative Art - DesLauriers developed an interest in both art and programming during childhood, often modifying and redesigning games instead of simply playing them. - In 2014, he began creating JavaScript demos in the browser. - These demos generated images that changed over time, introducing him to emergence—the idea that complex artwork can arise from simple rules and parameters. ## Building Interactive Works - One of his proudest projects is **LUMOS**, an interactive light sculpture created with Jean-Michel Gariepy and Steven Mengin. - The sculpture was displayed in Toronto during Ontario Place Park’s 2018 Winter Light Exhibition. - The project reflects his interest in combining code, physical environments, and public art. ## Code as a Creative Medium - DesLauriers compares code to a brush or pen: a tool for communicating ideas to a machine. - Computers can execute instructions and repeat processes millions of times without tiring. - This collaboration can overcome human limitations and produce surprising results, including unexpected ideas caused by coding errors. - His workshops and writing help others explore the connection between artistic expression and programming. ## Figma Plugins for Creative Exploration - DesLauriers is developing plugins for animation, image palette generation, and parametric design. - He hopes the tools will help designers experiment with code and developers explore design. - His broader goal is to make creative coding and generative art approachable for both programmers and non-programmers. - He particularly appreciates small usability features in Figma, such as evaluating mathematical expressions like `25 / 2` directly in numeric fields. ## A More Open Design Industry - DesLauriers advocates for tools that are open, hackable, and experimental. - He believes the boundaries between designers, coders, artists, and other creative professionals should become less rigid. - His plugins represent that philosophy by bringing computational experimentation into a familiar design environment. His work suggests that creative tools should encourage experimentation rather than separate design from technology. By making generative techniques easier to use, plugins can help more people treat code as a medium for visual expression.

Read original(opens in new tab)
figma2 min readCurated summary

Plugins are coming to Figma | Figma Blog

Figma announced the beta of its plugin platform, inviting developers to build tools that extend and improve design workflows. The initiative follows the success of Figma’s HTTP API and aims to make plugins powerful while preserving platform stability, security, performance, and compatibility. Figma initially planned a limited beta, with broader access and community-created plugins to follow. ## Opening the Figma Platform - Figma had previously launched an HTTP-based API for exporting design data and connecting Figma with other tools. - Customers used the API to: - Export icons through custom Slack commands. - Push design updates into development environments. - Maintain and distribute GitHub’s Octicons SVG library. - Independent designers and developers had also begun creating spaces for sharing Figma-related functionality. ## Designing a Stable Plugin System Figma recognized that plugins can create compatibility, security, and performance challenges. Rather than exposing internal APIs—which may change frequently—it designed dedicated third-party APIs intended to remain stable as Figma evolves. The company established several principles: - Plugins should be intuitive for all designers. - Anyone capable of building a website should be able to create a plugin. - Developers should be able to use popular programming languages. - Plugins should not harm Figma’s performance or user experience. - Figma would fully support and maintain the APIs used by plugins. ## What Plugins Could Do During the beta, developers could create plugins to: - Automate repetitive design tasks. - Speed up design workflows. - Import real-world data into Figma files. - Share plugins with teammates. Because Figma is web-based, the company expected plugins to be relatively easy to build and maintain for developers familiar with HTML and JavaScript. ## Beta Access and Future Availability - The beta was limited to a selected group of users. - Applicants were prioritized based on the ideas they wanted to build. - Figma intended to use the beta to stress-test and refine its plugin APIs. - Broader access was planned for the future. - Non-coders would eventually be able to use community-built plugins. Developers with basic web-development skills and a plugin idea were encouraged to apply for the beta.

Read original(opens in new tab)
figma2 min readCurated summary

Figma year in review: 2018 | Figma Blog

Figma’s 2018 review describes a shift from building a collaborative design tool to building an open platform and global community around it. After launching publicly in 2016 and raising $25 million in Series B funding, Figma expanded its API, attracted businesses and developers, and grew adoption among large organizations. The company concludes that partnerships, integrations, and community initiatives will remain central to its growth. ## From Product to Community - Figma marked roughly two years since its public launch in September 2016. - In 2018, its focus expanded beyond the core product to include: - The Figma Platform - API-powered integrations - Community events and resources - Adoption across departments in major organizations - Microsoft used Figma’s API to automate parts of its developer handoff process. ## The Figma Platform - Figma launched what it called the first web API for a design tool. - Its web-based architecture enabled integrations that would have been difficult with isolated desktop software. - Companies such as Uber and GitHub used the API to customize their design workflows even before the public launch. - Seven months later, businesses were being built on the platform, including paid services. ### Community-built tools - PDF exporting - Style-guide generation - Find-and-replace tools for text and layer names - JavaScript libraries for working with the Figma API ### Commercial integrations - Avocode and Zeplin connected Figma designs to developer handoff workflows. - Principle added advanced animation capabilities. - Relay for Figma pushed designs directly into codebases. - Pagedraw converted Figma designs into React. - Overflow synchronized designs for user-flow diagrams. - Haiku converted designs into production-ready components. Figma expected partnerships and additional integrations to become an even larger focus in 2019. ## Building a Global Community - Figma hosted design-system meetups in cities around the world, initially covering eight cities and later reaching 17 countries. - Events connected designers and encouraged detailed discussions about systematic design. - Figma launched DesignSystems.com to share practices and stories from teams at companies including Airbnb, GitHub, Braintree, and Segment. - The company viewed community connections and shared knowledge as an extension of its open-platform strategy. Figma’s 2018 direction was clear: continue investing in an accessible web-based tool while enabling an ecosystem of integrations, businesses, and designers around it.

Read original(opens in new tab)
figma2 min readCurated summary

Introducing: Figma’s first API Challenge | Figma Blog

Figma announced a $15,000 API challenge to encourage developers to build an open-source Figma-to-Sketch converter. The contest reflected Figma’s goal of supporting an open design ecosystem, even when that meant exporting files to a competitor. However, after community concerns, Figma paused the challenge and ultimately cancelled it in November 2018. ## Open Design Platform and API Challenge - Figma wanted to make it easier for designers to move projects between tools. - The challenge focused on building a Figma-to-Sketch exporter using Figma’s read API. - Figma positioned this as a natural extension of its existing Sketch import support. - The company was also responding to community-built API projects, such as style-guide generators and Alexa integrations. - Future challenges were intended to reward developers who open-sourced useful Figma integrations. ## Evaluation Criteria - Submissions had to export two test files: - A basic file containing common Figma objects. - A more complex file involving typography, components, styles, and prototypes. - The basic file was expected to have clearer correctness criteria. - The advanced file required subjective judgment because Figma and Sketch do not always have equivalent one-to-one features. - Judges would consider: - Accuracy of the exported designs. - Ease of use. - Creativity in translating incompatible features. - Code quality and GitHub documentation. - Code quality and documentation accounted for 5% of the score. ## Rules, Prizes, and Submissions - First place would receive $10,000; second place would receive $5,000. - Teams could include up to three people. - Entrants generally had to be over 21 and located in an eligible country. - Projects were submitted through a Google Form. - Each project needed a GitHub repository containing a README and MIT License. - The planned contest period was October 2 through November 16, 2018. ## Judges and Community Focus - The judging panel combined design expertise with experience building tools and community resources. - Members included Emily Plummer, Raph D’Amico, Cat Noone, and Roy van Rooijen. - Their backgrounds covered design systems, interaction design, accessibility tools, plugins, and design-tool development. ## Cancellation - Figma initially announced that the challenge would be paused and potentially relaunched after community feedback. - On November 19, 2018, the company said it would not proceed with any version of the challenge at that time. The challenge demonstrated Figma’s ambition to promote interoperability and an open platform, but its eventual cancellation showed the importance of addressing community concerns before incentivizing integrations involving a direct competitor.

Read original(opens in new tab)
figma3 min readCurated summary

Learn how a Microsoft designer built an Icon Library in his spare time | Figma Blog

Jackie Chui, a Microsoft designer, built a browser-based library containing more than 4,000 company icons in just three weeks. The tool unified icons across design applications, made them searchable through designer tags and engineering class names, and supported reverse searches using pasted icons. Its success came from focusing on practical user needs, leveraging familiar web technologies, and distributing a simple first version quickly. ## Researching Users and Existing Tools - Jackie interviewed Microsoft designers and observed their workflows to identify problems with existing icon management. - He evaluated IconJar, which offered organization and copy/paste functionality but lacked: - Shared, crowdsourced tagging - Browser and cloud access - Windows compatibility - These limitations led him to build a custom internal solution after hours. ## Designing and Building the Library - Jackie first created the interface in Sketch, borrowing ideas from IconJar and applying Microsoft’s Fabric design language. - With existing HTML, CSS, and JavaScript experience, he used Meteor.js to build both the frontend and backend. - A Meteor React tutorial helped him adapt a simple to-do-list database into an icon database. - Working on a concrete problem allowed him to learn development concepts while building the product. ## Extracting and Organizing Icons - Microsoft’s icons were stored in a font file, requiring users to copy and paste special Unicode icon characters into their designs. - Jackie extracted the icon files and retrieved each icon’s Unicode character. - He found Microsoft documentation containing the corresponding engineering class names. - The names were collected in Excel, converted to JSON, and imported into the application. - The resulting library let designers search for icons and copy their characters from one central location. ## Distribution and Adoption - Jackie hosted the application on Microsoft Azure. - He initially emailed the link to his team, after which word-of-mouth spread it throughout the design studio. - Users helped identify bugs and suggest features for version two. - The library quickly became part of many designers’ regular workflows. ## Future Plans - Jackie planned to convert all 4,000-plus icons into Figma components with a single click. - This would let Microsoft teams organize and search icons directly in Figma rather than through a separate browser tool. - He also hoped to release the converter more broadly so anyone could turn an icon font file into Figma components. The project demonstrates that an effective internal tool can start with focused user research, modest technical foundations, and a rapid first release. A browser-based, searchable library is a practical way to eliminate design-tool silos and create a shared source of truth for icons.

Read original(opens in new tab)
figma2 min readCurated summary

Introducing: Figma to React | Figma Blog

Figma introduced an open-source Figma-to-React converter that uses the Figma API to turn designs into React components. The project aims to keep visual design in Figma while preserving application functionality in separate code, allowing designers to update interfaces without overwriting custom logic. It also seeks to make functional code reusable across multiple designs, much like reusable React components. ## Motivation and Goals - The converter builds on growing interest in automatically transforming Figma documents into React code. - Figma identified two main objectives: - Keep component design primarily in Figma so design updates can be synchronized to a website or app. - Separate generated visual code from custom functional code, preventing design updates from overwriting application behavior. - Existing functional code should be attachable to new designs, enabling reuse across different UI layouts. - Figma open-sourced the implementation in its `figma-api-demo` GitHub repository. ## From Figma to CSS - The first technical challenge is accurately reproducing the appearance of Figma designs in React components. - The example used is a sortable list interface with multiple list items, icons, and a dark visual style. - The converter must translate Figma’s visual properties into CSS and React structure. - The article notes that there are multiple possible strategies for reproducing a design, setting up a discussion of the implementation choices that follow.

Read original(opens in new tab)
figma2 min readCurated summary

Want Figma API inspiration? Here’s 8 community-powered projects | Figma Blog

Figma’s 2018 Web API launch quickly inspired developers and designers to build integrations beyond the core product. The projects showcased range from no-code utilities, such as PDF export and style-guide generation, to developer tools for GraphQL, React rendering, and design-to-code workflows. Together, they demonstrate the API’s potential to connect Figma with everyday design and engineering processes. ## Integrations for Designers - **PDF exporter:** Gweltaz Calori created a website that exports selected Figma frames as PDFs from a pasted file URL. The project is open source on GitHub. - **Style-guide generator:** Freighter’s tool analyzes a Figma document and generates a style-guide page containing its fonts, colors, and other styles. - **Alexa integration:** Jon Gold built a voice interface capable of reading Figma comments through Alexa, illustrating unconventional uses of the API. ## Tools for Developers - **Figma.js:** Jon Gold also released an unofficial JavaScript wrapper to simplify building Figma API integrations. - **GraphQL connector:** Bernardo Raposo, with Sara Vieira, used the JavaScript library to create an open-source connector that lets developers query Figma through GraphQL. - **Figma-to-React workflows:** PageDraw introduced a React integration, while Sara Vieira demonstrated rendering React components directly from Figma through the GraphQL connector. - **Additional converter:** Florian Nagel built another Figma-to-React converter, with plans to open-source it. ## Broader Implications - The API makes design-to-development handoff easier to automate. - Community projects show potential for exporting Figma designs into other formats and frameworks. - Open-source libraries and integrations allow others to build on early experiments rather than starting from scratch. - These are third-party projects, so users must consider their permissions, reliability, and ongoing maintenance. Figma’s early API ecosystem suggests strong potential for automated design workflows, especially integrations that translate Figma files into documentation, code, and developer-ready assets.

Read original(opens in new tab)
figma3 min readCurated summary

Figma is powered by WebAssembly | Figma Blog

WebAssembly reduced Figma’s load time by more than three times after replacing its asm.js-based C++ runtime. The improvement came primarily from faster parsing, native-code compilation, and caching—not from a major reduction in compressed download size. Figma’s experience demonstrated that WebAssembly could deliver substantially faster, desktop-quality web applications, though browser support and implementation differences remained limitations. ## What WebAssembly Changes - WebAssembly is a compact binary format for machine code designed specifically for browsers. - Figma’s C++ code was a strong candidate because C++ can be compiled directly to WebAssembly. - Before WebAssembly, Figma used asm.js, a restricted JavaScript subset that represents memory as a large numeric array. - WebAssembly preserves asm.js’s limitations: - It primarily loads and stores numbers. - It must call JavaScript for browser APIs such as the DOM and networking. - It remains subject to the browser sandbox. ## Why WebAssembly Is Faster Than asm.js - **Smaller and faster to parse:** WebAssembly’s binary format transfers efficiently and parses around 20 times faster than asm.js. - **Ahead-of-time optimization:** LLVM optimizes the C++ code before compilation, allowing browsers to translate it directly to native code. - **Effective caching:** Browsers can cache the translated native code, making subsequent loads nearly free. - **Native 64-bit integer support:** WebAssembly avoids the slower emulation required by JavaScript’s 53-bit integer limitation. - **Less runtime optimization work:** Unlike JavaScript, WebAssembly does not require extensive browser optimization passes for code that was already compiled and optimized. ## Figma’s Load-Time Results - Figma measured load time from application initialization through downloading and rendering an entire design for the first time. - Switching from asm.js to WebAssembly improved load time by more than three times across document sizes. - The gain was especially meaningful because Figma users often work with large documents and switch between them frequently. - Subsequent loads could benefit further from cached WebAssembly-to-native translations. - The compressed download size improved only slightly because compressed asm.js was already close in size to compressed WebAssembly. ## Browser Support Limitations - At the time of publication, WebAssembly was enabled by default in Firefox and Chrome. - Edge and Safari were still developing their implementations. - Figma enabled WebAssembly only in Firefox because Chrome’s implementation had blocking issues, including the lack of caching for translated WebAssembly code. - These browser-specific differences affected whether the performance benefits could be consistently delivered. Figma’s results suggested that teams with substantial C or C++ code should seriously consider WebAssembly for performance-sensitive web applications. The largest benefits were faster startup and reusable native-code caching, while download-size improvements were comparatively modest.

Read original(opens in new tab)
figma2 min readCurated summary

Debugging Data Corruption with Emscripten | Figma Blog

Figma encountered intermittent save-file corruption caused by an elusive C++ memory-safety bug. Conventional debugging tools failed because the web app’s asynchronous behavior made the problem nondeterministic. A keyboard-and-mouse fuzzer eventually produced reproducible failures, while understanding Emscripten’s C++-to-JavaScript memory model helped narrow the investigation. ## Detecting the Corruption - Invalid save files appeared occasionally and could not be reliably reproduced. - Figma’s files used ZIP containers around Google FlatBuffers documents. - The serialized bytes looked mostly valid, but some offsets were unexpectedly zeroed. - Data being written to the wrong location suggested a memory-safety violation such as: - Use before initialization - Use after free - Out-of-bounds access ## Why C++ Made the Bug Difficult - C++ was valuable for Figma because it provided: - Access to libraries such as FreeType, HarfBuzz, and Skia - Low-level control suitable for graphics software - Mature debugging and optimization tools - However, C++ offers no built-in protection against memory errors. - The team tried avoiding deallocation, enabling malloc diagnostics, fixing Valgrind and Clang Analyzer findings, and upgrading the compiler, but none exposed the corruption. ## Reproducing the Failure with Fuzzing - The team planned to eliminate nondeterminism by recording user events and replaying them deterministically. - Building a complete session recorder was too large a project, so they limited inputs to keyboard and mouse events. - A fuzzer generated random event sequences and ran them against the application. - After several days, it produced multiple save failures, providing reproducible cases for debugging. ## Emscripten’s Emulated Memory Model - Figma’s C++ editor ran in the browser through Emscripten, which compiled C++ into JavaScript. - JavaScript typed arrays and shared `ArrayBuffer` storage allowed Emscripten to emulate contiguous C++ memory. - In the generated code: - Pointer loads became typed-array reads. - Pointer stores became typed-array writes. - Registers became local variables. - Shared buffers enabled pointer reinterpretation between types. - Emscripten generated asm.js-style JavaScript, using type annotations and operations optimized for JavaScript JIT compilers. The combination of deterministic fuzzing and knowledge of Emscripten’s low-level memory representation provided the path toward isolating the corruption, even though the ultimate fix was reportedly only a three-line change.

Read original(opens in new tab)