Skip to content

Add package-size PR comments#309

Merged
kiftio merged 1 commit into
mainfrom
dk/measure-package-size-on-prs
Jun 22, 2026
Merged

Add package-size PR comments#309
kiftio merged 1 commit into
mainfrom
dk/measure-package-size-on-prs

Conversation

@kiftio

@kiftio kiftio commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Stack Context

This stack adds a non-required package-size signal for Checkout Kit PRs, then trims RN package-only test files that the size report makes visible.

Why?

PR builds currently do not surface published artifact-size changes. This adds a PR-only workflow that measures package artifacts from the PR base SHA and PR head SHA, then updates a sticky PR comment with base/head/delta rows.

The workflow intentionally stays out of CI Required. It adds extra latency by measuring both sides of the diff, but it does not block merging when the required CI suite is green.

What gets measured?

Platform Technique What it tells us Limitation
Web Runs pnpm build, then pnpm pack, and reports the generated npm tarball size. Size of the @shopify/checkout-kit package as published to npm. Not a consumer bundle-size metric. It does not account for app bundler settings, tree shaking, minification, gzip/brotli at delivery, or downstream usage patterns.
React Native Runs pnpm module clean, pnpm module build, then pnpm pack inside the RN module package. Size of the @shopify/checkout-kit-react-native npm package: JS outputs, TS/source files, native bridge source, podspec/Gradle config, and bundled protocol package files. Not full client impact. The RN package declares native Checkout Kit dependencies that CocoaPods/Gradle resolve later, so this number does not include the Swift Checkout Kit SDK or Android com.shopify:checkout-kit AAR in a consuming app.
Android Runs ./gradlew :lib:assembleRelease and reports platforms/android/lib/build/outputs/aar/lib-release.aar. Size of the Android library artifact consumers receive from Maven. Not final app binary size. Consuming apps may shrink, optimize, or package the dependency differently with R8/resource shrinking and their own build settings.

How are deltas calculated?

The workflow checks out both sides of the PR:

  • base: github.event.pull_request.base.sha
  • head: github.event.pull_request.head.sha

That makes the delta stack-aware. For example, a stacked PR compares against its parent PR branch rather than origin/main, so the comment reflects only the package-size impact of that PR in the stack.

If base measurement fails, the workflow still measures the head and renders the base/delta cells as unavailable.

Why no Swift yet?

Swift/SPM does not publish a single binary artifact in this repo. It ships source/resources through Swift Package Manager, and the CocoaPods spec is also source-based. We could cheaply measure an SPM or CocoaPods source/resource payload, but that is a different kind of signal from npm tarballs and the Android AAR.

For now this PR skips Swift so the comment stays focused on directly published package artifacts. A follow-up could add a clearly labeled Swift — SPM source/resource payload row if that signal becomes useful.

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 changed the title Measure package size on PRs Add package-size PR comments Jun 22, 2026
@kiftio kiftio marked this pull request as ready for review June 22, 2026 09:32
@kiftio kiftio requested a review from a team as a code owner June 22, 2026 09:32
@kiftio kiftio force-pushed the dk/measure-package-size-on-prs branch from 3b2e7d0 to d7ee161 Compare June 22, 2026 09:36
@github-actions

github-actions Bot commented Jun 22, 2026

Copy link
Copy Markdown

Package Size

Platform Artifact Base Head Delta
Web npm tarball 56.7 KiB 56.7 KiB 0 B
React Native npm tarball 93.9 KiB 93.9 KiB 0 B
Android release AAR 613.4 KiB 613.4 KiB 0 B

Measured from the PR base SHA and PR head SHA. This comment reports package artifact sizes only; it is not a final app binary-size report.

@kiftio kiftio force-pushed the dk/measure-package-size-on-prs branch 3 times, most recently from 9c69f52 to 72199ea Compare June 22, 2026 10:37
Assisted-By: devx/2d407d2d-edb2-4884-b788-a5b3151d00f1
@kiftio kiftio force-pushed the dk/measure-package-size-on-prs branch from 72199ea to fd696cf Compare June 22, 2026 10:51
@kiftio kiftio merged commit eef347c into main Jun 22, 2026
20 checks passed
@kiftio kiftio deleted the dk/measure-package-size-on-prs branch June 22, 2026 11:16
markmur pushed a commit that referenced this pull request Jun 22, 2026
Assisted-By: devx/2d407d2d-edb2-4884-b788-a5b3151d00f1
@markmur markmur added the #gsd:50662 Rebase Checkout Kit on UCP label Jun 24, 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.

2 participants