Browse Source

totoapp compose 1.2.0-rc01 (#2387)

* compose 1.2.0-rc01
* apply eymar patch to fix js
pull/2390/head
dima.avdeev 2 years ago committed by GitHub
parent
commit
a1a3cdc15d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      examples/todoapp/buildSrc/gradle.properties
  2. 2
      examples/todoapp/gradle.properties
  3. 5
      examples/todoapp/web/build.gradle.kts
  4. 4
      examples/todoapp/web/src/jsMain/kotlin/example/todo/web/App.kt
  5. 5
      examples/todoapp/web/src/jsMain/kotlin/example/todo/web/Components.kt

4
examples/todoapp/buildSrc/gradle.properties

@ -1,3 +1,3 @@
# TODO can we get rid of duplication with root gradle.properties? # TODO can we get rid of duplication with root gradle.properties?
kotlin.version=1.6.10 kotlin.version=1.7.10
compose.version=1.1.0 compose.version=1.2.0-rc01

2
examples/todoapp/gradle.properties

@ -22,5 +22,7 @@ kotlin.code.style=official
org.gradle.parallel=true org.gradle.parallel=true
org.gradle.caching=true org.gradle.caching=true
kotlin.native.disableCompilerDaemon=true kotlin.native.disableCompilerDaemon=true
#TODO also change version in buildSrc/gradle.properties
kotlin.version=1.7.10 kotlin.version=1.7.10
compose.version=1.2.0-rc01 compose.version=1.2.0-rc01

5
examples/todoapp/web/build.gradle.kts

@ -1,4 +1,5 @@
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension
import org.jetbrains.compose.compose
plugins { plugins {
kotlin("multiplatform") kotlin("multiplatform")
@ -17,7 +18,7 @@ kotlin {
named("jsMain") { named("jsMain") {
dependencies { dependencies {
implementation(compose.runtime) implementation(compose.runtime)
implementation(compose.web.widgets) implementation(compose.web.core)
implementation(project(":common:utils")) implementation(project(":common:utils"))
implementation(project(":common:database")) implementation(project(":common:database"))
implementation(project(":common:root")) implementation(project(":common:root"))
@ -37,6 +38,6 @@ kotlin {
afterEvaluate { afterEvaluate {
rootProject.extensions.configure<NodeJsRootExtension> { rootProject.extensions.configure<NodeJsRootExtension> {
versions.webpackDevServer.version = "4.0.0" versions.webpackDevServer.version = "4.0.0"
versions.webpackCli.version = "4.9.0" versions.webpackCli.version = "4.10.0"
} }
} }

4
examples/todoapp/web/src/jsMain/kotlin/example/todo/web/App.kt

@ -8,9 +8,7 @@ import example.todo.common.database.DefaultTodoSharedDatabase
import example.todo.common.database.todoDatabaseDriver import example.todo.common.database.todoDatabaseDriver
import example.todo.common.root.integration.TodoRootComponent import example.todo.common.root.integration.TodoRootComponent
import kotlinx.browser.document import kotlinx.browser.document
import org.jetbrains.compose.web.css.Style
import org.jetbrains.compose.web.renderComposable import org.jetbrains.compose.web.renderComposable
import org.jetbrains.compose.web.ui.Styles
import org.w3c.dom.HTMLElement import org.w3c.dom.HTMLElement
fun main() { fun main() {
@ -28,8 +26,6 @@ fun main() {
lifecycle.resume() lifecycle.resume()
renderComposable(root = rootElement) { renderComposable(root = rootElement) {
Style(Styles)
TodoRootUi(root) TodoRootUi(root)
} }
} }

5
examples/todoapp/web/src/jsMain/kotlin/example/todo/web/Components.kt

@ -1,8 +1,6 @@
package example.todo.web package example.todo.web
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import org.jetbrains.compose.common.material.Text
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi
import org.jetbrains.compose.web.attributes.InputType import org.jetbrains.compose.web.attributes.InputType
import org.jetbrains.compose.web.css.AlignItems import org.jetbrains.compose.web.css.AlignItems
import org.jetbrains.compose.web.css.DisplayStyle import org.jetbrains.compose.web.css.DisplayStyle
@ -66,7 +64,6 @@ fun Card(attrs: AttrBuilderContext<*> = {}, content: @Composable () -> Unit) {
} }
} }
@OptIn(ExperimentalComposeWebWidgetsApi::class)
@Composable @Composable
fun MaterialTextArea( fun MaterialTextArea(
id: String, id: String,
@ -95,7 +92,7 @@ fun MaterialTextArea(
) )
Label(forId = id) { Label(forId = id) {
Text(text = label) Text(value = label)
} }
} }
} }

Loading…
Cancel
Save