Skip to content

Commit

Permalink
Update Kotlin core dependencies (#2844)
Browse files Browse the repository at this point in the history
- removed deprecated api
- fixed test for JS
- @OptIn(ExperimentalNativeApi::class)
- fixed import @jsmodule("@react-sigma/*")

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nariman Abdullin <nulls.narik@gmail.com>
  • Loading branch information
2 people authored and 0x6675636b796f75676974687562 committed Nov 5, 2024
1 parent 36b5690 commit 967f4db
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 29 deletions.
8 changes: 4 additions & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[versions]
kotlin = "1.9.10"
kotlin = "1.9.22"
jetbrains-annotations = "24.0.1"
save-cli = "0.3.10"
ktor = "2.3.6"
okio = "3.3.0"
serialization = "1.6.0"
kotlinx-datetime = "0.4.1"
kotlinx-coroutines = "1.7.3"
serialization = "1.6.3"
kotlinx-datetime = "0.5.0"
kotlinx-coroutines = "1.8.0"
kotlin-wrappers = "1.0.0-pre.634"
spring-boot = "2.7.17"
spring-cloud = "3.1.9"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import kotlinx.cinterop.ExperimentalForeignApi
import kotlinx.cinterop.toKString

actual class AtomicLong actual constructor(value: Long) {
private val kotlinAtomicLong = kotlin.native.concurrent.AtomicLong(value)
private val kotlinAtomicLong = kotlin.concurrent.AtomicLong(value)

actual fun get(): Long = kotlinAtomicLong.value

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import io.ktor.utils.io.core.*
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlin.experimental.ExperimentalNativeApi
import kotlin.test.*

class ServerTest {
Expand All @@ -27,6 +28,7 @@ class ServerTest {
server.stop()
}

@OptIn(ExperimentalNativeApi::class)
@Test
fun testServerStartup() {
httpClient().use { client ->
Expand Down
10 changes: 5 additions & 5 deletions save-frontend-common/karma.config.d/custom-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
test: /\.js$/,
use: {loader: 'istanbul-instrumenter-loader'},
// fixme: need to exclude Kotlin dependencies
include: [path.resolve(__dirname, '../save-cloud-save-frontend-common/kotlin/')]
include: [path.resolve(__dirname, '../save-cloud-frontend-common/kotlin/')]
}
)
config.coverageIstanbulReporter = {
Expand All @@ -24,12 +24,12 @@ config.set({
}
},
proxies: {
// serving mockServiceWorker.js.js from location relative to base url
// serving mockServiceWorker.js from location relative to base url
// the file should be included into Karma's `files` to be served by server at all
'/mockServiceWorker.js': '/base/mockServiceWorker.js',
'/mockServiceWorker.js': '/base/node_modules/mockServiceWorker.js',
},
})

// http://karma-runner.github.io/6.3/config/files.html
// 'All of the relative patterns will get resolved using the basePath first.', where basePath is set by KGP to `node_modules`
config.files.push('./mockServiceWorker.js')
// 'All of the relative patterns will get resolved using the basePath first.', where basePath is NOT set by KGP to `node_modules` after migration to 1.9
config.files.push('./node_modules/mockServiceWorker.js')
8 changes: 4 additions & 4 deletions save-frontend/karma.config.d/custom-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ config.set({
}
},
proxies: {
// serving mockServiceWorker.js.js from location relative to base url
// serving mockServiceWorker.js from location relative to base url
// the file should be included into Karma's `files` to be served by server at all
'/mockServiceWorker.js': '/base/mockServiceWorker.js',
'/mockServiceWorker.js': '/base/node_modules/mockServiceWorker.js',
},
})

// http://karma-runner.github.io/6.3/config/files.html
// 'All of the relative patterns will get resolved using the basePath first.', where basePath is set by KGP to `node_modules`
config.files.push('./mockServiceWorker.js')
// 'All of the relative patterns will get resolved using the basePath first.', where basePath is NOT set by KGP to `node_modules` after migration to 1.9
config.files.push('./node_modules/mockServiceWorker.js')
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
@file:Suppress("FILE_NAME_MATCH_CLASS", "HEADER_MISSING_IN_NON_SINGLE_CLASS_FILE")
@file:JsModule("@react-sigma/layout-circular")
@file:JsNonModule

package com.saveourtool.save.frontend.externals.graph.sigma.layouts

import react.*

/**
* @param settings
* @return [LayoutInstance] with positions and assign functions
*/
@JsName("useLayoutCircular")
@JsModule("@react-sigma/layout-circular")
@JsNonModule
@JsExport
external fun useLayoutCircular(settings: dynamic = definedExternally): LayoutInstance
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
@file:Suppress("FILE_NAME_MATCH_CLASS", "HEADER_MISSING_IN_NON_SINGLE_CLASS_FILE")
@file:JsModule("@react-sigma/layout-forceatlas2")
@file:JsNonModule

package com.saveourtool.save.frontend.externals.graph.sigma.layouts

import react.*

/**
* @param settings
* @return [LayoutInstance] with positions and assign functions
*/
@JsName("useLayoutForceAtlas2")
@JsModule("@react-sigma/layout-forceatlas2")
@JsNonModule
@JsExport
external fun useLayoutForceAtlas2(settings: dynamic = definedExternally): LayoutInstance
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
@file:Suppress("FILE_NAME_MATCH_CLASS", "HEADER_MISSING_IN_NON_SINGLE_CLASS_FILE")
@file:JsModule("@react-sigma/layout-random")
@file:JsNonModule

package com.saveourtool.save.frontend.externals.graph.sigma.layouts

import react.*

/**
* @param settings
* @return [LayoutInstance] with positions and assign functions
*/
@JsName("useLayoutRandom")
@JsModule("@react-sigma/layout-random")
@JsNonModule
@JsExport
external fun useLayoutRandom(settings: dynamic = definedExternally): LayoutInstance

0 comments on commit 967f4db

Please sign in to comment.