Skip to content

Commit 3759b70

Browse files
authored
Merge pull request #15 from skydoves/release/0.4.2
Prepare for release 0.4.2
2 parents 6eaf826 + 96c5b8b commit 3759b70

File tree

5 files changed

+230
-2
lines changed

5 files changed

+230
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ It’s **strongly recommended to use the exact same Kotlin version** as this lib
142142

143143
| Stability Analyzer | Kotlin |
144144
|--------------------|-------------|
145+
| 0.4.2 | 2.2.21 |
145146
| 0.4.1 | 2.2.21 |
146147
| 0.4.0 | 2.2.21 |
147148

compose-stability-analyzer-idea/CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@
22

33
All notable changes to the IntelliJ IDEA plugin will be documented in this file.
44

5+
## [0.4.2] - 2025-11-03
6+
7+
### Fixed
8+
- Fixed @Parcelize data classes with stable properties now correctly identified as STABLE (Issue #3)
9+
- Fixed StackOverflowError when analyzing recursive or self-referential types (Issue #11)
10+
- Fixed Compose shape types stability analysis (RoundedCornerShape, CircleShape, etc.)
11+
- Improved @Parcelize analysis to ignore Parcelable interface's runtime stability
12+
13+
### Improved
14+
- Enhanced cycle detection for recursive type analysis
15+
- Better handling of complex function type aliases and deeply nested generics
16+
- Consistent stability analysis behavior with compiler plugin
17+
18+
---
19+
520
## [0.4.1] - 2025-11-02
621

722
### Fixed
Lines changed: 212 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,212 @@
1+
# Compose Stability Analyzer IntelliJ Plugin 0.4.2
2+
3+
**Release Date:** November 3, 2025
4+
5+
## Overview
6+
7+
This release brings critical bug fixes and stability improvements to the IntelliJ IDEA plugin, ensuring accurate stability analysis for Android-specific patterns and preventing crashes when analyzing complex type hierarchies.
8+
9+
## 🐛 Bug Fixes
10+
11+
### Fixed @Parcelize Data Classes (Issue #3)
12+
13+
The plugin no longer shows false warnings for `@Parcelize`-annotated data classes that implement `Parcelable`.
14+
15+
**What was wrong:**
16+
- Classes with `@Parcelize` were incorrectly flagged with "Extends android.os.Parcelable which has runtime stability" tooltip
17+
- Even when all properties were stable (`val` with stable types), the class was marked as RUNTIME
18+
19+
**Now fixed:**
20+
```kotlin
21+
@Parcelize
22+
data class RecordEditArgs(
23+
val id: String, // ✅ Stable
24+
val pageNumber: Int, // ✅ Stable
25+
val quote: String, // ✅ Stable
26+
val review: String, // ✅ Stable
27+
// ... all val properties with stable types
28+
) : Parcelable // ✅ Now correctly shows as STABLE
29+
```
30+
31+
**Technical details:**
32+
- The plugin now checks only the properties of `@Parcelize` classes
33+
- Ignores the Parcelable interface's runtime stability
34+
- If all properties are `val` and have stable types → class is STABLE
35+
36+
### Fixed StackOverflowError for Recursive Types (Issue #11)
37+
38+
The plugin no longer crashes when analyzing code with recursive type references or complex function type aliases.
39+
40+
**Problematic patterns that are now handled:**
41+
```kotlin
42+
// Function type aliases
43+
typealias ScreenTransitionContent = @Composable AnimatedVisibilityScope.(Screen) -> Unit
44+
45+
// Complex nested generics
46+
fun ScreenTransition(
47+
transitionSpec: AnimatedContentTransitionScope<Screen>.() -> ContentTransform
48+
)
49+
50+
// Self-referential types
51+
data class Node(val children: List<Node>)
52+
```
53+
54+
**Solution:** Implemented cycle detection that safely breaks infinite recursion by returning RUNTIME stability when a circular reference is detected.
55+
56+
### Fixed Compose Shape Types Stability
57+
58+
Shape types from Compose Foundation were incorrectly showing as RUNTIME.
59+
60+
**Fixed types:**
61+
- `RoundedCornerShape`
62+
- `CircleShape`
63+
- `CutCornerShape`
64+
- `CornerBasedShape`
65+
- `AbsoluteRoundedCornerShape`
66+
- `AbsoluteCutCornerShape`
67+
- `RectangleShape`
68+
69+
These are now correctly recognized as STABLE types in:
70+
- Hover tooltips
71+
- Gutter icons
72+
- Inline parameter hints
73+
- Code inspections
74+
75+
## 🎯 Visual Improvements
76+
77+
### Gutter Icons
78+
79+
Fixed gutter icon colors for:
80+
- ✅ Green dot for STABLE composables (including @Parcelize classes)
81+
- ⚠️ Yellow/orange dot for RUNTIME composables (only when truly runtime-dependent)
82+
- ❌ Red dot for UNSTABLE composables (mutable properties)
83+
84+
### Hover Tooltips
85+
86+
More accurate stability information:
87+
```
88+
✅ Before: "Extends android.os.Parcelable which has runtime stability"
89+
✅ After: "@Parcelize with all stable properties"
90+
```
91+
92+
### Inline Hints
93+
94+
Parameter hints now correctly show:
95+
- `shape: RoundedCornerShape`**STABLE** badge (was showing RUNTIME)
96+
- `args: RecordEditArgs`**STABLE** badge (was showing RUNTIME for @Parcelize)
97+
98+
## 🔧 Technical Improvements
99+
100+
### Cycle Detection
101+
102+
Implemented ThreadLocal-based cycle detection:
103+
```kotlin
104+
private val analyzingTypes = ThreadLocal.withInitial { mutableSetOf<String>() }
105+
```
106+
107+
**Benefits:**
108+
- Thread-safe analysis in IDE background tasks
109+
- Prevents infinite recursion
110+
- Minimal performance overhead
111+
- Graceful handling of edge cases
112+
113+
### Consistent with Compiler Plugin
114+
115+
The IDEA plugin now uses the same analysis order as the compiler plugin:
116+
1. Nullable types
117+
2. Type parameters
118+
3. Function types
119+
4. Known stable types
120+
5. Annotations (@Stable, @Immutable)
121+
6. Primitives
122+
7. String, Unit, Nothing
123+
8. Collections
124+
9. Value classes
125+
10. Enums
126+
11. **@Parcelize** (new priority)
127+
12. Interfaces
128+
13. Abstract classes
129+
14. Regular classes
130+
15. @StabilityInferred
131+
132+
This ensures IDE analysis matches compilation results.
133+
134+
## 📦 Installation
135+
136+
### From Disk (Recommended for Pre-Release)
137+
138+
1. Download: [compose-stability-analyzer-idea-0.4.2.zip](https://github.com/skydoves/compose-stability-analyzer/releases/tag/0.4.2)
139+
2. Open **Android Studio** or **IntelliJ IDEA**
140+
3. Go to **Settings → Plugins**
141+
4. Click **⚙️ (gear icon) → Install Plugin from Disk...**
142+
5. Select the downloaded `.zip` file
143+
6. Restart IDE
144+
145+
### From Marketplace (Coming Soon)
146+
147+
Once approved by JetBrains, you'll be able to install directly from:
148+
**Settings → Plugins → Marketplace → Search "Compose Stability Analyzer"**
149+
150+
## ⚙️ Plugin Settings
151+
152+
The plugin settings remain unchanged. You can still customize:
153+
154+
**Settings → Tools → Compose Stability Analyzer**
155+
156+
- ✅ Enable/disable stability checks
157+
- 🎨 Customize gutter icon colors
158+
- 🎨 Customize inline hint colors
159+
- 📝 Set stability configuration file path
160+
- 🚫 Add ignored type patterns
161+
- ⚡ Enable Strong Skipping mode
162+
163+
## 🐛 Known Issues
164+
165+
None reported for this release. If you encounter any issues, please report them at:
166+
https://github.com/skydoves/compose-stability-analyzer/issues
167+
168+
## 📊 Compatibility
169+
170+
- **Android Studio:** 2023.3+ (Hedgehog and newer)
171+
- **IntelliJ IDEA:** 2023.3+ (Community or Ultimate)
172+
- **Kotlin:** 2.0.21+
173+
- **Compose:** Any version
174+
175+
## 🔄 Updating from 0.4.1
176+
177+
No configuration changes needed. Simply:
178+
1. Uninstall the old version (optional, IDE can update in place)
179+
2. Install 0.4.2 following the installation steps above
180+
3. Restart your IDE
181+
182+
Your custom settings will be preserved.
183+
184+
## 📝 What's Next?
185+
186+
We're continuously improving the plugin. Upcoming features:
187+
- Performance optimizations for large codebases
188+
- More customization options for visual indicators
189+
- Integration with stability validation reports
190+
- Support for custom stability annotations
191+
192+
## 🙏 Acknowledgments
193+
194+
Special thanks to the community for reporting issues:
195+
- [@apptechxonia](https://github.com/apptechxonia) - @Parcelize issue report
196+
- [@noloman](https://github.com/noloman) - @Parcelize confirmation
197+
- [@Tolriq](https://github.com/Tolriq) - StackOverflowError report
198+
199+
Your feedback helps make this plugin better! 🎉
200+
201+
## 📖 Documentation
202+
203+
For complete documentation, visit:
204+
- [README.md](https://github.com/skydoves/compose-stability-analyzer/blob/main/README.md)
205+
- [Plugin Documentation](https://github.com/skydoves/compose-stability-analyzer/tree/main/compose-stability-analyzer-idea)
206+
- [Issue Tracker](https://github.com/skydoves/compose-stability-analyzer/issues)
207+
208+
---
209+
210+
**Plugin Version:** 0.4.2
211+
**Release Date:** November 3, 2025
212+
**License:** Apache 2.0

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ kotlin.mpp.androidGradlePluginCompatibility.nowarn=true
5151

5252
# Maven publishing
5353
GROUP=com.github.skydoves
54-
VERSION_NAME=0.4.1
54+
VERSION_NAME=0.4.2
5555

5656
POM_URL=https://github.com/skydoves/compose-stability-analyzer/
5757
POM_SCM_URL=https://github.com/skydoves/compose-stability-analyzer/

stability-gradle/src/main/kotlin/com/skydoves/compose/stability/gradle/StabilityAnalyzerGradlePlugin.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public class StabilityAnalyzerGradlePlugin : KotlinCompilerPluginSupportPlugin {
4545

4646
// This version should match the version in gradle.properties
4747
// Update this when bumping the library version
48-
private const val VERSION = "0.4.1"
48+
private const val VERSION = "0.4.2"
4949

5050
// Compiler option keys
5151
private const val OPTION_ENABLED = "enabled"

0 commit comments

Comments
 (0)