Skip to content

[Epic] Phase 5: Platform SDKs (deferred) #731

@GarthDB

Description

@GarthDB

Description

Build thin platform-specific wrappers around the Rust core library, enabling each implementation team to use the SDK in their native language.

Status: Deferred. No platform consumers are currently ready to adopt the SDK. This phase will be broken down into sub-issues when a platform team expresses readiness. The WASM build may be pulled forward if the authoring app (Phase 4) or other browser-based tooling needs it — note that Figma plugins cannot use WASM.

Scope

  • Node.js SDK (sdk/node/): napi-rs bindings with TypeScript types. Primary consumers: React Spectrum, Spectrum Web Components, build tools, authoring app (Electron)
  • WASM build (sdk/wasm/): wasm-bindgen + wasm-pack for browser/Cloudflare Workers. Fallback for environments without native addon support. Not usable in Figma plugins.
  • Swift SDK (sdk/swift/): UniFFI-generated Swift bindings + Swift Package Manager distribution. Consumer: Spectrum iOS
  • Kotlin SDK (sdk/kotlin/): UniFFI-generated Kotlin bindings. Consumer: Spectrum Android
  • UniFFI IDL (sdk/uniffi-bindings/): Shared interface definition that generates both Swift and Kotlin bindings from one source
  • TypeScript types: Full type definitions for the Node.js SDK API surface
  • Platform-specific distribution: npm package, Swift Package, Maven/Gradle artifact, wasm-pack package

Likely first deliverable

The Node.js SDK (napi-rs) is the most likely first deliverable, driven by the authoring app (Phase 4) needing Rust core access from Electron. This would be pulled forward from Phase 5 into Phase 4 when the authoring app work reaches that point.

Architecture

design-data-core (Rust)
├── Native static/dynamic lib
├── WASM (.wasm) — not usable in Figma plugins
└── CLI binary

Wrappers:
├── Node.js (napi-rs) → npm
├── Swift (UniFFI) → SPM
├── Kotlin (UniFFI) → Maven
└── WASM (wasm-bindgen) → npm/CDN

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    design-data-specDesign Data Specification / SDK effortsdk/nodeNode.js SDK (napi-rs)sdk/swiftSwift SDK (UniFFI)sdk/wasmWASM build

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions