Mark POS .observe extension targets as @deprecated#4146
Mark POS .observe extension targets as @deprecated#4146vctrchu wants to merge 6 commits into2026-04-rcfrom
Conversation
🚨🚨🚨 Docs migration in progress 🚨🚨🚨We are actively migrating UI extension reference docs to MDX in the
During this migration, please be aware of the following:
Doc comments in Examples that previously lived in this repo are being moved to the What should I do?
Thanks for your patience while we complete the migration! 🙏 |
df3502f to
83aff98
Compare
Add @deprecated and @Private JSDoc annotations to all 4 POS observe extension targets: - pos.transaction-complete.event.observe - pos.cash-tracking-session-start.event.observe - pos.cash-tracking-session-complete.event.observe - pos.cart-update.event.observe Each annotation includes the deprecation version (2026-04), migration path to pos.app.ready.data + shopify.addEventListener(), and a link to the new target's documentation. pos.cart-update.event.observe also references shopify.cart.current.subscribe() as an alternative for render targets. Resolves: shop/issues-retail#26066 Epic: shop/issues-retail#26019 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…_update event reference
83aff98 to
7386990
Compare
| /** | ||
| * Fires when a cash tracking session starts. | ||
| * | ||
| * @deprecated Deprecated as of `2026-04`. Use `pos.app.ready.data` target with |
There was a problem hiding this comment.
Shouldn't these all be deprecated as of 2025-10?
| * | ||
| * @deprecated Deprecated as of `2026-04`. Use `pos.app.ready.data` target with | ||
| * `window.addEventListener('cash_tracking_session_start', callback)` instead. | ||
| * See https://shopify.dev/docs/api/pos-ui-extensions/unstable/targets/pos-app-ready-data |
| * | ||
| * @deprecated Deprecated as of `2025-10`. Use `pos.app.ready.data` target with | ||
| * `window.addEventListener('transactioncomplete', callback)` instead. | ||
| * See https://shopify.dev/docs/api/pos-ui-extensions/latest/targets/pos-app-ready-data |
There was a problem hiding this comment.
Quick question: Is this a URL to a page that currently exists?
Let's embed the URL as part of the running text. So something like "Use the [pos.app.ready.app target](link). Also, let's use the version variable in URLs like this:
/docs/api/pos-ui-extensions/{API_VERSION}/targets/pos-app-ready-data
There was a problem hiding this comment.
Good call! The pos.app.ready.data target page doesn't exist yet — it'll go live with the 2026-04 API
I've updated all 4 deprecation blocks to:
- Add "the" before
pos.app.ready.data✅ - Inline the URL in the text as
[pos.app.ready.datatarget](link)instead of a separate "See" line ✅ - Use
{API_VERSION}variable in URLs ✅
What
Adds
@deprecatedand@privateJSDoc annotations to all 4 POS observe extension targets, pointing developers topos.app.ready.data+window.addEventListener()as the replacement.Targets deprecated
pos.transaction-complete.event.observewindow.addEventListener('transactioncomplete', cb)onpos.app.ready.datapos.cash-tracking-session-start.event.observewindow.addEventListener('cashtrackingsessionstart', cb)onpos.app.ready.datapos.cash-tracking-session-complete.event.observewindow.addEventListener('cashtrackingsessioncomplete', cb)onpos.app.ready.datapos.cart-update.event.observeapi.cart.current.subscribe()onpos.app.ready.dataWhy
The observe targets are fire-and-forget — they run once per event with no persistent state, no access to APIs, and no way to correlate events.
pos.app.ready.datais a persistent background target that runs for the entire session, receives events via the standardwindow.addEventListener()Web API, and has full access to non-UI APIs (cart, storage, session, locale, connectivity, device, product search).Notes
@privateexcludes these from generated shopify.dev documentationcart_updatehas no event equivalent inPosEventMap— cart state is continuous, not discrete, so the replacement is the subscribableapi.cart.current.subscribe()patternRelated PRs
Resolves: https://github.com/shop/issues-retail/issues/26066
Epic: https://github.com/shop/issues-retail/issues/26019
Test plan
yarn buildpasses