Skip to content

Replace CheckoutConfigurable runtime casts with a configuration requirement - #779

Draft
tiagocandido wants to merge 1 commit into
preload-configuration-invalidationfrom
tiagosantos/09-15-checkoutconfigurable-configuration-requirement
Draft

tiagocandido wants to merge 1 commit into
preload-configuration-invalidationfrom
tiagosantos/09-15-checkoutconfigurable-configuration-requirement

Conversation

@tiagocandido

@tiagocandido tiagocandido commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Stack

Top to bottom:

  1. Preload docs and tests: Document and test preload reuse with instance appearance #780
  2. This PR
  3. Preload invalidation on configure: [Swift][Bug]: discard preload cache on configuration changes (matches Kotlin) #680
  4. Base: [Swift][Bug]: swiftui modifiers should be instance scoped #681

What changes are you making?

Follow-up to #681. The CheckoutConfigurable modifier defaults downcast self to ShopifyCheckout and silently returned any other conformer unchanged. The protocol now requires var configuration: ShopifyCheckoutKit.Configuration { get set }, so the shared helper copies self and updates the copy's configuration without casts — modifiers work for any value-semantic conformer, and chaining, value semantics, and isolation from the global configuration are unchanged.

Two deliberate public API changes, acceptable in the 4.0 prerelease: any external conformer now gets a compile error until it stores a configuration (instead of a silent no-op), and ShopifyCheckout.configuration becomes public with a settable value. The API baseline is regenerated for both.

How to test

Run the Swift package tests. testModifiersApplyToAnyConformerWithoutCasts covers a test-local conformer receiving all five modifiers; the existing CheckoutConfigurableTests cover ShopifyCheckout capture and global-config isolation. The public API baseline check passes against the committed baselines.


Before you merge

Important

  • I've added tests to support my implementation
  • I have read and agree with the Contribution Guidelines
  • I have read and agree with the Code of Conduct
  • I've updated the relevant platform README (platforms/swift/README.md and/or platforms/android/README.md) — no README change needed here; the modifier docs stay accurate. Preload documentation lands in the stacked PR above.

Releasing a new Swift version?
  • I have bumped the version in ShopifyCheckoutKit.podspec
  • I have bumped the version in platforms/swift/Sources/ShopifyCheckoutKit/ShopifyCheckoutKit.swift
  • I have updated the SwiftPM/CocoaPods version snippets in platforms/swift/README.md (major version only)
Releasing a new Embedded Checkout Protocol version?
  • I have bumped embeddedCheckoutProtocolAndroid in platforms/android/gradle/libs.versions.toml
  • I have updated protocol/languages/kotlin/embedded-checkout-protocol/api/embedded-checkout-protocol.api if the public API changed
Releasing a new Android version?
  • I have bumped checkoutKitAndroid in platforms/android/gradle/libs.versions.toml
  • I have updated the Gradle/Maven version snippets in platforms/android/README.md

🤖 Generated with Claude Code

@github-actions github-actions Bot added the #gsd:50662 Rebase Checkout Kit on UCP label Sep 15, 2026
@tiagocandido
tiagocandido added this pull request to stack #781 September 16, 2026 08:58
@tiagocandido
tiagocandido removed this pull request from stack #781 September 16, 2026 12:13
…rement

CheckoutConfigurable's modifier defaults downcast self to ShopifyCheckout
and silently returned other conformers unchanged. The protocol now
requires a mutable configuration, so the shared helper copies self and
updates it without casts, and modifiers work for any value-semantic
conformer. ShopifyCheckout.configuration becomes public to satisfy the
requirement; the public API baseline is regenerated accordingly.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Assisted-By: devx/b61614bc-75f6-4454-beb1-4d30f281e365
@tiagocandido
tiagocandido force-pushed the tiagosantos/09-15-checkoutconfigurable-configuration-requirement branch from e87eb38 to 278c84f Compare September 16, 2026 12:32
@tiagocandido
tiagocandido changed the base branch from kieran-osgood/08-20-fixswiftuimodifiersshouldbeinstancescoped to preload-configuration-invalidation September 16, 2026 12:32
@tiagocandido
tiagocandido added this pull request to stack #725 September 16, 2026 12:33
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