Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Build for the Future, Stay Compatible with the ...

Build for the Future, Stay Compatible with the Past

Heapcon 2026 talk, binary compatibility, ABI, tooling, Kotlin

Nebojša Vukšić

November 13, 2026

Transcript

122 slides
  1. 01 / THE PROMISE We Build for the Future. SOLID

    Clean Architecture DDD Modularity Design Patterns
  2. 03 / THE CONTEXT The IDE Ecosystem IDE Platform API

    compiled against public API Plugins built on CLIENT runs inside JetBrains IDEs
  3. 03 / THE CONTEXT The IDE Ecosystem IDE Platform PUBLIC

    APIS API Editor PSI Project model VFS Swing UI Jewel / Compose UI compiled against public API Plugins built on CLIENT runs inside JetBrains IDEs
  4. 03 / THE CONTEXT The IDE Ecosystem IDE Platform PUBLIC

    APIS API Editor PSI Project model VFS Swing UI Jewel / Compose UI compiled against public API Plugins built on CLIENT runs inside JetBrains IDEs all built on the same Platform IntelliJ IDEA and more PyCharm WebStorm GoLand
  5. 03 / THE CONTEXT The IDE Ecosystem IDE Platform PUBLIC

    APIS API Editor PSI Project model VFS Swing UI Jewel / Compose UI compiled against public API Plugins built on CLIENT JetBrains & third-party your-plugin.jar + thousands more runs inside JetBrains IDEs all built on the same Platform Kotlin Python Docker IntelliJ IDEA and more PyCharm WebStorm GoLand
  6. 04 / THE CONTRACT Compiled Once, Runs on Many PLATFORM

    API 2026.1 build 261 compiled against CLIENT your-plugin.jar PLATFORM 2026.2 API build 262 PLATFORM 2026.3 API build 263
  7. 04 / THE CONTRACT Compiled Once, Runs on Many PLATFORM

    2026.1 your-plugin.jar API build 261 CLIENT compiled against 2026.1 · build 261 PLATFORM 2026.2 API build 262 PLATFORM 2026.3 API build 263
  8. 04 / THE CONTRACT Compiled Once, Runs on Many PLATFORM

    2026.1 API build 261 PLATFORM 2026.2 API build 262 runs, NO recompiling your-plugin.jar CLIENT compiled against 2026.1 · build 261 PLATFORM 2026.3 API build 263
  9. 04 / THE CONTRACT Compiled Once, Runs on Many PLATFORM

    2026.1 API build 261 PLATFORM 2026.2 API build 262 PLATFORM 2026.3 API build 263 runs, NO recompiling your-plugin.jar CLIENT compiled against 2026.1 · build 261
  10. 04 / THE CONTRACT Which API Stays Stable? Stays stable

    Public API with no @ApiStatus annotation stays binary compatible across versions No Breaking API Changes Rare exceptions, released only in major versions with migration guidance.
  11. 04 / THE CONTRACT Which API Stays Stable? Stays stable

    Public API Can change or be removed @ApiStatus.Internal with no @ApiStatus annotation stays binary compatible across versions not for plugins: changes without notice No Breaking API Changes may change or break between versions Rare exceptions, released only in major versions with migration guidance. @ApiStatus.Experimental @ApiStatus.ScheduledForRemoval(version) will be removed in a stated version
  12. 05 / THE RULES Not All Compatibility Is Equal SOURCE

    BINARY BEHAVIORAL Source compatibility Binary compatibility Behavioral compatibility
  13. 05 / THE RULES Not All Compatibility Is Equal SOURCE

    BINARY BEHAVIORAL Source compatibility Binary compatibility Behavioral compatibility Will existing source code still compile? USUALLY CAUGHT BY Rebuilding the client with the new library
  14. 05 / THE RULES Not All Compatibility Is Equal SOURCE

    BINARY BEHAVIORAL Source compatibility Binary compatibility Behavioral compatibility Will the software still behave as expected? USUALLY CAUGHT BY Unit, integration, and UI tests
  15. 05 / THE RULES Not All Compatibility Is Equal SOURCE

    BINARY BEHAVIORAL Source compatibility Binary compatibility Behavioral compatibility Will already-compiled code still work? NEEDS explicit ABI compatibility checks
  16. OVERVIEW What Weʼll Cover 1 Safely Changing Function Signature 2

    Safely Removing Public API 3 Data class usage in public API 4 Which Tools Can We Use? 5 How Can AI Help?
  17. 06 / THE TICKET A Small Feature Request JEWEL-1026 Add

    support for fractional palette colors Islands Dark · ManyIslandsDark.theme.json "colors": { "Gray3": "#393B40", "Gray2.5": "#323438", "Gray2.25": "#2E3033", "Gray2": "#2B2D30", "Gray1.5": "#26282b", "Gray1.25": "#222326", "Gray1": "#1E1F22", "Gray0.75": "#191A1C", "Gray0.5": "#17181A", "Gray0.25": "#151517", "Gray0": "#000000", … Islands Dark · JetBrains blog, December 2025
  18. 06 / THE TICKET A Small Feature Request JEWEL-1026 Add

    support for fractional palette colors Fractional palette color A color between two palette steps Islands Dark · ManyIslandsDark.theme.json "colors": { "Gray3": "#393B40", "Gray2.5": "#323438", "Gray2.25": "#2E3033", "Gray2": "#2B2D30", "Gray1.5": "#26282b", "Gray1.25": "#222326", "Gray1": "#1E1F22", "Gray0.75": "#191A1C", "Gray0.5": "#17181A", "Gray0.25": "#151517", "Gray0": "#000000", … Gray1 Gray1.25 Gray1.5 Gray2
  19. 06 / THE TICKET The Palette API Today public class

    ThemeColorPalette( public val gray: List<Color>, … blue, green, red, yellow, orange, purple, teal public val rawMap: Map<String, Color>, ) { … 16 more functions: gray(), blue(), blueOrNull(), …, lookup() public fun grayOrNull(index: Int): Color? = gray.getOrNull(index - 1) … companion object } grayOrNull(1) → Gray1 #1E1F22
  20. 06 / THE TICKET What the JVM Sees public class

    ThemeColorPalette(…) { public fun grayOrNull(index: Int): Color? = gray.getOrNull(index - 1) } grayOrNull(1) → Gray1 #1E1F22
  21. 06 / THE TICKET What the JVM Sees public class

    ThemeColorPalette(…) { public fun grayOrNull(index: Int): Color? = gray.getOrNull(index - 1) } $ javap -cp out org.jetbrains.jewel.foundation.theme.ThemeColorPalette Compiled from "ThemeColorPalette.kt" public final class org.jetbrains.jewel.foundation.theme.ThemeColorPalette { … public final androidx.compose.ui.graphics.Color grayOrNull-ijrfgN4(int); … } grayOrNull(1) → Gray1 #1E1F22
  22. 06 / THE TICKET What the JVM Sees public class

    ThemeColorPalette(…) { public fun grayOrNull(index: Int): Color? = gray.getOrNull(index - 1) } $ javap -cp out org.jetbrains.jewel.foundation.theme.ThemeColorPalette Compiled from "ThemeColorPalette.kt" public final class org.jetbrains.jewel.foundation.theme.ThemeColorPalette { … public final androidx.compose.ui.graphics.Color grayOrNull-ijrfgN4(int); … } public final function cannot be extended unless explicitly marked as open grayOrNull(1) → Gray1 #1E1F22
  23. 06 / THE TICKET What the JVM Sees public class

    ThemeColorPalette(…) { public fun grayOrNull(index: Int): Color? = gray.getOrNull(index - 1) } $ javap -cp out org.jetbrains.jewel.foundation.theme.ThemeColorPalette Compiled from "ThemeColorPalette.kt" public final class org.jetbrains.jewel.foundation.theme.ThemeColorPalette { … public final androidx.compose.ui.graphics.Color grayOrNull-ijrfgN4(int); … } Return type: Color is a value class, the cheap wrapper for a primitive type grayOrNull(1) → Gray1 #1E1F22
  24. 06 / THE TICKET What the JVM Sees public class

    ThemeColorPalette(…) { public fun grayOrNull(index: Int): Color? = gray.getOrNull(index - 1) } grayOrNull(1) → Gray1 $ javap -cp out org.jetbrains.jewel.foundation.theme.ThemeColorPalette Compiled from "ThemeColorPalette.kt" public final class org.jetbrains.jewel.foundation.theme.ThemeColorPalette { … public final androidx.compose.ui.graphics.Color grayOrNull-ijrfgN4(int); … } -ijrfgN4:Kotlin mangles method names involving value classes to avoid JVM signature clashes #1E1F22
  25. 06 / THE TICKET What the JVM Sees public class

    ThemeColorPalette(…) { public fun grayOrNull(index: Int): Color? = gray.getOrNull(index - 1) } $ javap -cp out org.jetbrains.jewel.foundation.theme.ThemeColorPalette Compiled from "ThemeColorPalette.kt" public final class org.jetbrains.jewel.foundation.theme.ThemeColorPalette { … public final androidx.compose.ui.graphics.Color grayOrNull-ijrfgN4(int); … } Int translates to primitive int. Parameter names aren't part of the JVM signature grayOrNull(1) → Gray1 #1E1F22
  26. 06 / THE TICKET What the JVM Sees public class

    ThemeColorPalette(…) { public fun grayOrNull(index: Int): Color? = gray.getOrNull(index - 1) } grayOrNull(1) → Gray1 $ javap -cp out org.jetbrains.jewel.foundation.theme.ThemeColorPalette Compiled from "ThemeColorPalette.kt" public final class o.j.j.f.t.ThemeColorPalette { … public final a.c.u.g.Color grayOrNull-ijrfgN4(int); … } Package aliases: a.c.u.g = androidx.compose.ui.graphics, o.j.j.f.t = org.jetbrains.jewel.foundation.theme #1E1F22
  27. 06 / THE TICKET What the JVM Sees public class

    ThemeColorPalette(…) { public fun grayOrNull(index: Int): Color? = gray.getOrNull(index - 1) } grayOrNull(1) → Gray1 $ javap -cp out org.jetbrains.jewel.foundation.theme.ThemeColorPalette public final a.c.u.g.Color grayOrNull-ijrfgN4(int); The contract: At runtime, already-compiled plugins invoke this method using its exact JVM signature #1E1F22
  28. 06 / THE TICKET Back to the Ticket JEWEL-1026 Add

    support for fractional palette colors public class ThemeColorPalette(…) { … public fun grayOrNull(index: Int): Color? = … … } CALL SITE palette.grayOrNull(1) → Gray1 ✓
  29. 06 / THE TICKET Back to the Ticket JEWEL-1026 Add

    support for fractional palette colors public class ThemeColorPalette(…) { … public fun grayOrNull(index: Int): Color? = … … } CALL SITE palette.grayOrNull(1) → Gray1 ✓ palette.grayOrNull(1.25) → Gray1.25 ✗
  30. 06 / THE TICKET Back to the Ticket JEWEL-1026 Add

    support for fractional palette colors public class ThemeColorPalette(…) { … public fun grayOrNull(index: Int): Color? = … … } CALL SITE palette.grayOrNull(1) → Gray1 ✓ palette.grayOrNull(1.25) → Gray1.25 ✗ The signature has to change
  31. 07 / THE TEMPTING CHANGE Just Add a Parameter? public

    class ThemeColorPalette(…) { … public fun grayOrNull(index: Int): Color? = … … } javap output public final a.c.u.g.Color grayOrNull-ijrfgN4(int);
  32. 07 / THE TEMPTING CHANGE Just Add a Parameter? public

    class ThemeColorPalette(…) { … public fun grayOrNull(index: Int, fractional: Int = 0): Color? = … … } javap output changes − public final a.c.u.g.Color grayOrNull-ijrfgN4(int); + public final a.c.u.g.Color grayOrNull-6MYuD4A(int, int); + public static a.c.u.g.Color grayOrNull-6MYuD4A$default(o.j.j.f.t.ThemeColorPalette, int, int, int, j.l.Object);
  33. 07 / THE TEMPTING CHANGE Just Add a Parameter? public

    class ThemeColorPalette(…) { … public fun grayOrNull(index: Int, fractional: Int = 0): Color? = … … } javap output changes − public final a.c.u.g.Color grayOrNull-ijrfgN4(int); the one-parameter method is gone + public final a.c.u.g.Color grayOrNull-6MYuD4A(int, int); the JVM has no default arguments: two int s, and a new name + public static a.c.u.g.Color grayOrNull-6MYuD4A$default(o.j.j.f.t.ThemeColorPalette, int, int, int, j.l.Object); synthetic helper that fills in fractional = 0
  34. 07 / THE TEMPTING CHANGE It Still Compiles public class

    ThemeColorPalette(…) { … public fun grayOrNull(index: Int, fractional: Int = 0): Color? = … … } CALL SITE val background = JewelTheme.colorPalette.grayOrNull(1) ✓ still compiles
  35. 07 / THE TEMPTING CHANGE It Still Compiles public class

    ThemeColorPalette(…) { … public fun grayOrNull(index: Int, fractional: Int = 0): Color? = … … } CALL SITE val background = JewelTheme.colorPalette.grayOrNull(1) ✓ Source compatible change ✓ still compiles
  36. 07 / THE TEMPTING CHANGE But Binary Compatibility Gets Broken

    INTELLIJ PLATFORM · BEFORE JEWEL-1026 INTELLIJ PLATFORM · AFTER JEWEL-1026 API API class ThemeColorPalette class ThemeColorPalette public final a.c.u.g.Color grayOrNull-ijrfgN4(int); public final a.c.u.g.Color grayOrNull-6MYuD4A(int, int); new public static a.c.u.g.Color grayOrNull-6MYuD4A$default( o.j.j.f.t.ThemeColorPalette, int, int, int, j.l.Object); new compiled against CLIENT CLIENT your-plugin.jar calls grayOrNull-ijrfgN4(int) compiled before JEWEL-1026
  37. 07 / THE TEMPTING CHANGE But Binary Compatibility Gets Broken

    INTELLIJ PLATFORM · BEFORE JEWEL-1026 INTELLIJ PLATFORM · AFTER JEWEL-1026 API API class ThemeColorPalette class ThemeColorPalette public final a.c.u.g.Color grayOrNull-ijrfgN4(int); public final a.c.u.g.Color grayOrNull-ijrfgN4(int); public final a.c.u.g.Color grayOrNull-6MYuD4A(int, int); new public static a.c.u.g.Color grayOrNull-6MYuD4A$default( o.j.j.f.t.ThemeColorPalette, int, int, int, j.l.Object); new java.lang.NoSuchMethodError: 'androidx.compose.ui.graphics.Color org.jetbrains.jewel.foundation.theme.ThemeColorPalette.grayOrNull-ijrfgN4(int)' at com.example.plugin.PalettePanelKt.panelBackground(PalettePanel.kt:6) CLIENT ✗ not here CLIENT your-plugin.jar calls grayOrNull-ijrfgN4(int) compiled before JEWEL-1026
  38. 07 / THE TEMPTING CHANGE But Binary Compatibility Gets Broken

    INTELLIJ PLATFORM · BEFORE JEWEL-1026 INTELLIJ PLATFORM · AFTER JEWEL-1026 API API class ThemeColorPalette class ThemeColorPalette public final a.c.u.g.Color grayOrNull-ijrfgN4(int); public final a.c.u.g.Color grayOrNull-ijrfgN4(int); public final a.c.u.g.Color grayOrNull-6MYuD4A(int, int); new public static a.c.u.g.Color grayOrNull-6MYuD4A$default( o.j.j.f.t.ThemeColorPalette, int, int, int, j.l.Object); new java.lang.NoSuchMethodError: 'androidx.compose.ui.graphics.Color org.jetbrains.jewel.foundation.theme.ThemeColorPalette.grayOrNull-ijrfgN4(int)' at com.example.plugin.PalettePanelKt.panelBackground(PalettePanel.kt:6) CLIENT ✗ not here CLIENT your-plugin.jar calls grayOrNull-ijrfgN4(int) compiled before JEWEL-1026 ✗ Breaking binary change
  39. 08 / THE REVIEW FIX How to preserve binary compatibility?

    public class ThemeColorPalette(…) { … public fun grayOrNull(index: Int): Color? = gray.getOrNull(index - 1) … }
  40. 08 / THE REVIEW FIX How to preserve binary compatibility?

    + import kotlin.DeprecationLevel.HIDDEN public class ThemeColorPalette(…) { … + @Deprecated("Use variant with fractional parameter", level = HIDDEN) public fun grayOrNull(index: Int): Color? = gray.getOrNull(index - 1) … } Keep the old function, HIDDEN gone from source, still in bytecode: old binaries link
  41. 08 / THE REVIEW FIX How to preserve binary compatibility?

    + import kotlin.DeprecationLevel.HIDDEN public class ThemeColorPalette(…) { … + @Deprecated("Use variant with fractional parameter", level = HIDDEN) public fun grayOrNull(index: Int): Color? = gray.getOrNull(index - 1) + } public fun grayOrNull(index: Int, fractional: Int = 0): Color? = … … EXISTING SOURCE grayOrNull(1) compiles against the new function: nothing to migrate Keep the old function, HIDDEN gone from source, still in bytecode: old binaries link Add the new function existing calls move to it on recompile
  42. 08 / THE REVIEW FIX How to preserve binary compatibility?

    + import kotlin.DeprecationLevel.HIDDEN public class ThemeColorPalette(…) { … + @Deprecated("Use variant with fractional parameter", level = HIDDEN) public fun grayOrNull(index: Int): Color? = − gray.getOrNull(index - 1) + grayOrNull(index, fractional = 0) + } public fun grayOrNull(index: Int, fractional: Int = 0): Color? = … … Keep the old function, HIDDEN gone from source, still in bytecode: old binaries link Add the new function existing calls move to it on recompile Delegate old to new one implementation, two entry points
  43. 09 / THE UPGRADE Before and After JEWEL 1026 INTELLIJ

    PLATFORM · BEFORE JEWEL-1026 INTELLIJ PLATFORM · AFTER JEWEL-1026 API API class ThemeColorPalette class ThemeColorPalette public final a.c.u.g.Color grayOrNull-ijrfgN4(int); compiled against CLIENT CLIENT your-plugin.jar calls grayOrNull-ijrfgN4(int) compiled before JEWEL-1026
  44. 09 / THE UPGRADE Before and After JEWEL 1026 INTELLIJ

    PLATFORM · BEFORE JEWEL-1026 INTELLIJ PLATFORM · AFTER JEWEL-1026 API API class ThemeColorPalette class ThemeColorPalette public final a.c.u.g.Color grayOrNull-ijrfgN4(int); public final a.c.u.g.Color grayOrNull-ijrfgN4(int); public final a.c.u.g.Color grayOrNull-6MYuD4A(int, int); new public static a.c.u.g.Color grayOrNull-6MYuD4A$default( o.j.j.f.t.ThemeColorPalette, int, int, int, j.l.Object); new compiled against CLIENT CLIENT your-plugin.jar calls grayOrNull-ijrfgN4(int) compiled before JEWEL-1026 old, hidden
  45. 09 / THE UPGRADE Before and After JEWEL 1026 INTELLIJ

    PLATFORM · BEFORE JEWEL-1026 INTELLIJ PLATFORM · AFTER JEWEL-1026 API API class ThemeColorPalette class ThemeColorPalette public final a.c.u.g.Color grayOrNull-ijrfgN4(int); public final a.c.u.g.Color grayOrNull-ijrfgN4(int); public final a.c.u.g.Color grayOrNull-6MYuD4A(int, int); new public static a.c.u.g.Color grayOrNull-6MYuD4A$default( o.j.j.f.t.ThemeColorPalette, int, int, int, j.l.Object); new installed, not rebuilt: links CLIENT ✓ found CLIENT your-plugin.jar calls grayOrNull-ijrfgN4(int) compiled before JEWEL-1026
  46. 09 / THE UPGRADE Before and After JEWEL 1026 INTELLIJ

    PLATFORM · BEFORE JEWEL-1026 INTELLIJ PLATFORM · AFTER JEWEL-1026 API API class ThemeColorPalette class ThemeColorPalette public final a.c.u.g.Color grayOrNull-ijrfgN4(int); public final a.c.u.g.Color grayOrNull-ijrfgN4(int); public final a.c.u.g.Color grayOrNull-6MYuD4A(int, int); new public static a.c.u.g.Color grayOrNull-6MYuD4A$default( o.j.j.f.t.ThemeColorPalette, int, int, int, j.l.Object); new installed, not rebuilt: links CLIENT ✓ found CLIENT your-plugin.jar calls grayOrNull-ijrfgN4(int) compiled before JEWEL-1026 After the plugin is recompiled to a new API, same function call grayOrNull(1) now links to the $default helper grayOrNull-6MYuD4A$default(o.j.j.f.t.ThemeColorPalette, int, int, int, j.l.Object)
  47. 10 / THE INCIDENT The Real Incident: After the Revert

    Reported 2026-02-17 · IntelliJ IDEA 2026.1 EAP · Junie java.lang.NoSuchMethodError: 'androidx.compose.ui.graphics.Color org.jetbrains.jewel.foundation.theme.ThemeColorPalette. grayOrNull-6MYuD4A$default ( org.jetbrains.jewel.foundation.theme.ThemeColorPalette, int, int, int, java.lang.Object)' at …JuniePillSwitchStyle$Companion.defaultStyle(SpeedModeSelector.kt:227) at …JunieTheme(JunieTheme.kt:63) …
  48. 10 / THE INCIDENT Gone, But Not Forgotten Jan 14

    JEWEL 1026 merged API BEFORE JEWEL-1026 grayOrNull-ijrfgN4(int) grayOrNull-ijrfgN4(int) grayOrNull-6MYuD4A(int, int) grayOrNull-6MYuD4A$default(…) CLIENT
  49. 10 / THE INCIDENT Gone, But Not Forgotten Jan 14

    JEWEL 1026 merged Jan 23 JEWEL 1026 reverted API BEFORE JEWEL-1026 AFTER THE REVERT grayOrNull-ijrfgN4(int) grayOrNull-ijrfgN4(int) grayOrNull-ijrfgN4(int) grayOrNull-6MYuD4A(int, int) grayOrNull-6MYuD4A(int, int) gone grayOrNull-6MYuD4A$default(…) grayOrNull-6MYuD4A$default(…) gone CLIENT
  50. 10 / THE INCIDENT Gone, But Not Forgotten Jan 14

    JEWEL 1026 merged IDEA EAP 1 ships Jan 23 JEWEL 1026 reverted API BEFORE JEWEL-1026 AFTER THE REVERT grayOrNull-ijrfgN4(int) grayOrNull-ijrfgN4(int) grayOrNull-ijrfgN4(int) grayOrNull-6MYuD4A(int, int) grayOrNull-6MYuD4A(int, int) gone grayOrNull-6MYuD4A$default(…) gone grayOrNull-6MYuD4A$default(…) calls $default : links CLIENT Junie calls grayOrNull-6MYuD4A$default(…) compiled against EAP 1 ✓ found
  51. 10 / THE INCIDENT Gone, But Not Forgotten Jan 14

    JEWEL 1026 merged IDEA EAP 1 ships Jan 23 JEWEL 1026 reverted IDEA EAP 2 cut-off API BEFORE JEWEL-1026 AFTER THE REVERT grayOrNull-ijrfgN4(int) grayOrNull-ijrfgN4(int) grayOrNull-ijrfgN4(int) grayOrNull-6MYuD4A(int, int) grayOrNull-6MYuD4A(int, int) gone grayOrNull-6MYuD4A$default(…) gone grayOrNull-6MYuD4A$default(…) calls $default : links CLIENT Junie calls grayOrNull-6MYuD4A$default(…) compiled against EAP 1 ✓ found
  52. 10 / THE INCIDENT Gone, But Not Forgotten Jan 14

    JEWEL 1026 merged IDEA EAP 1 ships Jan 23 JEWEL 1026 reverted IDEA EAP 2 cut-off Feb 17 Junie fails in EAP 2 API BEFORE JEWEL-1026 AFTER THE REVERT grayOrNull-ijrfgN4(int) grayOrNull-ijrfgN4(int) grayOrNull-ijrfgN4(int) grayOrNull-6MYuD4A(int, int) grayOrNull-6MYuD4A(int, int) gone grayOrNull-6MYuD4A$default(…) grayOrNull-6MYuD4A$default(…) ✗ not here java.lang.NoSuchMethodError: 'androidx.compose.ui.graphics.Color org.jetbrains.jewel.foundation.theme.ThemeColorPalette.grayOrNull-6MYuD4A$default( org.jetbrains.jewel.foundation.theme.ThemeColorPalette, int, int, int, java.lang.Object)' at …JuniePillSwitchStyle$Companion.defaultStyle(SpeedModeSelector.kt:227) CLIENT Junie calls grayOrNull-6MYuD4A$default(…) compiled against EAP 1
  53. 11 / REMOVING AN API A Temporary Guard For K2

    Migration KOTLIN PLUGIN public fun suppressAndroidPlugin(): Boolean
  54. 11 / REMOVING AN API A Temporary Guard For K2

    Migration KOTLIN PLUGIN public fun suppressAndroidPlugin(): Boolean ANDROID PLUGIN calls if (suppressAndroidPlugin()) return null
  55. 11 / REMOVING AN API We deleted all source usages

    KOTLIN PLUGIN public fun suppressAndroidPlugin(): Boolean ANDROID PLUGIN calls if (suppressAndroidPlugin()) return null
  56. 11 / REMOVING AN API We deleted all source usages

    KOTLIN PLUGIN public fun suppressAndroidPlugin(): Boolean ANDROID PLUGIN 0 source usages if (suppressAndroidPlugin()) return null
  57. 11 / REMOVING AN API We deleted all source usages

    KOTLIN PLUGIN public fun suppressAndroidPlugin(): Boolean ANDROID PLUGIN 0 source usages if (suppressAndroidPlugin()) return null
  58. 11 / REMOVING AN API The Runtime Failure java.lang.NoClassDefFoundError: org/jetbrains/kotlin/idea/base/plugin/KotlinPluginModeProviderKt

    at com.android.tools.idea.dagger.DaggerRelatedItemLineMarkerProvider.collectNavigationMarkers( DaggerRelatedItemLineMarkerProvider.kt:69) at com.intellij.codeInsight.daemon.RelatedItemLineMarkerProvider.collectNavigationMarkers( RelatedItemLineMarkerProvider.java:35) at com.intellij.codeInsight.daemon.RelatedItemLineMarkerProvider.collectSlowLineMarkers( RelatedItemLineMarkerProvider.java:27) at com.intellij.codeInsight.daemon.impl.LineMarkersPass.queryProviders(LineMarkersPass.java:226)
  59. 11 / REMOVING AN API The Runtime Failure java.lang.NoClassDefFoundError: org/jetbrains/kotlin/idea/base/plugin/KotlinPluginModeProviderKt

    at com.android.tools.idea.dagger.DaggerRelatedItemLineMarkerProvider.collectNavigationMarkers( DaggerRelatedItemLineMarkerProvider.kt:69) at com.intellij.codeInsight.daemon.RelatedItemLineMarkerProvider.collectNavigationMarkers( RelatedItemLineMarkerProvider.java:35) at com.intellij.codeInsight.daemon.RelatedItemLineMarkerProvider.collectSlowLineMarkers( RelatedItemLineMarkerProvider.java:27) at com.intellij.codeInsight.daemon.impl.LineMarkersPass.queryProviders(LineMarkersPass.java:226)
  60. 11 / REMOVING AN API A Top-Level Function Needs a

    Class KotlinPluginModeProvider.kt fun suppressAndroidPlugin(): Boolean
  61. 11 / REMOVING AN API A Top-Level Function Needs a

    Class KotlinPluginModeProvider.kt KotlinPluginModeProviderKt.class fun suppressAndroidPlugin(): Boolean public final class KotlinPluginModeProviderKt { public static final boolean suppressAndroidPlugin(); } compiles to
  62. 11 / REMOVING AN API A Top-Level Function Needs a

    Class KotlinPluginModeProvider.kt KotlinPluginModeProviderKt.class fun suppressAndroidPlugin(): Boolean public final class KotlinPluginModeProviderKt { public static final boolean suppressAndroidPlugin(); } compiles to
  63. 11 / REMOVING AN API The Plugin Calls a Plugin

    API INTELLIJ IDEA · 2025.1 INTELLIJ IDEA · 2025.1.1 API API IntelliJ Platform IntelliJ Platform compiled against PLUGINS compiled against PLUGINS API KOTLIN PLUGIN · BUNDLED API KOTLIN PLUGIN · BUNDLED, UPDATED WITH THE IDE class KotlinPluginModeProviderKt class KotlinPluginModeProviderKt public static final boolean suppressAndroidPlugin(); public static final boolean suppressAndroidPlugin(); calls · links Android plugin calls suppressAndroidPlugin() compiled against Kotlin plugin 2025.1
  64. 11 / REMOVING AN API The Plugin Calls a Plugin

    API INTELLIJ IDEA · 2025.1 INTELLIJ IDEA · 2025.1.1 API API IntelliJ Platform IntelliJ Platform compiled against PLUGINS compiled against PLUGINS API KOTLIN PLUGIN · BUNDLED API KOTLIN PLUGIN · BUNDLED, UPDATED WITH THE IDE class KotlinPluginModeProviderKt class KotlinPluginModeProviderKt public static final boolean suppressAndroidPlugin(); public static final boolean suppressAndroidPlugin(); ✗ class gone calls · links Android plugin calls suppressAndroidPlugin() compiled against Kotlin plugin 2025.1
  65. 11 / REMOVING AN API The Plugin Calls a Plugin

    API INTELLIJ IDEA · 2025.1 INTELLIJ IDEA · 2025.1.1 API API IntelliJ Platform IntelliJ Platform compiled against PLUGINS API compiled against PLUGINS KOTLIN PLUGIN · BUNDLED API KOTLIN PLUGIN · BUNDLED, UPDATED WITH THE IDE class KotlinPluginModeProviderKt class KotlinPluginModeProviderKt public static final boolean suppressAndroidPlugin(); public static final boolean suppressAndroidPlugin(); ✗ class gone java.lang.NoClassDefFoundError Android plugin calls suppressAndroidPlugin() compiled against Kotlin plugin 2025.1
  66. 11 / REMOVING AN API The Deprecation Cycle @Deprecated("Use replacement")

    @ApiStatus.ScheduledForRemoval fun oldApi() Keep for 2 major releases
  67. 11 / REMOVING AN API The Deprecation Cycle @Deprecated("Use replacement")

    @ApiStatus.ScheduledForRemoval fun oldApi() Keep for 2 major releases Check current usages
  68. 11 / REMOVING AN API The Deprecation Cycle @Deprecated("Use replacement")

    @ApiStatus.ScheduledForRemoval fun oldApi() Keep for 2 major releases Usage is minimal Remove API Check current usages Still widely used Postpone to next major release
  69. 12 / DATA CLASSES A Data Class Publishes More Than

    Its Constructor public data class Solid( val width: Float, val color: Int, ) : Stroke()
  70. 12 / DATA CLASSES A Data Class Publishes More Than

    Its Constructor public data class Solid( val width: Float, val color: Int, ) : Stroke() WHAT A PLUGIN CAN LINK TO CONSTRUCTOR Solid(width, color) GETTERS getWidth() · getColor() DESTRUCTURING component1() · component2() COPY copy(width, color) · copy$default EQUALITY equals · hashCode · toString
  71. 12 / DATA CLASSES A Data Class Publishes More Than

    Its Constructor public data class Solid( val width: Float, val color: Int, ) : Stroke() WHAT A PLUGIN CAN LINK TO CONSTRUCTOR Solid(width, color) order matters DESTRUCTURING component1() · component2() order matters COPY copy(width, color) · copy$default order matters Two properties become a public positional contract
  72. 12 / DATA CLASSES Property Order Is API public data

    class Solid( val width: Float, val color: Int, ) : Stroke() ABI component1(): Float compiles to ✓ component2(): Int calls CLIENT val (width, color) = solid → component1(): Float ✓ links → component2(): Int ✓ links
  73. 12 / DATA CLASSES Property Order Is API public data

    class Solid( val width: Float, val alignment: Alignment, val color: Int, ) : Stroke() ABI component1(): Float compiles to ✓ component2(): Int calls CLIENT val (width, color) = solid → component1(): Float ✓ links → component2(): Int ✓ links
  74. 12 / DATA CLASSES Property Order Is API public data

    class Solid( val width: Float, val alignment: Alignment, val color: Int, ) : Stroke() ABI component1(): Float compiles to component2(): Alignment component3(): Int ✓ was Int new calls CLIENT val (width, color) = solid → component1(): Float ✓ links → component2(): Int ✓ links
  75. 12 / DATA CLASSES Property Order Is API public data

    class Solid( val width: Float, val alignment: Alignment, val color: Int, ) : Stroke() ABI component1(): Float compiles to component2(): Alignment component3(): Int ✓ was Int new calls CLIENT val (width, color) = solid → component1(): Float → component2(): Int ✓ links ✗ NoSuchMethodError
  76. 12 / DATA CLASSES Appending Is Safer. copy() Still Breaks.

    public data class Solid( val width: Float, val color: Int, val alignment: Alignment = Alignment.Inside, ) : Stroke() ABI compiles to component1(): Float ✓ unchanged component2(): Int ✓ unchanged component3(): Alignment new calls CLIENT val (width, color) = solid → component1(): Float ✓ links → component2(): Int ✓ links
  77. 12 / DATA CLASSES Appending Is Safer. copy() Still Breaks.

    public data class Solid( val width: Float, val color: Int, val alignment: Alignment = Alignment.Inside, ) : Stroke() ABI copy(float, int): Solid compiles to copy$default(Solid, float, int, int, Object): Solid calls CLIENT val pressed = solid.copy(color = pressedColor) → copy$default(Solid, float, int, int, Object): Solid ✓ links
  78. 12 / DATA CLASSES Appending Is Safer. copy() Still Breaks.

    public data class Solid( val width: Float, val color: Int, val alignment: Alignment = Alignment.Inside, ) : Stroke() ABI − copy(float, int): Solid compiles to − copy$default(Solid, float, int, int, Object): Solid + copy(float, int, Alignment): Solid + copy$default(Solid, float, int, Alignment, int, Object): Solid calls CLIENT val pressed = solid.copy(color = pressedColor) → copy$default(Solid, float, int, int, Object): Solid ✓ links
  79. 12 / DATA CLASSES Appending Is Safer. copy() Still Breaks.

    public data class Solid( val width: Float, val color: Int, val alignment: Alignment = Alignment.Inside, ) : Stroke() ABI − copy(float, int): Solid compiles to − copy$default(Solid, float, int, int, Object): Solid + copy(float, int, Alignment): Solid + copy$default(Solid, float, int, Alignment, int, Object): Solid calls CLIENT val pressed = solid.copy(color = pressedColor) → copy$default(Solid, float, int, int, Object): Solid ✗ NoSuchMethodError
  80. 12 / DATA CLASSES Appending Is Safer. copy() Still Breaks.

    public data class Solid( val width: Float, val color: Int, val alignment: Alignment = Alignment.Inside, ) : Stroke() ABI − copy(float, int): Solid compiles to − copy$default(Solid, float, int, int, Object): Solid + copy(float, int, Alignment): Solid + copy$default(Solid, float, int, Alignment, int, Object): Solid calls CLIENT val pressed = solid.copy(color = pressedColor) Appending keeps componentN binary compatible, but copy() still breaks. → copy$default(Solid, float, int, int, Object): Solid ✗ NoSuchMethodError
  81. 12 / DATA CLASSES Donʼt use data classes in public

    API @GenerateDataFunctions historical name public class Solid internal constructor( public val width: Dp, public val color: Color, public val alignment: Alignment, ) : Stroke() { equals / hashCode / toString }
  82. 12 / DATA CLASSES Donʼt use data classes in public

    API @GenerateDataFunctions historical name public class Solid internal constructor( public val width: Dp, public val color: Color, public val alignment: Alignment, ) : Stroke() { equals / hashCode / toString } KEEPS DOES NOT GENERATE ✓ equals ✗ copy ✓ hashCode ✗ copy$default ✓ toString ✗ componentN ✓ immutable public properties ✗ positional data-class ABI
  83. 12 / DATA CLASSES Donʼt use data classes in public

    API @GenerateDataFunctions historical name public class Solid internal constructor( public val width: Dp, public val color: Color, public val alignment: Alignment, ) : Stroke() { equals / hashCode / toString } KEEPS DOES NOT GENERATE ✓ equals ✗ copy ✓ hashCode ✗ copy$default ✓ toString ✗ componentN ✓ immutable public properties ✗ positional data-class ABI @GenerateDataFunctions is a historical name. Today it validates equality methods. It does not create data-class ABI.
  84. 12 / DATA CLASSES The Build Enforces API to stay

    up to date GRADLE validatePublicApi Data classes are not allowed in public API. Found violations: … Turn them into regular classes, implement equals()/hashCode()/toString(), and add the @GenerateDataFunctions annotation.
  85. 12 / DATA CLASSES The Build Enforces API to stay

    up to date GRADLE validatePublicApi DETEKT EqualityMembersRule Data classes are not allowed in public API. Found violations: … Turn them into regular classes, implement equals()/hashCode()/toString(), and add the @GenerateDataFunctions annotation. detects missing or incomplete equals/hashCode/toString functions ‹Class› is missing required functions: ‹functions›. Jewel's default policy: no data classes in public API. Exceptions must be explicit.
  86. 13 / THE GUARDS Compatibility Tooling IntelliJ API Checker Metalava

    BINARY API SOURCE API Kotlin ABI Validator japicmp BINARY API BINARY API
  87. 13 / THE GUARDS Validate Every API Change In CI

    Commit + push source + api-dump.txt CI generates current API dump Compare with committed dump
  88. 13 / THE GUARDS Validate Every API Change In CI

    Merge MATCH Commit + push source + api-dump.txt CI generates current API dump Compare with committed dump
  89. 13 / THE GUARDS Validate Every API Change In CI

    Merge MATCH Commit + push source + api-dump.txt CI generates current API dump Compare with committed dump MISMATCH Review API diff CI fails
  90. 13 / THE GUARDS Validate Every API Change In CI

    Merge MATCH Commit + push source + api-dump.txt CI generates current API dump Compare with committed dump MISMATCH Review API diff Expected change Update api-dump.txt CI fails
  91. 13 / THE GUARDS Validate Every API Change In CI

    Merge MATCH Commit + push source + api-dump.txt CI generates current API dump Compare with committed dump MISMATCH Review API diff Expected change Update api-dump.txt CI fails Unexpected break Fix API break
  92. 14 / THE AGE OF AI A Diff Is Not

    a Decision Compatibility check failed - public fun oldApi() requires judgment Is this change expected and safe?
  93. 14 / THE AGE OF AI Tools Give AI Eyes

    Public API change Compatibility tools
  94. 14 / THE AGE OF AI Tools Give AI Eyes

    Public API change Compatibility tools Evidence Removed public symbol
  95. 14 / THE AGE OF AI Tools and Skills Close

    the Loop Implement API change Run compatibility tools Apply API-evolution rules
  96. 14 / THE AGE OF AI Tools and Skills Close

    the Loop Implement API change Run compatibility tools Apply API-evolution rules issue found Fix compatibility issue
  97. 14 / THE AGE OF AI Tools and Skills Close

    the Loop Implement API change Run compatibility tools Apply API-evolution rules safe issue found Fix compatibility issue Commit change
  98. 15 / THE CONCLUSION Building software for the future is

    hard. Staying compatible with the past is even more difficult.
  99. 15 / THE CONCLUSION So when you build for the

    future, respect the past. Every release you ship might be someone else's dependency.
  100. Q&A

More Decks by Nebojša Vukšić

Other Decks in Programming