Prototype protocol-agnostic checkout events for Swift - #748
Draft
markmur wants to merge 4 commits into
Draft
Conversation
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.
Summary
CheckoutandCheckoutLinkmodels that exclude raw UCP envelopes, messages, and JSON-RPC metadataonStart,onUpdate, andonCompletemodifiers plus UIKit delegate callbacks with default implementationslineItemsas a plain array of Kit-owned line-item values without derived inventory annotationsonLinkClickin SwiftUI andcheckoutAction(for:)in UIKit, with.open,.handled, and.cancelpoliciesDesign notes
The protocol client remains behind the web bridge. Every ECP checkout change notification (buyer, line items, messages, totals, payment, and fulfillment) becomes the same public update event; registration syntax stays native to SwiftUI and UIKit.
The public checkout snapshot does not infer inventory state from protocol messages.
lineItemsremains a plain array, leaving any interpretation to the consumer.Window-open requests are similarly abstracted: consumers receive only a validated URL and return a Kit-owned action.
.openpreserves the default Safari/system behavior,.handledreports success without opening the URL again, and.cancelrejects the request. The default is.open.The package tests and public API baseline pass. The full Swift test workflow ran all package suites successfully, then stopped because this worktree does not contain generated storefront configuration for sample apps.
Known prototype constraint
CocoaPods currently compiles the generated EmbeddedCheckoutProtocol sources directly into the ShopifyCheckoutKit module. That makes a new top-level Checkout type collide with the generated protocol Checkout type. The draft intentionally keeps the desired API name so the PR can drive a decision: split ECP into its own CocoaPods module, namespace the generated protocol models, or accept a less desirable public name.