Skip to content
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

Upgrades to Kotlin 2.0.20 #890

Merged
merged 4 commits into from
Sep 19, 2024
Merged

Conversation

zqirui
Copy link
Contributor

@zqirui zqirui commented Sep 12, 2024

Upgrades to Kotlin 2.0.20

Closes #866

@zqirui zqirui changed the title Upgrades to kotlin 2.0.20 Upgrades to Kotlin 2.0.20 Sep 12, 2024
@Lysander Lysander marked this pull request as draft September 12, 2024 14:36
@Lysander
Copy link
Collaborator

I just marked this draft, so we do not merge this accidentally before the RC-19 release.

@Lysander Lysander added this to the 1.0-RC20 milestone Sep 12, 2024
@Lysander Lysander self-requested a review September 12, 2024 14:37
@Lysander Lysander added the good first issue Good for newcomers label Sep 12, 2024
@Lysander Lysander marked this pull request as ready for review September 19, 2024 09:27
@Lysander
Copy link
Collaborator

AS RC19 is released, we could now review and merge this one 😍

@Lysander
Copy link
Collaborator

There are some warnings left, that should be handled. I suggest the following changes:

Subject: [PATCH] Fixes small styling issue in sealed hierarchy example
---
Index: core/src/commonMain/kotlin/dev/fritz2/validation/validation.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/core/src/commonMain/kotlin/dev/fritz2/validation/validation.kt b/core/src/commonMain/kotlin/dev/fritz2/validation/validation.kt
--- a/core/src/commonMain/kotlin/dev/fritz2/validation/validation.kt	(revision 92af339cb8a91bb4e32035b59f888b162d4aa144)
+++ b/core/src/commonMain/kotlin/dev/fritz2/validation/validation.kt	(date 1726742213148)
@@ -62,7 +62,7 @@
  * @param T metadata which perhaps is needed in validation process
  */
 @JvmInline
-value class Validation<D, T, M>(private inline val validate: (Inspector<D>, T) -> List<M>) {
+value class Validation<D, T, M>(private val validate: (Inspector<D>, T) -> List<M>) {
     operator fun invoke(inspector: Inspector<D>, metadata: T): List<M> = this.validate(inspector, metadata)
     operator fun invoke(data: D, metadata: T): List<M> = this.validate(inspectorOf(data), metadata)
 }
Index: headless/src/jsMain/kotlin/dev/fritz2/headless/components/combobox.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/headless/src/jsMain/kotlin/dev/fritz2/headless/components/combobox.kt b/headless/src/jsMain/kotlin/dev/fritz2/headless/components/combobox.kt
--- a/headless/src/jsMain/kotlin/dev/fritz2/headless/components/combobox.kt	(revision 92af339cb8a91bb4e32035b59f888b162d4aa144)
+++ b/headless/src/jsMain/kotlin/dev/fritz2/headless/components/combobox.kt	(date 1726742312590)
@@ -399,7 +399,7 @@
      * Instances of this class are part of the [ItemList][QueryResult.ItemList] [QueryResult] and are passed to the
      * [comboboxItem][ComboboxItems.comboboxItem] brick in order for it to know which item it represents.
      */
-    data class Item<T> internal constructor(
+    data class Item<T>(
         val index: Int,
         val value: T
     )
@@ -434,7 +434,7 @@
          *
          * See [QueryResult] for more information.
          */
-        data class ItemList<T> internal constructor(
+        data class ItemList<T>(
             val query: String,
             val items: List<Item<T>>,
             val truncated: Boolean
Index: core/src/jsMain/kotlin/dev/fritz2/core/handlers.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/core/src/jsMain/kotlin/dev/fritz2/core/handlers.kt b/core/src/jsMain/kotlin/dev/fritz2/core/handlers.kt
--- a/core/src/jsMain/kotlin/dev/fritz2/core/handlers.kt	(revision 92af339cb8a91bb4e32035b59f888b162d4aa144)
+++ b/core/src/jsMain/kotlin/dev/fritz2/core/handlers.kt	(date 1726742252369)
@@ -55,7 +55,7 @@
  *
  * @param process defines how to handle the values of the connected [Flow]
  */
-value class SimpleHandler<A>(override inline val process: (Flow<A>, Job) -> Unit) : Handler<A>
+value class SimpleHandler<A>(override val process: (Flow<A>, Job) -> Unit) : Handler<A>
 
 /**
  * An [EmittingHandler] is a special [Handler] that constitutes a new [Flow] by itself. You can emit values to this [Flow] from your code
@@ -65,7 +65,7 @@
  * @property process function defining how this [Handler] collects a [Flow] when connected using [handledBy]
  */
 class EmittingHandler<A, E>(
-    inline val collectWithChannel: (Flow<A>, FlowCollector<E>, Job) -> Unit,
+    private val collectWithChannel: (Flow<A>, FlowCollector<E>, Job) -> Unit,
     private val flow: MutableSharedFlow<E> = MutableSharedFlow()
 ) : Handler<A>, Flow<E> by flow {

@Lysander
Copy link
Collaborator

I have run the headless-demo UI tests and everything works fine.

I also started most example apps.

@zqirui
Copy link
Contributor Author

zqirui commented Sep 19, 2024

I applied your patch and did a full build. Build Warnings should be gone now. Thanks!

Copy link
Collaborator

@Lysander Lysander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please adapt the versions in the example build.gradle.kts too.

Currently those are still at 1.9.x

@Lysander Lysander merged commit 206c311 into jwstegemann:master Sep 19, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update to Kotlin 2.0
2 participants