https://kotlinlang.org logo
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
kvision
  • s

    spierce7

    01/01/2023, 6:01 PM
    I'm also curious if anyone can speak to the advantages of using KVision over just react with Kotlin.
    a
    r
    • 3
    • 6
  • s

    spierce7

    01/01/2023, 6:02 PM
    My team has recently made the jump from using typescript for our node.js servers to instead using Kotlin, and it's been a hit so far, so now we're investigating the tradeoffs of using Kotlin also for our web UI layer.
  • r

    Robert Jaros

    01/01/2023, 6:58 PM
    This is how it suppose to look. You should now open http://localhost:5000 in your browser.
    m
    • 2
    • 1
  • s

    sigmadelta

    01/02/2023, 7:59 AM
    Hey everyone, best wishes! I’m currently migrating to version
    6.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
    r
    • 2
    • 22
  • m

    muchbeer

    01/02/2023, 11:11 AM
    Hello @Robert Jaros thank your support, I am really looking for a guide for reading data and writing from an excel file using Kvision, there is no much information that can help me so far. I have a good knowledge of kotlin and wanted to learn web development using kvison.
    r
    • 2
    • 4
  • r

    Robert Jaros

    01/02/2023, 5:29 PM
    Almost forgot to announce: KVision 6.0.1 is out https://github.com/rjaros/kvision/releases/tag/6.0.1
  • m

    muchbeer

    01/02/2023, 7:49 PM
    I want to use BootstrapUpload and I have add the dependency below even the Module (BootstrapUploadModule) but kvision does not recognize BootstrapUpload`implementation("io.kvision:kvision-bootstrap-upload:$kvisionVersion")`
    r
    • 2
    • 76
  • m

    muchbeer

    01/02/2023, 9:56 PM
    Unresolved reference: BootstrapUpload
  • r

    Robert Jaros

    01/03/2023, 10:08 AM
    New version of KVision Project Wizard (0.6.0), with support for KVision 6, is published.
  • r

    Robert Jaros

    01/07/2023, 9:20 PM
    KVision 6.0.2 is out https://github.com/rjaros/kvision/releases/tag/6.0.2
  • a

    Anant Kumar Gupta

    01/08/2023, 4:14 AM
    Can anyone have working sample project to work with firebase?
  • a

    adonis

    01/11/2023, 12:55 PM
    Good morning everyone! This is the problem I have right now; I have a SimplePanel with a Tabulator inside and collections that I use to display data and set up/configure the table. The problem comes when I want to delete it. It seems that not only does it get deleted when I call dispose(), but if I don't delete the collections manually, they end up piling up in the memory heap, and as you navigate through the app, they just stack up without being cleaned up by the garbage collector. Is there any reason for that to happen?
    r
    • 2
    • 23
  • r

    Robert Jaros

    01/11/2023, 5:06 PM
    KVision 6.0.3 is out https://github.com/rjaros/kvision/releases/tag/6.0.3
  • r

    Robert Jaros

    01/11/2023, 5:06 PM
    6.0.4 is on the way ...
  • r

    Robert Jaros

    01/11/2023, 5:24 PM
    KVision 6.0.4 is out https://github.com/rjaros/kvision/releases/tag/6.0.4
  • r

    Robert Jaros

    01/11/2023, 5:51 PM
    If anyone is interested in using KVision with Ballast (works great!) - https://copper-leaf.github.io/ballast/wiki/platforms/kvision/
  • r

    Robert Jaros

    01/13/2023, 5:27 PM
    KVision 6.0.5 is out https://github.com/rjaros/kvision/releases/tag/6.0.5
  • i

    Ilya Tel

    01/21/2023, 6:16 PM
    Hi, I noticed that when using root() the container tag is changed to a div, is this the intended behavior ? If so, then it is possible that in this case it is worth clarifying this in the documentation about the root container. in index.html i have
    <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 KVision
    r
    • 2
    • 4
  • r

    Robert Jaros

    01/22/2023, 4:08 PM
    KVision 6.0.6 is out https://github.com/rjaros/kvision/releases/tag/6.0.6
  • i

    Ilya Tel

    01/23/2023, 8:15 AM
    Hi Robert, me again. I am facing a problem. I'm trying to use forms with a custom value and don't know how I should do it. I created custom components (I'm not sure if I did them right as they don't work right now, but the issue I'm writing about is related to another issue)
    filterPanel
    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 ?
    r
    • 2
    • 7
  • i

    Ilya Tel

    01/26/2023, 9:44 AM
    Hi @Robert Jaros, why when I use a bind with selectInput the options are no longer rendered and the component doesn't work as expected ?
    val 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 it
    r
    • 2
    • 2
  • r

    Robert Jaros

    01/26/2023, 12:17 PM
    We have just reached 1K ⭐ on GitHub! 🎉🍾🤩:thank-you:
  • r

    Robert Jaros

    01/28/2023, 2:06 PM
    KVision 6.1.0 is out https://github.com/rjaros/kvision/releases/tag/6.1.0
  • i

    Ilya Tel

    01/28/2023, 4:13 PM
    Hello, I have a few questions. 1. what are the use cases for
    refreshOnUpdate
    ? 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{})
    r
    • 2
    • 17
  • r

    Robert Jaros

    01/28/2023, 8:44 PM
    Tabulator component in 6.1.0 is broken 😞 6.1.1 is on the way ...
  • r

    Robert Jaros

    01/28/2023, 9:48 PM
    KVision 6.1.1 is out https://github.com/rjaros/kvision/releases/tag/6.1.1
  • r

    Robert Jaros

    01/31/2023, 4:09 PM
    KVision 6.1.2 is out https://github.com/rjaros/kvision/releases/tag/6.1.2
  • i

    Ilya Tel

    02/01/2023, 4:59 PM
    Hello, first a small suggestion for improvement: I noticed that after the initialization of the application, the attributes disappear from the root container element. For example, someone might want to set the data-token="sometoken" attribute. ---------------------------------------------- Now the problem. I'm not sure if this is related to KVision. Instead of implementation("io.kvision:kvision-rest:$kvisionVersion") I tried using implementation("io.ktor:ktor-client-content-negotiation-js:$ktor_version") implementation("io.ktor:ktor-serialization-kotlinx-json-js:$ktor_version") Now when I do
    ./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)
    }
    r
    • 2
    • 7
  • r

    Robert Jaros

    02/06/2023, 6:42 AM
    KVision 6.2.0 is out https://github.com/rjaros/kvision/releases/tag/6.2.0
  • a

    Andromadus Naruto

    02/14/2023, 11:07 PM
    Hi. I used KVision to build the frontend of this project and I would like your feedback regarding its usage including any criticisms and suggestions. Thanks.
    r
    • 2
    • 10
Powered by Linen
Title
a

Andromadus Naruto

02/14/2023, 11:07 PM
Hi. I used KVision to build the frontend of this project and I would like your feedback regarding its usage including any criticisms and suggestions. Thanks.
r

Robert Jaros

02/15/2023, 6:47 AM
Looks cool, clean and readable.
I would definitely remove all unused KVision modules to save bundle size.
Or you can make use of them - e.g. you can use Imask module to enhance you form fields with masked phone number and or email.
I would probably drop
required
for some form fields (e.g.
Note
)
And last but not least 😉 When implementing endpoint you are using three separate "facades" to save data to the database. Every facade is using transaction to save the data. But in my opinion you are missing transaction for the whole operation. Saving a contact should be an atomic and transactional operation. Unfortunately I'm not using exposed so I don't how to do it correctly.
If you don't mind, I would be happy to add a link to your project as an example on KVision website.
a

Andromadus Naruto

02/15/2023, 7:09 AM
I've not explored Imask but I'll check it out soon.
Okay. Sorry regarding the database transaction, that's really an issue. There's a way to use a transaction scope across multiple calls but I didn't want to include database logic in the endpoint service. I'm going to do more investigation on that today. Or what do you think?
I also have few updates planned: • Global Loading state (using Pace or something similar to the one used in some of your production apps) • Global Dispatcher for Notifications Events (I doubt I might change from Toast but who knows...) • Authentication • Task Management
r

Robert Jaros

02/15/2023, 12:18 PM
https://kvision.io/#examples
View count: 11