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

Upgrade to compose 1.7 #9894

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft

Conversation

jaynewstrom-stripe
Copy link
Collaborator

@jaynewstrom-stripe jaynewstrom-stripe commented Jan 13, 2025

Summary

I found a workaround for our upgrade issue here: https://issuetracker.google.com/issues/372512084#comment2

Copy link

emerge-tools bot commented Jan 13, 2025

3 builds increased size

Name Version Download Change Install Change Approval
⚠️ Stripe Identity Example
com.stripe.android.identity.example.theme1
21.5.1-theme1 (20) 3.9 MB ⬆️ 103.4 kB (2.71%) 9.2 MB ⬆️ 224.1 kB (2.5%) N/A
⚠️ Financial Connections Example
com.stripe.android.financialconnections.example
21.5.1 (210501) 5.7 MB ⬆️ 115.1 kB (2.07%) 11.2 MB ⬆️ 246.3 kB (2.26%) N/A
PaymentSheet Example
com.stripe.android.paymentsheet.example
21.5.1 (11) 8.6 MB ⬆️ 7.3 kB (0.09%) 16.3 MB ⬆️ 9.0 kB (0.06%) N/A

Stripe Identity Example 21.5.1-theme1 (20)
com.stripe.android.identity.example.theme1

⚖️ Compare build
⏱️ Analyze build performance

Total install size change: ⬆️ 224.1 kB (2.5%)
Total download size change: ⬆️ 103.4 kB (2.71%)

Largest size changes

Item Install Size Change Download Size Change
🗑 android.support.v4.media.session.MediaSessionCompat ⬇️ -50.8 kB ⬇️ -24.4 kB
kotlin.sequences.SequencesKt__SequencesJVMKt ⬆️ 42.0 kB ⬆️ 20.2 kB
📝 androidx.compose.ui.focus.FocusInteropUtils ⬆️ 27.5 kB ⬆️ 13.2 kB
kotlin.collections.SetsKt ⬆️ 26.2 kB ⬆️ 12.6 kB
📝 androidx.recyclerview.widget.ChildHelper ⬆️ 25.1 kB ⬆️ 12.0 kB
View Treemap

Image of diff

Financial Connections Example 21.5.1 (210501)
com.stripe.android.financialconnections.example

⚖️ Compare build
⏱️ Analyze build performance

Total install size change: ⬆️ 246.3 kB (2.26%)
Total download size change: ⬆️ 115.1 kB (2.07%)

Largest size changes

Item Install Size Change Download Size Change
📝 androidx.fragment.app.FragmentContainer ⬆️ 89.2 kB ⬆️ 42.0 kB
📝 androidx.compose.ui.util.ListUtilsKt ⬆️ 72.5 kB ⬆️ 34.1 kB
📝 androidx.fragment.app.SpecialEffectsController$Operation$State$Co... ⬆️ 54.2 kB ⬆️ 25.5 kB
🗑 com.stripe.android.financialconnections.features.error.ErrorScree... ⬇️ -53.1 kB ⬇️ -25.0 kB
🗑 com.stripe.android.paymentsheet.state.PaymentElementLoaderKt ⬇️ -51.5 kB ⬇️ -24.3 kB
View Treemap

Image of diff

PaymentSheet Example 21.5.1 (11)
com.stripe.android.paymentsheet.example

⚖️ Compare build
⏱️ Analyze build performance

Total install size change: ⬆️ 9.0 kB (0.06%)
Total download size change: ⬆️ 7.3 kB (0.09%)

Largest size changes

Item Install Size Change Download Size Change
🗑 androidx.compose.material.icons.filled.CloseKt ⬇️ -67.3 kB ⬇️ -30.5 kB
📝 com.google.android.gms.common.api.internal.TaskUtil ⬆️ 63.7 kB ⬆️ 28.8 kB
📝 androidx.compose.ui.text.android.TextLayoutGetRangeForRectExtensi... ⬆️ 61.1 kB ⬆️ 27.6 kB
🗑 androidx.compose.material.icons.filled.ClearKt ⬇️ -42.1 kB ⬇️ -19.0 kB
🗑 com.stripe.android.stripecardscan.camera ⬇️ -40.1 kB ⬇️ -18.1 kB
View Treemap

Image of diff


🛸 Powered by Emerge Tools

Comment trigger: Size diff threshold of 100.00kB exceeded

Copy link
Contributor

github-actions bot commented Jan 13, 2025

Diffuse output:

OLD: paymentsheet-example-release-master.apk (signature: V1, V2)
NEW: paymentsheet-example-release-pr.apk (signature: V1, V2)

          │            compressed            │          uncompressed          
          ├───────────┬───────────┬──────────┼──────────┬──────────┬──────────
 APK      │ old       │ new       │ diff     │ old      │ new      │ diff     
──────────┼───────────┼───────────┼──────────┼──────────┼──────────┼──────────
      dex │   4.1 MiB │   4.1 MiB │ +5.2 KiB │    9 MiB │    9 MiB │ +8.9 KiB 
     arsc │   2.4 MiB │   2.4 MiB │   -128 B │  2.4 MiB │  2.4 MiB │   -128 B 
 manifest │   5.1 KiB │   5.1 KiB │      0 B │ 25.7 KiB │ 25.7 KiB │      0 B 
      res │ 910.9 KiB │ 910.9 KiB │      0 B │  1.4 MiB │  1.4 MiB │      0 B 
   native │   2.6 MiB │   2.6 MiB │      0 B │    6 MiB │    6 MiB │      0 B 
    asset │   1.6 MiB │   1.6 MiB │     +3 B │  1.6 MiB │  1.6 MiB │     +3 B 
    other │   1.4 MiB │   1.4 MiB │    -42 B │  1.6 MiB │  1.6 MiB │      0 B 
──────────┼───────────┼───────────┼──────────┼──────────┼──────────┼──────────
    total │  12.9 MiB │    13 MiB │   +5 KiB │ 22.1 MiB │ 22.2 MiB │ +8.8 KiB 

 DEX     │ old   │ new   │ diff               
─────────┼───────┼───────┼────────────────────
   files │     1 │     1 │    0               
 strings │ 42782 │ 42835 │  +53 (+145 -92)    
   types │ 15351 │ 15382 │  +31 (+74 -43)     
 classes │ 12958 │ 12987 │  +29 (+50 -21)     
 methods │ 62691 │ 62796 │ +105 (+5400 -5295) 
  fields │ 41698 │ 41825 │ +127 (+3405 -3278) 

 ARSC    │ old  │ new  │ diff       
─────────┼──────┼──────┼────────────
 configs │  243 │  243 │  0         
 entries │ 6273 │ 6271 │ -2 (+0 -2)
APK
     compressed      │     uncompressed     │                                           
──────────┬──────────┼───────────┬──────────┤                                           
 size     │ diff     │ size      │ diff     │ path                                      
──────────┼──────────┼───────────┼──────────┼───────────────────────────────────────────
  4.1 MiB │ +5.2 KiB │     9 MiB │ +8.9 KiB │ ∆ classes.dex                             
  2.4 MiB │   -128 B │   2.4 MiB │   -128 B │ ∆ resources.arsc                          
 50.6 KiB │    -33 B │ 119.9 KiB │      0 B │ ∆ META-INF/MANIFEST.MF                    
   54 KiB │     -9 B │   120 KiB │      0 B │ ∆ META-INF/CERT.SF                        
  8.1 KiB │     +5 B │     8 KiB │     +5 B │ ∆ assets/dexopt/baseline.prof             
    1 KiB │     -2 B │     910 B │     -2 B │ ∆ assets/dexopt/baseline.profm            
    272 B │     +1 B │     120 B │      0 B │ ∆ META-INF/version-control-info.textproto 
  1.2 KiB │     -1 B │   1.2 KiB │      0 B │ ∆ META-INF/CERT.RSA                       
──────────┼──────────┼───────────┼──────────┼───────────────────────────────────────────
  6.6 MiB │   +5 KiB │  11.7 MiB │ +8.8 KiB │ (total)
DEX
STRINGS:

   old   │ new   │ diff           
  ───────┼───────┼────────────────
   42782 │ 42835 │ +53 (+145 -92) 
  
  +  DefaultValue: null
  +  instead of 
  + " for destination 
  + ([^/]*?|)
  + , animationSpec: 
  + , animationSpecDuration: 
  + , autoCorrectEnabled=null, keyboardType=
  + , durationNanos: 
  + , initialVelocity: 
  + , isComplete: 
  + , new instance: 
  + , platformImeOptions=nullshowKeyboardOnFocus=null, hintLocales=null)
  + , rippleAlpha=null)
  + , start: 
  + , value: 
  + . Following required arguments are missing: 
  + . Missing required arguments [
  + An instance of SeekableTransitionState has been used in different Transitions. Previous instance: 
  + Anchored drag finished
  + Cannot navigate to startDestination 
  + Cannot set route "
  + Cannot transition entry that is not in the back stack
  + Expecting fraction between 0 and 1. Got 
  + LD/N0;
  + LD/O0;
  + LD/P0;
  + LD/Q0;
  + LD/R0;
  + LD/S0;
  + LD/T0;
  + LD/U0;
  + LD/V0;
  + LD/W0;
  + LD/X0;
  + LD/Y0;
  + LD/Z0;
  + LD/a1;
  + LE/H0;
  + LFFFFFLII
  + LFFLLLI
  + LH/n;
  + LI5/H;
  + LILZL
  + LJJJLII
  + LJJLII
  + LT/x3;
  + LT/y3;
  + LT/z3;
  + LT9/l0;
  + LT9/m0;
  + LT9/n0;
  + LT9/o0;
  + LT9/p0;
  + LV0/E;
  + LV2/w;
  + LZ/C;
  + LZ/D;
  + LZ/E;
  + Landroidx/compose/material/DraggableAnchorsElement;
  + Landroidx/compose/material/a;
  + Ld/i;
  + Ld/j;
  + Ld/k;
  + Ld/l;
  + Ld/m;
  + Ld2/P;
  + Ld2/Q;
  + Ld2/S;
  + Ld2/T;
  + Le2/u;
  + Le2/v;
  + Le2/w;
  + Le2/x;
  + Le2/y;
  + Le2/z;
  + Lp1/k;
  + Lt0/Y;
  + Lt0/Z;
  + Navigation destination that matches route 
  + ReceiveChannel.consumeAsFlow can be collected just once
  + RippleConfiguration(color=
  + VFLLZLLI
  + VILJJ
  + VILLLLLLI
  + VLFLLZLL
  + VLLFL
  + VLLLLFL
  + VLLLLLLLLLIII
  + VLLLLLLLLLLIII
  + VLLLLLLLLZZZLLLLLII
  + VLLLLLLLLZZZLLLLLLII
  + VLLLLLLZFLLLI
  + VLLLLLLZFLLLLI
  + VLLLLZZLLLLLLZLZL
  + VLLLZLLLLZLLIILLI
  + VLLLZLZLLLLLLLI
  + VLLLZZLLLLLZLLLZIILLIII
  + VLLLZZLLZLLLLLLLIII
  + VLLZLLLLLLII
  + VLLZLZLLLLLLLLI
  + VLLZZLLZLLLLLLLLIII
  + VLZFLL
  + VLZLIL
  + VLZZLLLFFI
  + VZFJ
  + VZLLZLI
  + VZLZLI
  + VZZLLLFFLI
  + You cannot set a new graph on a NavController with entries on the back stack after the NavController has been destroyed. Please ensure that your NavHost has the same lifetime as your NavController.
  + You must collect the progress flow
  + You must set a start destination route
  + [LD/Z0;
  + [LE/o0;
  + [LF7/h;
  + [LI5/l;
  + [LJ0/S;
  + [LT/G0;
  + [LT/Z0;
  + [LT/d2;
  + [LT/t3;
  + [LT/y1;
  + [LT9/a0;
  + [LT9/b0;
  + [LT9/l0;
  + [LT9/o0;
  + [Ld2/Q;
  + [Ljava/lang/Boolean;
  + [Ljava/lang/Long;
  + [Lk0/r;
  + [Ll8/J1;
  + [Ll8/P1;
  + [Ll8/j0;
  + [Lp1/e;
  + [Lp6/j;
  + [Lr6/i;
  + deepLink
  + inputParams
  + layoutlib
  + onBack cancelled
  + progress nanos: 
  + snapTo() was canceled because state was changed to 
  + targetState while waiting for composition
  + try {
                    …tring()
                  }
  + uriPattern
  + ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":21,"pg-map-id":"2781d93","r8-mode":"full","version":"8.8.27"}
  
  - ) was not set. Did you use ModalBottomSheetState with the ModalBottomSheetLayout composable?
  - , autoCorrectEnabled=
  - , hintLocales=null)
  - , platformImeOptions=nullshowKeyboardOnFocus=
  - FFFL
  - LC8/a;
  - LF7/k;
  - LFFFFFLI
  - LJ0/f0;
  - LJJJLI
  - LV/d;
  - LV/e;
  - LZLLZLL
  - Ld0/d;
  - Ld0/e;
  - Ld0/f;
  - Lk0/B;
  - Lk0/C;
  - Lk0/D;
  - Lk0/E;
  - Lk0/F;
  - Lk0/G;
  - Lk0/H;
  - Ll8/c2;
  - Lm0/v;
  - Lo/E;
  - Lp6/t;
  - Lr6/l;
  - Lt/d;
  - Navigation destination that matches request 
  - SnapshotStateMap(value=
  - The density on ModalBottomSheetState (
  - VFLLZLLLLI
  - VIJJL
  - VILIILI
  - VILLLLLLII
  - VJIJF
  - VLFLZLLL
  - VLLFI
  - VLLLILLLI
  - VLLLLIILIJLL
  - VLLLLLLLLZZZLLLLIII
  - VLLLLLLLLZZZLLLLLIII
  - VLLLLLZFLI
  - VLLLLLZFLLI
  - VLLLLLZFLLLI
  - VLLLLLZFLLLLI
  - VLLLLZZLLLLLZLZL
  - VLLLZLLLI
  - VLLLZLLLLZLLIILLLLI
  - VLLLZLZLLLLLLI
  - VLLLZZLLLLLZLLLZIILLLLIII
  - VLLLZZLLZLLLLLLIII
  - VLLZLLLLLLLLII
  - VLLZLZLLLLLLLI
  - VLLZZLLZLLLLLLLIII
  - VLZZLLLFFII
  - VLZZLLZLLLLL
  - VLZZZZ
  - VZFLL
  - VZLLJJFLJLL
  - VZLLZLLLII
  - VZLZLLLI
  - VZZLLLFFLII
  - [LD/L0;
  - [LE/n0;
  - [LF7/j;
  - [LI5/k;
  - [LJ0/T;
  - [LT/A0;
  - [LT/S0;
  - [LT/a2;
  - [LT/q3;
  - [LT/u1;
  - [LT9/W;
  - [LT9/X;
  - [LT9/h0;
  - [LT9/k0;
  - [Ld2/M;
  - [Lk0/w;
  - [Ll8/M1;
...✂
ARSC
ENTRIES:

   old  │ new  │ diff       
  ──────┼──────┼────────────
   6273 │ 6271 │ -2 (+0 -2) 
  - style/FloatingDialogTheme
  - style/FloatingDialogWindowTheme

@jaynewstrom-stripe jaynewstrom-stripe force-pushed the jaynewstrom/compose-1.7.4 branch 3 times, most recently from bdba073 to 70eb92a Compare January 13, 2025 16:21
@jaynewstrom-stripe jaynewstrom-stripe force-pushed the jaynewstrom/compose-1.7.4 branch from 4fe9ae2 to 3a35e9d Compare January 13, 2025 18:53
@jaynewstrom-stripe jaynewstrom-stripe force-pushed the jaynewstrom/compose-1.7.4 branch 2 times, most recently from 77361ee to bd8f43c Compare January 13, 2025 20:01
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is bad! Need to figure out how to fix!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Same!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Cursors went missing in these screenshots, but still exist in production!

@jaynewstrom-stripe jaynewstrom-stripe force-pushed the jaynewstrom/compose-1.7.4 branch from bd8f43c to d427efa Compare January 13, 2025 21:15
@jaynewstrom-stripe jaynewstrom-stripe added the dependencies Pull requests that update a dependency file label Feb 21, 2025
@@ -1,5 +1,5 @@
ext.versions = [
accompanist : '0.34.0',
accompanist : '0.36.0',
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Should be 0.37.2

@@ -374,6 +375,7 @@ internal class PaymentMethodEndToEndTest {
.isEqualTo(PaymentMethod.Type.WeChatPay)
}

@Ignore
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Please revert this change

@@ -110,6 +111,13 @@ internal class NavigationHandler<T : Any>(
}

private fun navigateWithDelay(action: () -> Unit) {
if (Build.FINGERPRINT == "robolectric") {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This seems like something we shouldn't do. Please revert this.

@@ -330,7 +332,7 @@ private fun TitleContent(title: String, subtitle: String?, isEnabled: Boolean, c
if (contentDescription != null) {
this.contentDescription = contentDescription
}
}
}.focusable(),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Why does this need to be focusable?

.padding(4.dp)
.fillMaxHeight()
) {
Text(
stringResource(id = R.string.stripe_view_more),
modifier = Modifier
.clickable {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Why are we adding a second click listener here? The one on the row should be enough.

@@ -68,6 +69,7 @@ internal fun SavedPaymentMethodRowButton(
promoText = null,
onClick = onClick,
modifier = modifier
.focusable()
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think this is duplicated, given we also set it where we pass the modifier to.

@@ -38,10 +38,19 @@ internal data class CardPaymentMethodDetails(

internal data class UsBankPaymentMethodDetails(
override val id: String,
val last4: String = "6789",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Why is this change in this PR?

@@ -74,14 +74,15 @@ internal class ManageActivityTest {
@Test
fun `selecting a payment method returns updated selection`() = launch {
managePage.assertLpmIsNotSelected(PaymentMethodFixtures.CARD_ID)
managePage.selectPaymentMethod(PaymentMethodFixtures.CARD_ID)
managePage.selectPaymentMethodWithLast4("4242")
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These changes should be reverted.

@@ -318,13 +321,13 @@ internal class CustomerSessionPaymentSheetActivityTest {
verticalModePage.assertPrimaryButton(isEnabled())

verticalModePage.clickViewMore()
managePage.waitUntilVisible()
managePage.waitUntilVisible(customLast4 = cards[0].card!!.last4)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Please revert these changes.

import com.stripe.android.uicore.elements.DROPDOWN_MENU_CLICKABLE_TEST_TAG
import com.stripe.android.uicore.elements.TEST_TAG_DROP_DOWN_CHOICE

internal class EditPage(
private val composeTestRule: ComposeTestRule
) {
fun waitUntilVisible() {
// composeTestRule.waitUntil {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Please revert these changes.

}
// composeTestRule
// .onNodeWithTag(UPDATE_PM_SCREEN_TEST_TAG)
// .assertExists()
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Please revert these changes.

@@ -98,12 +107,14 @@ internal class EditPage(
}

fun onRemoveButton(): SemanticsNodeInteraction {
return composeTestRule.onNodeWithTag(UPDATE_PM_REMOVE_BUTTON_TEST_TAG)
return composeTestRule.onNodeWithText("Remove") // .performClick()
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Please revert these changes.

@tillh-stripe tillh-stripe force-pushed the jaynewstrom/compose-1.7.4 branch from b8b64ee to bbd2310 Compare February 27, 2025 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant