adobe / adobe/spectrum-design-data

[Epic] Phase 5: Platform SDKs

Open
#731 1 comment 0 reactions 0 assignees View on GitHub
design-data-spec sdk/node sdk/swift sdk/wasm
Dominant language
Rust
Stars
153
Forks
35
Avg merge
7h 54m
Merged PRs (30d)
111

Description

## 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.
>
> **Revive trigger:** In addition to platform consumer readiness, Platform SDKs must wait until the Glossary/Taxonomy Backbone (name-object restructuring, registry split) reaches a stable schema — platforms cannot bind to a schema that's still moving. Tracked by #952. The Node.js SDK may be pulled forward once Phase 4 (authoring app) is unblocked, since Electron needs napi-rs access to the Rust core.

### 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

- [#715 — Distributed Design Data Architecture](https://github.com/adobe/spectrum-design-data/discussions/715) — Platform repos consuming the SDK
- [#714 — Design Data Specification](https://github.com/adobe/spectrum-design-data/discussions/714)

Contributor guide

Open the contributing guide

Research direction

This is a deferred epic, not an immediately actionable implementation. Start by reading #952 and the referenced discussions #715 and #714; work should begin only after a platform consumer is ready and the Glossary/Taxonomy Backbone schema is stable. Done means breaking the platform SDK scope into focused sub-issues, beginning with the Node.js SDK if Phase 4 needs it.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin, node.js, rust, swift, typescript, wasm
Domain
api, developer-experience, mobile, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.