Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrates to Coil 3 #2028

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

Migrates to Coil 3 #2028

wants to merge 5 commits into from

Conversation

JayShortway
Copy link
Member

@JayShortway JayShortway commented Jan 6, 2025

Caution

This is a draft because it bumps Kotlin to 2.0.21.

Description

This PR updates Coil to 3.0.4. The maven coordinates have changed wrt Coil 2, which means there should be no binary incompatibility issues. For reference, the official migration docs are here.

  • Migrates the code base to Coil 3.0.4. This is mostly a version bump + changing imports.
  • Migrates all previews to make use of the new PreviewHandler mechanism. Check out ImagePreviews.kt.

Motivation

The main motivation is Coil's new PreviewHandler mechanism. This gives us great control over the images used in Compose previews, without changing production code. This comes in handy when creating previews for the Paywalls V2 image component, as it should handle various sizes and fit modes correctly. This automatically protects us against regressions in combination with Emerge Snapshots.

@JayShortway JayShortway self-assigned this Jan 6, 2025
* Replaces all images in the [content] with the provided [color].
*/
@InternalRevenueCatAPI
@ExperimentalCoilApi
Copy link
Member Author

@JayShortway JayShortway Jan 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I chose to propagate @ExperimentalCoilApi so we think twice if we accidentally try to use this in production code, as that would needlessly open us up to binary incompatibility issues if this experimental API changes.

Copy link

emerge-tools bot commented Jan 6, 2025

1 build increased size

Name Version Download Change Install Change Approval
⚠️ TestPurchasesUIAndroidCompatibility
com.revenuecat.testpurchasesuiandroidcompatibility
1.0 (1) 13.1 MB ⬆️ 341.6 kB (2.68%) 34.3 MB ⬆️ 976.2 kB (2.93%) N/A

TestPurchasesUIAndroidCompatibility 1.0 (1)
com.revenuecat.testpurchasesuiandroidcompatibility

⚖️ Compare build
⏱️ Analyze build performance

Total install size change: ⬆️ 976.2 kB (2.93%)
Total download size change: ⬆️ 341.6 kB (2.68%)

Largest size changes

Item Install Size Change Download Size Change
🗑 okhttp3 ⬇️ -363.3 kB ⬇️ -128.3 kB
🗑 coil ⬇️ -246.3 kB ⬇️ -86.2 kB
🗑 androidx.compose.foundation.text2 ⬇️ -224.8 kB ⬇️ -75.0 kB
🗑 okhttp3 ⬇️ -41.5 kB ⬇️ -41.6 kB
🗑 okio.internal._BufferKt ⬇️ -24.9 kB ⬇️ -10.4 kB
View Treemap

Image of diff


🛸 Powered by Emerge Tools

Comment trigger: Size diff threshold of 100.00kB exceeded

Copy link

emerge-tools bot commented Jan 6, 2025

📸 Snapshot Test

15 modified, 115 unchanged

Name Added Removed Modified Unchanged Errored Approval
TestPurchasesUIAndroidCompatibility
com.revenuecat.testpurchasesuiandroidcompatibility
0 0 15 115 5 ⏳ Needs approval

🛸 Powered by Emerge Tools

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant