Skip to content

feat(pos): add storage.keys subscribable types to Storage interface#4235

Draft
vctrchu wants to merge 1 commit into2026-04-rcfrom
vchu/storage-keys-subscribable-types
Draft

feat(pos): add storage.keys subscribable types to Storage interface#4235
vctrchu wants to merge 1 commit into2026-04-rcfrom
vchu/storage-keys-subscribable-types

Conversation

@vctrchu
Copy link
Copy Markdown
Contributor

@vctrchu vctrchu commented Mar 27, 2026

What

Add Subscribable, StorageKeys types and optional keys property to the POS Storage interface for reactive cross-target communication.

Why

Extensions running across multiple targets (tile, modal, background) need to share state reactively. The storage.keys subscribable enables one target to subscribe to a key and react when another target updates it via set() or delete().

TAG PR: ui-api-design#1416
Issue: shop/issues-retail#26020

How

Single file change to packages/ui-extensions/src/surfaces/point-of-sale/types/storage.ts:

  • Subscribable<Value> — interface with readonly value + subscribe(callback) returning unsubscribe function
  • StorageKeys<T> — mapped type where each key maps to Subscribable<T | undefined>
  • keys?: StorageKeys<BaseStorageTypes> — optional property on Storage interface, available on API version 2026-04+

Companion PR

  • pos-mobile runtime: shop/world#554969 — signal registry + proxy + storageApi integration

Base Branch

2026-04-rc — ships with the 2026-04 API version.

Add Subscribable, StorageKeys types and optional keys property to the
POS Storage interface. Each key is exposed as Subscribable<T | undefined>
for reactive cross-target communication within the same extension.

Available on API version 2026-04 and later.

Part of: shop/issues-retail#26020
TAG PR: Shopify/ui-api-design#1416

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

🚨🚨🚨 Docs migration in progress 🚨🚨🚨

We are actively migrating UI extension reference docs to MDX in the areas/platforms/shopify-dev zone of the monorepo. This impacts docs for the following surfaces:

During this migration, please be aware of the following:

.doc.ts files are being deprecated. Changes to .doc.ts files in this repo will not be reflected in the new MDX-based docs. If you need to update docs for a reference that has already been migrated, make your changes directly in the areas/platforms/shopify-dev zone of the monorepo instead.

Doc comments in .ts source files (the comment blocks above types and functions) are also affected. Generating docs from these comments currently requires a newer version of the @shopify/generate-docs library that isn't yet available. Updates to doc comments may not produce the expected output until the migration is complete.

Examples that previously lived in this repo are being moved to the areas/platforms/shopify-dev zone of the monorepo and should be authored there going forward.

What should I do?

  • If your PR includes changes to .doc.ts files, doc comments, or examples, please reach out to us in #devtools-proj-templated-refs so we can help ensure your updates are captured correctly.
  • If your PR is limited to source code changes (non-docs), you can ignore this notice.

Thanks for your patience while we complete the migration! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant