Skip to content

Document and test preload reuse with instance appearance - #780

Draft
tiagocandido wants to merge 1 commit into
tiagosantos/09-15-checkoutconfigurable-configuration-requirementfrom
tiagosantos/09-15-preload-appearance-docs-and-tests
Draft

tiagocandido wants to merge 1 commit into
tiagosantos/09-15-checkoutconfigurable-configuration-requirementfrom
tiagosantos/09-15-preload-appearance-docs-and-tests

Conversation

@tiagocandido

@tiagocandido tiagocandido commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Stack

Top to bottom:

  1. This PR
  2. Configuration requirement: Replace CheckoutConfigurable runtime casts with a configuration requirement #779
  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?

Documentation and regression coverage for preload reuse, no behavior change. Evaluating SwiftUI modifiers preserves a cached preload, but that alone doesn't guarantee reuse: preload decorates the checkout URL with the global configuration's appearance, and the cache is keyed by decorated URL, so presenting with a different instance .appearance(...) misses and evicts the preload. The README didn't cover when a presentation actually reuses a preload.

  • README now separates preservation from reuse and tells SwiftUI users to keep instance appearance aligned with the global appearance when relying on preloading.
  • New presentation-level tests cover reuse with matching appearance plus instance-specific title/tint/background/close-button modifiers (same cached web view), and the miss-and-evict path when the instance appearance differs.
  • CheckoutConfigurableTests now clears the preload cache in setUp/tearDown so cache assertions are order-independent.

How to test

Run the Swift package tests. testPresentationReusesPreloadWhenInstanceAppearanceMatchesPreloadedAppearance and testPresentationWithDifferentInstanceAppearanceMissesAndEvictsPreload cover both paths; CheckoutWebViewTests still passes with the added cache hygiene.


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)

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
Evaluating SwiftUI modifiers preserves a cached preload, but reuse is
decided at presentation: preload decorates the checkout URL with the
global appearance, so an instance .appearance(...) that differs from it
produces a different decorated URL, which misses and evicts the preload.
The README now separates preservation from reuse, and presentation-level
tests cover both reuse with matching appearance plus instance-specific
chrome modifiers and the miss-and-evict path for a differing appearance.

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-preload-appearance-docs-and-tests branch from 95773f2 to c87f4d6 Compare 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