-
-
Notifications
You must be signed in to change notification settings - Fork 24
Inference logics for Parcelable classes #13
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
Conversation
WalkthroughAdded support for analyzing @Parcelize-annotated classes in the Compose stability analyzer. The analysis now detects Parcelize data classes, checks their declared properties, marks them as UNSTABLE if any are mutable (var), and returns STABLE if all properties are immutable and stable. This check prioritizes Parcelize analysis before interface-related logic. Changes
Sequence DiagramsequenceDiagram
participant Analyzer
participant Class
rect rgb(230, 245, 255)
Note over Analyzer: New @Parcelize Check
Analyzer->>Class: Is @Parcelize-annotated?
alt Yes, is data class
Analyzer->>Class: Check declared properties
alt Any var (mutable) properties?
Analyzer-->>Analyzer: Return UNSTABLE<br/>("Has mutable properties")
else All properties are val
Analyzer->>Class: Analyze property stability
alt All properties STABLE
Analyzer-->>Analyzer: Return STABLE<br/>("@Parcelize with stable properties")
else Any property UNSTABLE or MIXED
Analyzer-->>Analyzer: Fall through to next checks<br/>(Interfaces, Abstract, Regular)
end
end
else Not @Parcelize or not data class
Analyzer-->>Analyzer: Skip to Interface checks
end
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Key areas requiring attention during review:
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
compose-stability-analyzer-idea/CHANGELOG.md(1 hunks)compose-stability-analyzer-idea/src/main/kotlin/com/skydoves/compose/stability/idea/k2/KtStabilityInferencer.kt(2 hunks)stability-compiler/src/main/kotlin/com/skydoves/compose/stability/compiler/lower/StabilityAnalyzerTransformer.kt(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: Build IntelliJ Plugin
- GitHub Check: Test IntelliJ Plugin
- GitHub Check: Build and Tests
- GitHub Check: API check
🔇 Additional comments (3)
compose-stability-analyzer-idea/CHANGELOG.md (1)
10-10: CHANGELOG entries are clear and well-formatted. ✓Both entries accurately document the Parcelize support feature. Line 10 correctly cites Issue #3, and line 18 clearly describes the improvement with specific reference to "stable properties," aligning with the inference logic described in the PR summary.
Also applies to: 18-18
compose-stability-analyzer-idea/src/main/kotlin/com/skydoves/compose/stability/idea/k2/KtStabilityInferencer.kt (1)
51-55: Documentation updated correctly.The inline documentation accurately reflects the new Parcelize-based analysis step and the renumbered subsequent steps.
stability-compiler/src/main/kotlin/com/skydoves/compose/stability/compiler/lower/StabilityAnalyzerTransformer.kt (1)
237-241: Documentation updated correctly.The analysis order documentation accurately reflects the new Parcelize handling at step 14 and the renumbered subsequent steps.
Inference logics for Parcelable classes. (#3)
Summary by CodeRabbit
Bug Fixes
Improvements