Upgrading
Every @platform/sdk release so far is within the 1.x line and backwards-compatible — each
adds API without removing or changing existing behaviour, so upgrading is a version bump, not a
migration. This page records what each release adds and will carry a step-by-step migration when the
first breaking (major) change lands.
The general process
Section titled “The general process”When a new version ships:
- Bump
@platform/sdkand re-runnpm install. - Run your typecheck. Because the SDK is strict TypeScript, a removed or renamed API surfaces as a compile error pointing straight at the call site — the fastest possible upgrade signal.
- Skim the
CHANGELOG.mdshipped with the package (node_modules/@platform/sdk/CHANGELOG.md) for entries between your old and new versions, looking for Removed and Changed.
1.3.0 — ergonomic helpers (optional)
Section titled “1.3.0 — ergonomic helpers (optional)”1.3.0 is additive: nothing was removed, so upgrading is a bump + npm install. It adds three
conveniences you can adopt incrementally, each replacing a hand-rolled pattern:
conn.activate(el)— one call for a surface or modal body’s bring-up, replacing theobserve(el)+ready()(+ arequestAnimationFrame) you wrote by hand. See Embedded surfaces and Modals.surfaceHost(platform, opts)— a single-slot host whoserender(params)embeds first and re-parameterises after, folding in theembedSurfaceembed-or-update branch and thereadyrejection handler. See Embedded surfaces.defineStateChannel(namespace)— a typed, named handle overplatform.state/conn.stateso a cross-frame namespace and its shape are declared once. See Cross-frame state.
One behaviour change worth knowing: StateWriter.set now suppresses a write whose snapshot is
structurally equal to the last one sent. This removes redundant cross-frame traffic and lets a
reactive binding push the seed snapshot harmlessly (no “already seeded” guard). A genuinely changed
snapshot is always delivered; a suppressed equal write simply does not appear in the ops traffic log.
When a breaking change ships
Section titled “When a breaking change ships”The wire protocol is backwards-compatible within a major version, so the upgrades that need real work are major bumps. When the first one lands, this page will carry a step-by-step migration — what was removed and what to do instead — keyed to its changelog entry.