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

feat: compose sdk #149

Merged
merged 31 commits into from
Jun 26, 2024
Merged

feat: compose sdk #149

merged 31 commits into from
Jun 26, 2024

Conversation

CAMOBAP
Copy link
Collaborator

@CAMOBAP CAMOBAP commented Apr 10, 2024

Open question

jitpack doesn't allow to customize published dependency names. For now, we have com.github.hcaptcha:hcaptcha-android-sdk:x.y.z which will become com.github.hcaptcha.hcaptcha-android-sdk:sdk:x.y.z and one more artifact will be added com.github.hcaptcha.hcaptcha-android-sdk:compose:u.v.w

There are two possible solutions to this problem:

  1. move out of jitpack to mvncentral or other repository
  2. create a separate GitHub repository something like hcaptcha-android-jetpack

Both approaches have their benefits and drawbacks:

  • N1 - no extra repository need and configuration will become more comples (need to find a way to disable jutpack publishing for compose module)
  • N2 - build system stays clean
  • N2 - sdk and compose more isolated, but we cannot share configuration and build system scripts

Personally to me there is no ideal solution but N2 looks a bit better

@CAMOBAP CAMOBAP requested review from e271828- and DSergiu April 10, 2024 21:31
@CAMOBAP CAMOBAP self-assigned this Apr 10, 2024
Copy link

github-actions bot commented Apr 10, 2024

Diffuse report:

OLD: sdk-main.aar
NEW: sdk-pr.aar

 AAR      │ old       │ new       │ diff   
──────────┼───────────┼───────────┼────────
      jar │  51.9 KiB │  51.7 KiB │ -120 B 
 manifest │     411 B │     411 B │    0 B 
      res │  78.3 KiB │  78.3 KiB │    0 B 
    other │     930 B │     930 B │    0 B 
──────────┼───────────┼───────────┼────────
    total │ 131.4 KiB │ 131.3 KiB │ -120 B 

 JAR     │ old │ new │ diff       
─────────┼─────┼─────┼────────────
 classes │  37 │  37 │  0 (+0 -0) 
 methods │ 507 │ 507 │  0 (+3 -3) 
  fields │ 163 │ 162 │ -1 (+1 -2)
AAR
 size     │ diff   │ path          
──────────┼────────┼───────────────
 51.7 KiB │ -120 B │ ∆ classes.jar 
──────────┼────────┼───────────────
 51.7 KiB │ -120 B │ (total)
JAR
METHODS:

   old │ new │ diff      
  ─────┼─────┼───────────
   507 │ 507 │ 0 (+3 -3) 
  
  + com.hcaptcha.sdk.HCaptchaWebViewHelper <init>(Handler, Context, HCaptchaConfig, HCaptchaInternalConfig, IHCaptchaVerifier, HCaptchaWebView)
  + com.hcaptcha.sdk.HCaptchaWebViewHelper access_200(HCaptchaWebViewHelper) → IHCaptchaVerifier
  + com.hcaptcha.sdk.HCaptchaWebViewHelper_HCaptchaWebClient <init>(HCaptchaWebViewHelper, Handler)
  
  - com.hcaptcha.sdk.HCaptchaWebViewHelper <init>(Handler, Context, HCaptchaConfig, HCaptchaInternalConfig, IHCaptchaVerifier, HCaptchaStateListener, HCaptchaWebView)
  - com.hcaptcha.sdk.HCaptchaWebViewHelper getListener() → HCaptchaStateListener
  - com.hcaptcha.sdk.HCaptchaWebViewHelper_HCaptchaWebClient <init>(HCaptchaWebViewHelper, Handler, HCaptchaStateListener)
  

FIELDS:

   old │ new │ diff       
  ─────┼─────┼────────────
   163 │ 162 │ -1 (+1 -2) 
  
  + com.hcaptcha.sdk.HCaptchaDialogFragment listener: HCaptchaStateListener
  
  - com.hcaptcha.sdk.HCaptchaWebViewHelper listener: HCaptchaStateListener
  - com.hcaptcha.sdk.HCaptchaWebViewHelper_HCaptchaWebClient listener: HCaptchaStateListener

@CAMOBAP CAMOBAP force-pushed the feature/compose-sdk branch from 2572375 to 29f7efa Compare April 10, 2024 22:27
@CAMOBAP CAMOBAP force-pushed the feature/compose-sdk branch from 29f7efa to bb94810 Compare April 11, 2024 06:02
@DSergiu DSergiu changed the title Feature/compose sdk feat: compose sdk Apr 16, 2024
Copy link

github-actions bot commented Apr 17, 2024

Benchmark report:

Test name Time ms. (median) Allocations (median)
com.hcaptcha.sdk.HCaptchaBenchmarkTest.EMULATOR_UNLOCKED_benchmarkInvisibleVerification +350.29 -6
com.hcaptcha.sdk.HCaptchaBenchmarkTest.EMULATOR_UNLOCKED_benchmarkInvisibleVerificationColdRun +391.67 +99
com.hcaptcha.sdk.HCaptchaBenchmarkTest.EMULATOR_UNLOCKED_benchmarkInvisibleSetup +0.63 +96
com.hcaptcha.sdk.HCaptchaDebugInfoTest.EMULATOR_UNLOCKED_benchmarkDebugInfo -5.66 +556
com.hcaptcha.sdk.HCaptchaDebugInfoTest.EMULATOR_UNLOCKED_benchmarkDebugSys +32.13 +1
com.hcaptcha.sdk.HCaptchaWebViewHelperTest.EMULATOR_UNLOCKED_benchmarkWebViewLoad +353.86 +96

@CAMOBAP CAMOBAP marked this pull request as draft April 18, 2024 13:38
@CAMOBAP
Copy link
Collaborator Author

CAMOBAP commented Apr 18, 2024

I will proceed with one repository solution and implement test publishing and

  • rename module compose -> sdk-compose
  • move compose example as separated module example-app-compose
  • Add a note to README about dependency name changes

@CAMOBAP CAMOBAP marked this pull request as ready for review May 16, 2024 21:43
@CAMOBAP CAMOBAP force-pushed the feature/compose-sdk branch from 4be95c3 to 16fbe35 Compare May 17, 2024 15:33
@CAMOBAP CAMOBAP force-pushed the feature/compose-sdk branch from d02fbdd to d21b1b8 Compare May 19, 2024 13:06
@CAMOBAP CAMOBAP force-pushed the feature/compose-sdk branch 3 times, most recently from e1f381a to 17ebeb2 Compare June 12, 2024 12:13
@CAMOBAP CAMOBAP force-pushed the feature/compose-sdk branch from 17ebeb2 to 8521021 Compare June 12, 2024 12:43
Copy link

@CAMOBAP CAMOBAP enabled auto-merge (squash) June 26, 2024 14:42
@CAMOBAP CAMOBAP merged commit 08b8399 into main Jun 26, 2024
12 checks passed
@CAMOBAP CAMOBAP deleted the feature/compose-sdk branch June 26, 2024 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants