-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement
State
change tracking feature (#55)
* Runtime logic and IR improvements * Add state change tracking Resolves #39 * Fix tests
- Loading branch information
Showing
25 changed files
with
735 additions
and
314 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
.../src/test/kotlin/land/sungbin/composeinvestigator/compiler/test/source/SourceForIrDump.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,30 @@ | ||
@file:Suppress("TestFunctionName", "ComposableNaming", "unused") | ||
|
||
package land.sungbin.composeinvestigator.compiler.test.source | ||
|
||
import androidx.compose.material.Button | ||
import androidx.compose.material.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.getValue | ||
import androidx.compose.runtime.mutableIntStateOf | ||
import androidx.compose.runtime.remember | ||
import androidx.compose.runtime.setValue | ||
|
||
@Composable | ||
fun InvalidationProcessedRoot_StateDelegateReference() { | ||
var count by remember { mutableIntStateOf(0) } | ||
Button(onClick = { count = 1 }) {} | ||
InvalidationProcessedChild(count) | ||
} | ||
|
||
@Composable | ||
fun InvalidationProcessedRoot_StateDirectReference() { | ||
val count = remember { mutableIntStateOf(0) } | ||
Button(onClick = { count.intValue = 1 }) {} | ||
InvalidationProcessedChild(count.intValue) | ||
} | ||
|
||
@Composable | ||
private fun InvalidationProcessedChild(count: Int) { | ||
Text(text = "$count") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...nd/sungbin/composeinvestigator/compiler/test/tracker/logger/InvalidationLoggerTestRule.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* Designed and developed by Ji Sungbin 2023. | ||
* | ||
* Licensed under the MIT. | ||
* Please see full license: https://github.com/jisungbin/ComposeInvestigator/blob/main/LICENSE | ||
*/ | ||
|
||
package land.sungbin.composeinvestigator.compiler.test.tracker.logger | ||
|
||
import land.sungbin.composeinvestigator.compiler.test.source.logger.clearInvalidationLog | ||
import org.junit.rules.TestWatcher | ||
import org.junit.runner.Description | ||
|
||
class InvalidationLoggerTestRule : TestWatcher() { | ||
override fun finished(description: Description?) { | ||
clearInvalidationLog() | ||
super.finished(description) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ation-test/src/test/kotlin/land/sungbin/composeinvestigator/compiler/test/utils/source.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.