Add Universal Checkout Web event consumer - #840
Draft
tiagocandido wants to merge 1 commit into
Draft
tiagocandido wants to merge 1 commit into
tiagocandido wants to merge 1 commit into
Conversation
tiagocandido
added this pull request to stack #845
September 28, 2026 15:20
tiagocandido
force-pushed
the
uc-web-events
branch
from
September 28, 2026 15:45
ccd44f4 to
ea0c3f8
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes are you making?
Add the experimental
@shopify/checkout-kit/universalentry point and<shopify-universal-checkout>element. It handles per-shop ready requests and batched start/update/complete/error messages while exposing protocol-neutral lifecycle events, immutable per-shop snapshots and an aggregate committed before listeners run.Malformed members are isolated from valid siblings, with safe field-path diagnostics and decode telemetry. Revision/session ordering, partial completion, explicit terminal events and presentation close are tracked separately. Error events stay on the element instead of reaching global error handlers. The standard entry point does not register the Universal element.
Reuse the standard checkout error mapper so errors retain their code and message when severity is omitted. Duplicate resource errors advance revision ordering without redispatching events or recounting telemetry. Preserve native and custom DOM listener overloads alongside typed lifecycle listeners; close events expose null detail. Regression coverage exercises each behavior.
This remains a draft: real producer error behavior, startup gaps and resource retry/replacement/ejection semantics still need agreement or live validation. The API is explicitly experimental.
How to test
Run
dev web check,dev protocol test typescript,dev telemetry test typescript, anddev web snapshot compare. The full stack passes 440 Web, 88 protocol and 14 telemetry tests, with lint/typechecks, builds, package verification and the package snapshot check. Synthetic fixtures cover ready batches, changed-shop updates, partial/full completion, malformed siblings, terminal boundaries, scoped errors and immutability.tophat results
An earlier integrated browser run received start and update events for two shops, reached a ready-for-complete state for one shop, and verified close/reopen with fresh events. No payment was submitted; live completion and producer errors remain unverified. The public-base revision is separately covered by the local checks above.