Skip to content

fix(pos): make Storage.current required - #4642

Open
henryStelle wants to merge 1 commit into
2026-10-rcfrom
pos-storage-current-required
Open

fix(pos): make Storage.current required#4642
henryStelle wants to merge 1 commit into
2026-10-rcfrom
pos-storage-current-required

Conversation

@henryStelle

Copy link
Copy Markdown
Contributor

What

Changes the POS Storage.current property from optional (current?:) to required for the 2026-10 RC.

Why

storage.current is always populated by the host — it is not actually optional. Marking it optional makes client code awkward: values come back as possibly undefined when that's inaccurate, forcing unnecessary optional chaining and non-null assertions.

Changes

  • packages/ui-extensions/src/surfaces/point-of-sale/types/storage.ts: current?:current:
  • Regenerated the affected portion of the POS 2026-10 reference docs data
  • Removed now-unnecessary optional chaining in ui-extensions-tester POS factory tests (the tester's createStorage already always provides current)
  • Changeset (minor — breaking changes are gated by API version, and this API is new in the 2026-10 RC)

Checks

  • yarn build
  • yarn test -- packages/ui-extensions-tester/ ✅ (98 passed)
  • yarn type-check
  • yarn lint — only pre-existing failures on gitignored local build artifacts (packages/ui-extensions/{checkout,customer-account}/preact.js), unrelated to this change

The host always populates storage.current, so marking it optional
forced consumers to handle a 'possibly undefined' case that can
never occur.
@henryStelle
henryStelle requested a review from vctrchu August 20, 2026 19:16
@henryStelle
henryStelle marked this pull request as ready for review August 20, 2026 19:16
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.

2 participants