spierce7
01/01/2023, 6:01 PMspierce7
01/01/2023, 6:02 PMRobert Jaros
01/01/2023, 6:58 PMsigmadelta
01/02/2023, 7:59 AM6.0.1
with Kotlin 1.8.0
(mandatory I would assume from the build errors it gave me?). Gradle sync works fine, but when I try to build the project I’m presented with following error:
PROJECTPATH/build/generated/ksp/metadata/commonMain/kotlin/be/sigmadelta/PROJECTNAME/service/UserService.kt:15:9 Cannot inline bytecode built with JVM target 17 into bytecode that is being built with JVM target 1.8. Please specify proper '-jvm-target' option
So then I change the jvmTarget
to `17`as prompted (see below):
jvm("backend") {
compilations.all {
java {
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "17"
freeCompilerArgs = listOf("-Xjsr305=strict")
}
...
Afterward I try to build again, but then it encounters a build error in `Main.kt`:
e: PROJECTPATH/src/backendMain/kotlin/be/sigmadelta/PROJECTNAME/Main.kt:56:5 None of the following functions can be called with the arguments supplied:
public fun Application.kvisionInit(vararg modules: Module): Injector defined in io.kvision.remote
public fun Application.kvisionInit(initStaticResources: Boolean, vararg modules: Module): Injector defined in io.kvision.remote
public fun Application.kvisionInit(initStaticResources: Boolean, json: Json, vararg modules: Module): Injector defined in io.kvision.remote
public fun Application.kvisionInit(json: Json, vararg modules: Module): Injector defined in io.kvision.remote
And this happens on an unchanged kvisionInit
which worked fine on version `5.18.1`:
fun Application.main() {
...
kvisionInit(
Json {
prettyPrint = true
isLenient = true
classDiscriminator = "class"
},
KoinModules.tableModule,
KoinModules.repoModule,
KoinModules.serviceModule,
KoinModules.appModule(
this@main,
JwtProps(
secret = environment.config.property("jwt.secret").getString(),
issuer = environment.config.property("jwt.issuer").getString(),
audience = environment.config.property("jwt.audience").getString(),
realm = environment.config.property("jwt.realm").getString()
)
)
)
...
Does anyone know how to resolve this issue? I assume something is just going wrong with the mandatory Kotlin upgrade to 1.8.0
muchbeer
01/02/2023, 11:11 AMRobert Jaros
01/02/2023, 5:29 PMmuchbeer
01/02/2023, 7:49 PMmuchbeer
01/02/2023, 9:56 PMRobert Jaros
01/03/2023, 10:08 AMRobert Jaros
01/07/2023, 9:20 PMAnant Kumar Gupta
01/08/2023, 4:14 AMadonis
01/11/2023, 12:55 PMRobert Jaros
01/11/2023, 5:06 PMRobert Jaros
01/11/2023, 5:06 PMRobert Jaros
01/11/2023, 5:24 PMRobert Jaros
01/11/2023, 5:51 PMRobert Jaros
01/13/2023, 5:27 PMIlya Tel
01/21/2023, 6:16 PM<nav id="menu-path"></nav>
I do so
root("menu-path")
and expect
<nav id="menu-path"></nav>
but the result
<div id="menu-path"></div>
And thank you very much for KVisionRobert Jaros
01/22/2023, 4:08 PMIlya Tel
01/23/2023, 8:15 AMfilterPanel
filterAutocompleteItem
houseAutocomplete
And I want to use them like this:
filterPanel(submitFormCallback = {
println(it.getData())
}) {
filterAutocompleteItem("Address") {
houseAutocomplete()
}
}
My problem is that I can't set the value with Any type.
To make it clearer what I mean and why I need this, here is my case:
In houseAutocomplete()
, I receive data from the backend and form a list of options, when the user clicks, I want to set my data class
as the field value for the form
.
But I'm limited by the fact that the field type I'm using on the form only accepts a string as a value (which is logical and correct).
Also, I can't use Serialization for the value, since I don't want to show the user the complete serialized object.
What I want is the ability to set a custom value for a form field. It does not need to be serialized or deserialized. Since it does not need to be explicitly shown to the user.
For example, houseAutocomplete()
could set
data class AutocompleteOption(val label: String, val value: Any)
as the customValue
for textInput
and just a label: String
as the value
And for the form one could use the getCustomData()
method to get the custom values
What do you think about it ? I understood correctly that this cannot be achieved now ? Or is there another way ?Ilya Tel
01/26/2023, 9:44 AMval state = FormState().apply {
set("type" to "${FlatTypeEnum.residential}")
}
I tried different options for bind and nothing worked.
selectInput(options = FlatTypeEnum.values().map { "$it" to it.translate() }, value = "${FlatTypeEnum.residential}") {
bind(state.getSub("type"), {it?.value}) {//if I use this the options are not shown anymore
this.value = it
}
}
with bind i got <select class="form-select"></select>
without itRobert Jaros
01/26/2023, 12:17 PMRobert Jaros
01/28/2023, 2:06 PMIlya Tel
01/28/2023, 4:13 PMrefreshOnUpdate
? I read the documentation and saw only `override fun buildClassSet(classSetBuilder: ClassSetBuilder)`use case.
For example, сan it interact with rendering ? (not working):
class Example(ids: List<Long>): SimplePanel() {
var myIds by refreshOnUpdate(ids)
init {
button("${myIds}") {//interact somehow
onClickLaunch { myIds = listOf(2L) }
}
}
}
2. What if I have a component where models comes as an argument models: ObservableValue<List<Order>>
.
Inside I create val pagination: ObservableValue<Pagination>
Next, I want to have a div
that will change when the models
changes or when the pagination
changes. I can't figure out how to achieve this now.
For example, I can't put models and pagination in val state: ObservableValue<SomeState>
because models
are being updated in another component, but the rerender will only happen when the state
changes state.setValue(state.value.apply{})
Robert Jaros
01/28/2023, 8:44 PMRobert Jaros
01/28/2023, 9:48 PMRobert Jaros
01/31/2023, 4:09 PMIlya Tel
02/01/2023, 4:59 PM./gradlew -t run
everything works fine,
But when i do a ./gradlew clean zip
, then a certain part of my app breaks, with an undefined function (the function has a minimized name) message...
95% of the application works fine, but in one part, which in my opinion is no different from the rest, I get this error when I try to send a request
If I do a ./gradlew zip
everything works fine
Has anyone encountered this ?
I will most likely revert to using kvision-rest soon, but I also thought it would be helpful to get your input on the issue.
here's my build.gradle.kts
import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackConfig
plugins {
val kotlinVersion: String by System.getProperties()
kotlin("plugin.serialization") version kotlinVersion
kotlin("js") version kotlinVersion
val kvisionVersion: String by System.getProperties()
id("io.kvision") version kvisionVersion
}
version = "1.0.0-SNAPSHOT"
group = "com.example"
repositories {
mavenCentral()
mavenLocal()
}
// Versions
val kotlinVersion: String by System.getProperties()
val kvisionVersion: String by System.getProperties()
val ktor_version: String by project
val webDir = file("src/main/web")
kotlin {
js {
browser {
runTask {
outputFileName = "main.bundle.js"
sourceMaps = false
devServer = KotlinWebpackConfig.DevServer(
open = false,
port = 3000,
proxy = mutableMapOf(
"/kv/*" to "<http://localhost:8080>",
"/kvws/*" to mapOf("target" to "<ws://localhost:8080>", "ws" to true)
),
static = mutableListOf("$buildDir/processedResources/js/main")
)
}
webpackTask {
outputFileName = "main.bundle.js"
}
// testTask {
// useKarma {
// useChromeHeadless()
// }
// }
}
binaries.executable()
}
sourceSets["main"].dependencies {
implementation("io.kvision:kvision:$kvisionVersion")
implementation("io.kvision:kvision-bootstrap:$kvisionVersion")
implementation("io.kvision:kvision-i18n:$kvisionVersion")
implementation("io.kvision:kvision-routing-navigo-ng:$kvisionVersion")
implementation("io.kvision:kvision-state:$kvisionVersion")
implementation("io.kvision:kvision-toastify:$kvisionVersion")
implementation("io.kvision:kvision-imask:$kvisionVersion")
implementation("io.ktor:ktor-client-content-negotiation-js:$ktor_version")
implementation("io.ktor:ktor-serialization-kotlinx-json-js:$ktor_version")
}
sourceSets["test"].dependencies {
implementation(kotlin("test-js"))
implementation("io.kvision:kvision-testutils:$kvisionVersion")
}
sourceSets["main"].resources.srcDir(webDir)
}
Robert Jaros
02/06/2023, 6:42 AMAndromadus Naruto
02/14/2023, 11:07 PMAndromadus Naruto
02/14/2023, 11:07 PMRobert Jaros
02/15/2023, 6:47 AMrequired
for some form fields (e.g. Note
)Andromadus Naruto
02/15/2023, 7:09 AMRobert Jaros
02/15/2023, 12:18 PM