|
| 1 | +# Expo 58 Kotlin alignment experiment |
| 2 | + |
| 3 | +This isolated Android fixture explores a fully aligned Kotlin toolchain without |
| 4 | +changing Clerk's shipped defaults. It is pinned to published `@clerk/expo@4.7.1`, |
| 5 | +not the current monorepo package, so the experiment remains independent of changes |
| 6 | +to Clerk's native dependencies and package split. |
| 7 | + |
| 8 | +It complements [#9791](https://github.com/clerk/javascript/pull/9791), which addresses |
| 9 | +the immediate release-build failure, and |
| 10 | +[#9955](https://github.com/clerk/javascript/pull/9955), which makes native components |
| 11 | +optional. [#9974](https://github.com/clerk/javascript/pull/9974) separately enables |
| 12 | +optimization in the existing Android integration workflow. |
| 13 | + |
| 14 | +## Configuration |
| 15 | + |
| 16 | +| Input | Version | |
| 17 | +| ---------------------------------- | ------------------------------------------- | |
| 18 | +| Expo | 58.0.0-preview.8 | |
| 19 | +| React Native | 0.88.0-rc.2 | |
| 20 | +| React / React DOM | 19.3.0 | |
| 21 | +| Clerk Expo | 4.7.1 | |
| 22 | +| Clerk native API / UI | 1.1.8, selected by the pinned Clerk package | |
| 23 | +| Kotlin / resolved Compose compiler | 2.4.20 | |
| 24 | +| SavedState Compose | 1.3.3 | |
| 25 | + |
| 26 | +The official `expo-build-properties` plugin selects Kotlin 2.4.20 and enables |
| 27 | +minification and resource shrinking. The fixture-local pnpm patch adds SavedState |
| 28 | +Compose, removes six stdlib exclusions, and removes the local, cross-project and |
| 29 | +config-plugin metadata-check bypasses. It does not add a `dontwarn` rule. |
| 30 | + |
| 31 | +The dependency reports from the original experiment resolved both the Kotlin |
| 32 | +compiler and Compose compiler to 2.4.20 even though Clerk's plugin declaration still |
| 33 | +says 2.1.20. No additional Compose patch was necessary on this exact stack. |
| 34 | + |
| 35 | +Only this fixture consumes the patch. It is not an installation recommendation for |
| 36 | +older Expo SDKs and does not change Clerk's declared Expo support range. The |
| 37 | +expected Expo peer-range warning is retained rather than hidden. |
| 38 | + |
| 39 | +## Run |
| 40 | + |
| 41 | +Use Node 24.15 or newer, pnpm, JDK 17 and an Android SDK. Start an arm64 emulator; |
| 42 | +this fixture intentionally builds only `arm64-v8a` to match the original test. |
| 43 | + |
| 44 | +From this directory: |
| 45 | + |
| 46 | +```sh |
| 47 | +pnpm install |
| 48 | +``` |
| 49 | + |
| 50 | +Create an ignored `.env` with your own development-instance publishable key: |
| 51 | + |
| 52 | +```dotenv |
| 53 | +EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_REPLACE_WITH_YOUR_DEVELOPMENT_KEY |
| 54 | +``` |
| 55 | + |
| 56 | +```sh |
| 57 | +pnpm android --device YOUR_EMULATOR_NAME |
| 58 | +``` |
| 59 | + |
| 60 | +The publication fixture also passed a fresh pnpm install and optimized build. |
| 61 | +Expo CLI subsequently tried to open a development-client URI that this standalone |
| 62 | +release does not handle; the build and installation succeeded. If that occurs, |
| 63 | +open the installed app from the emulator launcher. |
| 64 | + |
| 65 | +Expo manages prebuild and compilation. After changing native configuration, run |
| 66 | +`pnpm prebuild:android` before building again. The fixture refuses a production |
| 67 | +publishable key. No secret key or test credentials belong in this directory. |
| 68 | + |
| 69 | +Confirm that `android/app/build/outputs/mapping/release/mapping.txt` is nonempty. |
| 70 | +Inspect the generated merged R8 configuration to confirm no |
| 71 | +`-dontwarn kotlin.MustUseReturnValues` rule was added, and inspect the patched |
| 72 | +Clerk Gradle/plugin files and generated app Gradle file for absent |
| 73 | +`-Xskip-metadata-version-check` flags. Dependency reports should confirm the actual |
| 74 | +compiler artifacts, not only the configuration property. |
| 75 | + |
| 76 | +## Manual authentication checks |
| 77 | + |
| 78 | +Use an account in the development instance: |
| 79 | + |
| 80 | +1. Sign in through the native form. Complete any verification challenge. |
| 81 | +2. Select **Check session token**; the app reports presence, never the token. |
| 82 | +3. Force-stop and reopen the app; check that the session and token remain available. |
| 83 | +4. Open the profile, unmount/remount it, and confirm it renders again. |
| 84 | +5. Sign out and confirm the signed-out form returns. |
| 85 | + |
| 86 | +The original isolated alignment build passed these checks on an API 36 arm64 |
| 87 | +emulator. Independent development Backend API reads confirmed the session changed |
| 88 | +from active to removed. The development test account was deleted afterwards. |
| 89 | +The publication fixture removes the original probe's test-user deletion control; |
| 90 | +manage any account cleanup separately in your development instance. |
| 91 | + |
| 92 | +## Comparison evidence |
| 93 | + |
| 94 | +These are isolated reproduction results against published Clerk 4.7.1, not a full |
| 95 | +execution of #9791 or a certification of all patch releases and auth providers. |
| 96 | +Both small-fix variants kept minification and resource shrinking enabled. |
| 97 | + |
| 98 | +| Expo | React Native | Stock | Remove exclusions | Exact annotation rule | |
| 99 | +| ---------------- | ------------ | ------------------------------------------- | ----------------- | --------------------- | |
| 100 | +| 54.0.37 | 0.81.5 | Missing annotation | Build/auth pass | Build/auth pass | |
| 101 | +| 55.0.31 | 0.83.10 | Missing annotation | Build/auth pass | Build/auth pass | |
| 102 | +| 56.0.23 | 0.85.3 | Missing annotation | Build/auth pass | Build/auth pass | |
| 103 | +| 57.0.25 | 0.86.3 | Missing annotation | Build/auth pass | Build/auth pass | |
| 104 | +| 58.0.0-preview.8 | 0.88.0-rc.2 | SavedState failure, then missing annotation | Build/auth pass | Build/auth pass | |
| 105 | + |
| 106 | +The Expo 54 narrow/runtime checks used native Clerk 1.1.9; the 55–58 checks used |
| 107 | +1.1.8. On 58, both small fixes included SavedState Compose 1.3.3; the 1.4.0 addition |
| 108 | +from #9791 was separately build/startup-tested on 57. The 58 consumer-rule build |
| 109 | +produced identical DEX to the authenticated app-level-rule APK, and merged R8 |
| 110 | +configuration confirmed delivery from Clerk's library. |
| 111 | + |
| 112 | +Older SDKs emitted metadata warnings with both small fixes. The 55 narrow build |
| 113 | +completed R8 with 353 warnings before a disk-full interruption during lint; its |
| 114 | +successful unchanged retry reused R8 outputs and must not be called warning-free. |
| 115 | +The fully aligned 58 experiment had no R8 metadata warnings. |
| 116 | + |
| 117 | +## Boundaries and next decision |
| 118 | + |
| 119 | +The native publication floor, older Expo compiler constraints and supported |
| 120 | +version policy still need maintainer direction. This fixture is deliberately not |
| 121 | +a conditional production implementation based on SDK version. |
| 122 | + |
| 123 | +Physical devices, Google/Apple OAuth, passkeys, long-duration token expiry, |
| 124 | +existing-install session migration and the full upstream CI suite are outside |
| 125 | +this experiment's completed coverage. The package versions are pinned directly; |
| 126 | +transitive JavaScript dependencies are resolved at install time, following the |
| 127 | +existing standalone fixture convention. Record the generated lockfile when |
| 128 | +comparing a later dependency graph. |
0 commit comments