Skip to content

Commit 340cf86

Browse files
authored
perf(compose): add stability configuration for non-Compose model types (#855)
* perf(compose): add stability configuration for non-Compose model types Adds compose_compiler_config.conf and wires it into both the library Compose convention plugin and the app module. This tells the Compose compiler to treat key model types from non-Compose modules as stable, enabling skipping optimizations for composables that accept them. Covered types: - Solana key hierarchy (Key32, PublicKey, Mint) - Financial models (Fiat, Rate, LocalFiat, MintMetadata, TokenWithBalance, TokenWithLocalizedBalance, etc.) - Social links (sealed interface + subtypes) - Bill customizations (contains ByteArray with custom equals) - JDK/Kotlin time types (java.time.Instant, kotlin.time.Instant) * refactor(compose): remove legacy Fiat, KinAmount, and related dead types Delete com.getcode.model.Fiat, GenericAmount, SocialUser, TwitterUser from libs/models and KinAmount + KinAmountExt from libs/currency. Stub chat Exchange/MessageTip/payment code with TODO(chat-v2) comments for reimplementation with OCP Fiat. Remove KinAmount overloads from PriceWithFlag and Currency.format. Clean up stability config. * chore(crypto): remove dead legacy Timelock, AgoraMemo, and PDA code These Solana program instruction files in libs/crypto are superseded by services/opencode equivalents and have zero external consumers. * chore(crypto): remove dead legacy Solana instruction/transaction code Delete 37 files (25 main + 12 tests) from libs/crypto/solana that are fully superseded by services/opencode equivalents with zero external consumers. Retains only the RPC layer (Calls, Requests, RpcConfig) and SolanaModule used by PhantomWalletController.
1 parent f5b45df commit 340cf86

65 files changed

Lines changed: 78 additions & 4461 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/flipcash/app/build.gradle.kts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,12 @@ bugsnag {
118118
}
119119
}
120120

121+
composeCompiler {
122+
stabilityConfigurationFile.set(
123+
rootProject.layout.projectDirectory.file("compose_compiler_config.conf")
124+
)
125+
}
126+
121127
kotlin {
122128
jvmToolchain {
123129
languageVersion.set(JavaLanguageVersion.of(libs.versions.android.java.get()))

build-logic/convention/src/main/kotlin/AndroidLibraryComposeConventionPlugin.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import org.gradle.api.artifacts.VersionCatalogsExtension
55
import org.gradle.kotlin.dsl.configure
66
import org.gradle.kotlin.dsl.dependencies
77
import org.gradle.kotlin.dsl.getByType
8+
import org.jetbrains.kotlin.compose.compiler.gradle.ComposeCompilerGradlePluginExtension
89

910
class AndroidLibraryComposeConventionPlugin : Plugin<Project> {
1011
override fun apply(target: Project) {
@@ -20,6 +21,12 @@ class AndroidLibraryComposeConventionPlugin : Plugin<Project> {
2021
}
2122
}
2223

24+
extensions.configure<ComposeCompilerGradlePluginExtension> {
25+
stabilityConfigurationFile.set(
26+
rootProject.layout.projectDirectory.file("compose_compiler_config.conf")
27+
)
28+
}
29+
2330
val libs = extensions.getByType<VersionCatalogsExtension>().named("libs")
2431

2532
dependencies {

compose_compiler_config.conf

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// Compose Compiler Stability Configuration
2+
// Types listed here are treated as stable by the Compose compiler,
3+
// enabling skipping optimizations for composables that accept them.
4+
//
5+
// Only types from non-Compose modules (where @Stable/@Immutable cannot
6+
// be applied directly) belong here.
7+
8+
// Kotlin / JDK time types
9+
kotlin.time.Instant
10+
java.time.Instant
11+
12+
// Solana key hierarchy (open class chain with List<Byte> internals)
13+
com.getcode.solana.keys.Key32
14+
com.getcode.solana.keys.PublicKey
15+
com.getcode.solana.keys.Mint
16+
17+
// Financial model types (services/opencode — no Compose dependency)
18+
com.getcode.opencode.model.financial.Fiat
19+
com.getcode.opencode.model.financial.Rate
20+
com.getcode.opencode.model.financial.LocalFiat
21+
com.getcode.opencode.model.financial.MintMetadata
22+
com.getcode.opencode.model.financial.TokenWithBalance
23+
com.getcode.opencode.model.financial.TokenWithLocalizedBalance
24+
com.getcode.opencode.model.financial.VmMetadata
25+
com.getcode.opencode.model.financial.LaunchpadMetadata
26+
com.getcode.opencode.model.financial.HolderMetrics
27+
com.getcode.opencode.model.financial.HolderMetrics.HolderDelta
28+
com.getcode.opencode.model.financial.SocialLink
29+
com.getcode.opencode.model.financial.SocialLink.Website
30+
com.getcode.opencode.model.financial.SocialLink.X
31+
com.getcode.opencode.model.financial.SocialLink.Telegram
32+
com.getcode.opencode.model.financial.SocialLink.Discord
33+
34+
// Bill customization (contains ByteArray, custom equals)
35+
com.getcode.opencode.model.ui.TokenBillCustomizations
36+

libs/crypto/solana/src/main/kotlin/com/getcode/solana/AgoraMemo.kt

Lines changed: 0 additions & 195 deletions
This file was deleted.

0 commit comments

Comments
 (0)