Skip to content

Add Swift and React Native public API baselines#130

Draft
kieran-osgood-shopify wants to merge 1 commit into
mainfrom
cx-add-swift-rn-api-baselines
Draft

Add Swift and React Native public API baselines#130
kieran-osgood-shopify wants to merge 1 commit into
mainfrom
cx-add-swift-rn-api-baselines

Conversation

@kieran-osgood-shopify
Copy link
Copy Markdown
Contributor

@kieran-osgood-shopify kieran-osgood-shopify commented May 15, 2026

What changes are you making?

Android currently has an API dump and API check command that helps us snapshot and determine any public API drift.

this change brings the same dump and check snapshotting ability to React Native and Swift. and wires them in as blocking CI steps when we detect a public change in order to get the CIO passing, you'll need to regenerate the snapshot so that there's no drift detected on CI.

image

How to test

Example failing CI run for a branch that hadn't rebased to include mains changes of removing ec_color_scheme

https://github.com/Shopify/checkout-kit/actions/runs/25923211711/job/76197466792?pr=130


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 platforms/swift/CHANGELOG.md
  • I have updated the SwiftPM/CocoaPods version snippets in platforms/swift/README.md (major version only)
Releasing a new Android version?
  • I have bumped the versionName in platforms/android/lib/build.gradle
  • I have updated platforms/android/CHANGELOG.md
  • I have updated the Gradle/Maven version snippets in platforms/android/README.md

Tip

See the Contributing documentation for the full release process per platform.

Copy link
Copy Markdown
Contributor Author

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

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 15, 2026

Web — Coverage Report

Lines Statements Branches Functions
Coverage: 88%
88.74% (481/542) 79.57% (113/142) 89.47% (51/57)

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 15, 2026

React Native — Coverage Report

Lines Statements Branches Functions
Coverage: 98%
98.53% (202/205) 94.91% (112/118) 100% (61/61)

@kieran-osgood-shopify kieran-osgood-shopify force-pushed the cx-add-swift-rn-api-baselines branch from 8cedc11 to e8b77cc Compare May 15, 2026 14:43
## Summary

Brings Swift and React Native to parity with Android's existing
`binary-compatibility-validator` baselining, gated by a new unified
`Breaking Changes` CI workflow.

- **Swift** — `platforms/swift/Scripts/api {check,dump}` wraps
  `xcrun swift-api-digester` and produces a JSON baseline per module
  (`ShopifyCheckoutProtocol`, `ShopifyCheckoutKit`, `ShopifyAcceleratedCheckouts`).
  Check failures print both a `diff -u` and a `-diagnose-sdk` summary.
- **React Native** — `@microsoft/api-extractor` produces
  `api/checkout-kit-react-native.api.md` from the bob-built `.d.ts` files.
  A small `scripts/prepare-api-extract.mjs` preprocess works around the
  source's hand-written ambient `*.d.ts` files (see Notes).
- **CI** — new reusable `.github/workflows/breaking-changes.yml` with
  Swift / Android / React Native jobs, wired into `ci.yml` via
  `dorny/paths-filter` and added to the `ci-required` aggregate. Android's
  legacy `Check API Surface` step in `android-test.yml` moves into the new
  workflow.
- **dev.yml** — `dev swift api {check,dump}` and `dev rn api {check,dump}`.
- **Docs** — `.github/CONTRIBUTING.md` generalised; new Swift + RN
  "Public API surface" sections.

## Test plan

- [ ] `Breaking Changes` workflow runs green on this PR's first push.
- [ ] Locally, `dev swift api check` exits 0 against committed baselines.
- [ ] Locally, `pnpm module api:check` exits 0 against committed report.
- [ ] Confirm a transient breaking change (add/remove a public symbol on a
      throwaway commit) flips both checks to failure with readable output,
      then revert.

## Notes for reviewers

- The RN `prepare-api-extract.mjs` deviation is necessary because the
  source uses `index.ts` alongside a hand-written ambient `index.d.ts`;
  after bob compiles, the emitted `lib/typescript/src/index.d.ts` re-imports
  `./index.d` which TS resolves back to itself and blows api-extractor's
  stack. The preprocess relocates the source `.d.ts` files to
  `lib/typescript/src/_types/` and rewrites the imports. Happy to switch to
  renaming the source `.d.ts` files if reviewers prefer that path.
- `temp/` (api-extractor scratch) is gitignored in this PR.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the cx-add-swift-rn-api-baselines branch from e8b77cc to e1b64e5 Compare May 15, 2026 14:51
@kieran-osgood-shopify kieran-osgood-shopify added the #gsd:50662 Rebase Checkout Kit on UCP label May 15, 2026
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