Trace the recomposition of a Composable with its cause without boilerplate code ๐.
This tool was initiated for personal learning and has not been proven necessary for production. However, it can perform the following tasks:
- Reports if a Composable is skipped during recomposition.
- Reports if the arguments of a Composable have changed and been recomposed. It can also compare the values before and after the change.
- Reports if the state values inside a Composable have been modified. It can also compare the values before and after the change.
- Retrieves the call stack leading up to the invocation of a Composable. This helps identify the specific Composable being recomposed when the same Composable is reused in multiple places.
(Read the Medium's introductory post)
Next release schedule: Released when Kotlin 2.1.0 is stable
Just add the plugin to your module-level Gradle like this:
plugins {
id 'in.sungb.composeinvestigator' version '<version>'
}
Important
ComposeInvestigator is heavily dependent on the Kotlin version. So the version of
ComposeInvestigator follows the format [Kotlin Version - ComposeInvestigator Version]
.
You don't need to use any APIs to get started. But if you're looking for a fancier experience, consider using the runtime API.
Comprehensive documentation for ComposeInvestigator is available on project website.
Copyright 2024 Ji Sungbin
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.