这是indexloc提供的服务,不要输入任何密码
Skip to content

Remove data modifier from payments-core. #11127

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jaynewstrom-stripe
Copy link
Collaborator

@jaynewstrom-stripe jaynewstrom-stripe commented Jul 14, 2025

Summary

This removes the data modifier from all classes in payments-core.

Motivation

data classes are hard to maintain binary compatibility with moving forward. If merchants needed access to any of these copy methods, we will add them back as needed (or introduce a toBuilder/newBuilder pattern).

Copy link
Contributor

github-actions bot commented Jul 14, 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.7 MiB │  4.7 MiB │ -77 B │  10.4 MiB │  10.4 MiB │ -172 B 
     arsc │  2.5 MiB │  2.5 MiB │   0 B │   2.5 MiB │   2.5 MiB │    0 B 
 manifest │  5.8 KiB │  5.8 KiB │   0 B │  30.1 KiB │  30.1 KiB │    0 B 
      res │  918 KiB │  918 KiB │   0 B │   1.5 MiB │   1.5 MiB │    0 B 
   native │  3.5 MiB │  3.5 MiB │   0 B │   8.5 MiB │   8.5 MiB │    0 B 
    asset │  1.6 MiB │  1.6 MiB │ +24 B │   1.6 MiB │   1.6 MiB │  +24 B 
    other │  198 KiB │  198 KiB │ -11 B │ 373.9 KiB │ 373.9 KiB │    0 B 
──────────┼──────────┼──────────┼───────┼───────────┼───────────┼────────
    total │ 13.4 MiB │ 13.4 MiB │ -64 B │  24.9 MiB │  24.9 MiB │ -148 B 

         │         raw          │           unique           
         ├───────┬───────┬──────┼───────┬───────┬────────────
 DEX     │ old   │ new   │ diff │ old   │ new   │ diff       
─────────┼───────┼───────┼──────┼───────┼───────┼────────────
   files │     2 │     2 │    0 │       │       │            
 strings │ 53161 │ 53160 │   -1 │ 49305 │ 49304 │ -1 (+1 -2) 
   types │ 19094 │ 19094 │    0 │ 17174 │ 17174 │  0 (+0 -0) 
 classes │ 14514 │ 14514 │    0 │ 14514 │ 14514 │  0 (+0 -0) 
 methods │ 73922 │ 73918 │   -4 │ 70986 │ 70982 │ -4 (+2 -6) 
  fields │ 48156 │ 48156 │    0 │ 47032 │ 47032 │  0 (+0 -0) 

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  242 │  242 │  0   
 entries │ 6327 │ 6327 │  0
APK
    compressed     │    uncompressed    │                               
───────────┬───────┼───────────┬────────┤                               
 size      │ diff  │ size      │ diff   │ path                          
───────────┼───────┼───────────┼────────┼───────────────────────────────
   4.2 MiB │ -78 B │   9.3 MiB │ -172 B │ ∆ classes.dex                 
   9.3 KiB │ +24 B │   9.1 KiB │  +24 B │ ∆ assets/dexopt/baseline.prof 
  51.4 KiB │ -10 B │ 121.7 KiB │    0 B │ ∆ META-INF/MANIFEST.MF        
 482.5 KiB │  +1 B │   1.1 MiB │    0 B │ ∆ classes2.dex                
  54.8 KiB │  -1 B │ 121.7 KiB │    0 B │ ∆ META-INF/CERT.SF            
───────────┼───────┼───────────┼────────┼───────────────────────────────
   4.8 MiB │ -64 B │  10.7 MiB │ -148 B │ (total)
DEX
STRINGS:

   old   │ new   │ diff       
  ───────┼───────┼────────────
   49305 │ 49304 │ -1 (+1 -2) 
  
  + ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":21,"pg-map-id":"6cc7e3c","r8-mode":"full","version":"8.8.34"}
  
  - LLILZI
  - ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":21,"pg-map-id":"90d127a","r8-mode":"full","version":"8.8.34"}
  

METHODS:

   old   │ new   │ diff       
  ───────┼───────┼────────────
   70986 │ 70982 │ -4 (+2 -6) 
  
  + e8.b g() → Bundle
  + e8.b l() → c
  
  - J7.r1 equals(Object) → boolean
  - J7.r1 hashCode() → int
  - J7.r1 toString() → String
  - e8.b E() → c
  - e8.b g(b, int, h, boolean, int) → b
  - e8.b l() → Bundle

@jaynewstrom-stripe jaynewstrom-stripe force-pushed the jaynewstrom/payments-core-data branch from 10d9fa4 to 76422fc Compare July 14, 2025 18:28
@jaynewstrom-stripe jaynewstrom-stripe changed the title Remove data modifier from PI/SI/PM. Remove data modifier from payments-core. Jul 14, 2025
cttsai-stripe
cttsai-stripe previously approved these changes Jul 14, 2025
@@ -697,7 +697,7 @@ internal class StripeKtxTest {
}
}

private inline fun <reified ApiObject : StripeModel>
private inline fun <reified ApiObject : Any>
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we marked some as Parcelable and some as Any?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

StripeModel is just a marker interface.

Thinking through this more, I think the correct answer is to remove equals/hashcode from StripeModel. Those methods are always available anyways.

cttsai-stripe
cttsai-stripe previously approved these changes Jul 15, 2025
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.

2 participants