From ae22ca4ea19fbaeba27f9da06aba645cf9db8c9d Mon Sep 17 00:00:00 2001 From: Jake Wharton Date: Thu, 28 Jan 2021 22:09:14 -0500 Subject: [PATCH] Update to Compose alpha11 --- build.gradle | 4 ++-- compose/upstream | 2 +- examples/jest/src/main/kotlin/example/jest.kt | 4 ++-- mosaic-gradle/src/test/fixture/counter/build.gradle | 2 +- mosaic/src/main/kotlin/com/jakewharton/mosaic/components.kt | 6 +++--- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/build.gradle b/build.gradle index 4113cd6c..2510ba68 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,7 @@ buildscript { ext.versions = [ - 'compose': '1.0.0-alpha10', - 'kotlin': '1.4.21', + 'compose': '1.0.0-alpha11', + 'kotlin': '1.4.21-2', 'kotlinxCoroutines': '1.4.1', ] ext.deps = [ diff --git a/compose/upstream b/compose/upstream index 6207afb1..6950aab5 160000 --- a/compose/upstream +++ b/compose/upstream @@ -1 +1 @@ -Subproject commit 6207afb1646d302c5d29c2c67d332b48db87fb27 +Subproject commit 6950aab50fe6c9f7e9d97cf865161f2d3999eb9e diff --git a/examples/jest/src/main/kotlin/example/jest.kt b/examples/jest/src/main/kotlin/example/jest.kt index 787b4dee..588f9676 100644 --- a/examples/jest/src/main/kotlin/example/jest.kt +++ b/examples/jest/src/main/kotlin/example/jest.kt @@ -1,7 +1,7 @@ package example import androidx.compose.runtime.Composable -import androidx.compose.runtime.LaunchedTask +import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateListOf import androidx.compose.runtime.mutableStateOf @@ -125,7 +125,7 @@ private fun Summary(tests: SnapshotStateList) { } var elapsed by remember { mutableStateOf(0) } - LaunchedTask { + LaunchedEffect(Unit) { while (true) { delay(1_000) elapsed++ diff --git a/mosaic-gradle/src/test/fixture/counter/build.gradle b/mosaic-gradle/src/test/fixture/counter/build.gradle index c5811684..fad53ec4 100644 --- a/mosaic-gradle/src/test/fixture/counter/build.gradle +++ b/mosaic-gradle/src/test/fixture/counter/build.gradle @@ -1,6 +1,6 @@ buildscript { dependencies { - classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.21' + classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.21-2' classpath "com.jakewharton.mosaic:gradle:${mosaicVersion}" } repositories { diff --git a/mosaic/src/main/kotlin/com/jakewharton/mosaic/components.kt b/mosaic/src/main/kotlin/com/jakewharton/mosaic/components.kt index 727e6581..2d661cc9 100644 --- a/mosaic/src/main/kotlin/com/jakewharton/mosaic/components.kt +++ b/mosaic/src/main/kotlin/com/jakewharton/mosaic/components.kt @@ -1,9 +1,9 @@ package com.jakewharton.mosaic import androidx.compose.runtime.Composable +import androidx.compose.runtime.ComposeNode import androidx.compose.runtime.Immutable import androidx.compose.runtime.Stable -import androidx.compose.runtime.emit import com.facebook.yoga.YogaFlexDirection @Composable @@ -13,7 +13,7 @@ fun Text( background: Color? = null, style: TextStyle? = null, ) { - emit(::TextNode) { + ComposeNode(::TextNode) { set(value) { this.value = value } @@ -107,7 +107,7 @@ fun Column(children: @Composable () -> Unit) { @Composable private fun Box(flexDirection: YogaFlexDirection, children: @Composable () -> Unit) { - emit( + ComposeNode( factory = ::BoxNode, update = { set(flexDirection) {