Skip to content

feat(web): add deterministic wallet element lifecycle - #799

Draft
rsomlette wants to merge 1 commit into
wallets/release-03-merchant-contractfrom
wallets/release-04-lifecycle
Draft

rsomlette wants to merge 1 commit into
wallets/release-03-merchant-contractfrom
wallets/release-04-lifecycle

Conversation

@rsomlette

Copy link
Copy Markdown

Review purpose

Implement one deterministic custom-element lifecycle state machine against a Kit-internal fake adapter. This keeps public lifecycle semantics reviewable without a World, Core, or Portable Wallets runtime dependency.

Stacked on wallets/release-03-merchant-contract.

Changes

  • add a private adapter interface and injectable fake factory
  • coalesce synchronous configuration writes
  • avoid restarts for equal effective configuration
  • cancel stale generations and ignore late outcomes
  • expose loading, ready, unavailable, and normalized error mirrors
  • notify callbacks first and dispatch equivalent composed DOM events
  • isolate merchant callback exceptions
  • cancel work on disconnect and restart cleanly on remount
  • cover multiple instances, route-style updates, and pre-upgrade properties
  • make server module evaluation safe when DOM globals are unavailable
  • keep thrown adapter messages out of public errors

Non-goals

  • a real Portable Wallets import or private runtime URL
  • wallet configuration network requests
  • cartUpdated() forwarding
  • skeleton markup, styling, or transitions
  • PW-specific error mapping
  • payment, completion, recovery, or navigation

Related tickets

Primary: https://github.com/shop/issues-checkout/issues/14701

Related:

The fake-adapter ticket remains open until the adapter matches the final PW injection interface and all required development scenarios are represented.

Validation

  • web lint and typecheck
  • 275 web tests
  • production package build
  • multi-page sample build
  • publint
  • package snapshot comparison

This branch has not been deployed

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

Labels

#gsd:50662 Rebase Checkout Kit on UCP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant