Skip to content

Split Android checkout protocol module#315

Draft
kiftio wants to merge 1 commit into
mainfrom
06-22-split_android_checkout_protocol
Draft

Split Android checkout protocol module#315
kiftio wants to merge 1 commit into
mainfrom
06-22-split_android_checkout_protocol

Conversation

@kiftio

@kiftio kiftio commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Goal

Split the Android Embedded Checkout Protocol ownership out of Checkout Kit into its own module.

This sits before the follow-up PR that hides the raw communication client/process entrypoints from Kit consumers. The aim here is to make protocol a reusable layer that Kit can depend on, without Kit owning all of the protocol models and dispatch code directly.

New Architecture

  • :checkout-protocol owns the typed ECP models, CheckoutProtocol descriptors/client, JSON-RPC request handling helpers, serializers, protocol tests, and protocol API baseline.
  • :lib remains the Checkout Kit host layer: WebView presentation, lifecycle, default native handling, and Kit API surface.
  • :lib depends on :checkout-protocol with api project(":checkout-protocol"), so normal checkout-kit consumers still receive the protocol types transitively.
  • The Kotlin package remains com.shopify.checkoutkit to avoid turning this into a package rename. The new Gradle namespace is com.shopify.checkoutkit.protocol.
  • The new protocol module publishes as com.shopify:checkout-protocol; com.shopify:checkout-kit depends on it.

Implementation Notes

  • Adds include ":checkout-protocol" and a new Android library build for the protocol module.
  • Moves protocol-owned code out of :lib: generated models, CheckoutProtocol, ExtendsSerializer, protocol tests, Robolectric config, and API baseline.
  • Keeps :lib focused on host behaviour and wires it to the protocol module through Gradle.
  • Adds CheckoutProtocolInternalApi for lower-level helpers that need to cross the new Gradle module boundary.
  • Updates React Native local Android workflows so local validation publishes and resolves both checkout-protocol and checkout-kit from Maven Local.

Most of the diff is file movement and API baseline movement. Behaviour is intended to stay the same in this PR.

Stack Notes

This PR creates the module split only.

The next branch in the stack tightens the public Kit API by hiding raw CheckoutCommunicationClient.process(...) usage from consumers and routing them toward typed callbacks, for example client.on(CheckoutProtocol.start) { ... }.

Validation

Run while preparing this stack:

shadowenv exec --dir /Users/danielkift/src/github.com/Shopify/checkout-kit -- /opt/dev/bin/dev rn test android
shadowenv exec --dir /Users/danielkift/src/github.com/Shopify/checkout-kit -- /opt/dev/bin/dev android test
shadowenv exec --dir /Users/danielkift/src/github.com/Shopify/checkout-kit -- /opt/dev/bin/dev android check
shadowenv exec --dir /Users/danielkift/src/github.com/Shopify/checkout-kit -- /opt/dev/bin/dev android build

Assisted-By: devx/6488e3d0-f47f-4171-a1c4-d2432b2a653c

kiftio commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@kiftio kiftio mentioned this pull request Jun 22, 2026
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant