https://kotlinlang.org logo
Join Slack
Powered by
# opensavvy
  • c

    CLOVIS

    07/28/2025, 3:24 PM
    I've finished migrating KtMongo from Kotest to TestBalloon. Some numbers that may be of interest; Protocol:
    ./gradlew clean; ./gradlew check; ./gradlew check --no-configuration-cache --rerun-tasks
    •
    clean
    to ensure there aren't files left over •
    check
    to ensure everything needed is available locally (all dependencies are downloaded, etc) •
    --no-configuration-cache
    to ensure a fair execution order and disable intra-project parallelism •
    --rerun-tasks
    to disable incremental compilation, the build cache, up-to-date checks, etc • Only the last invokation is timed, using Gradle's build timer So: the test measures how long tests execute, but also how long it takes to compile, etc. The repository compiles to nearly all Kotlin targets using cross-compilation, so compilation time is quite a lot. Kotest: 2c899266a67a1c605e97d615afa353246859e261 • 2min 2s TestBalloon: 3dc162f411167345de9f38bd3c4cbb46569afa54 • 1min 2s That's a pretty big difference if you ask me!
    o
    • 2
    • 2
  • c

    CLOVIS

    07/30/2025, 7:00 AM
    KtMongo 0.19.0 is out! • Added multiplatform
    ObjectId
    and
    Timestamp
    • `BsonType.Datetime`is automatically interpreted as
    kotlin.time.Instant
    • Added the aggregation operators
    $switch
    ,
    $type
    ,
    $isNumber
    ,… • Added the filter operators
    $bitsAllClear
    ,… • Added the options
    writeConcern
    and
    readPreference
    • Added a new documentation section on aggregation support Full changelog
  • c

    CLOVIS

    07/31/2025, 7:00 AM
    Prepared 2.1.0 is out! • Improved logging in failed tests with finalizers • Added
    String.matches(String)
    to simplify Regex-based assertions • Added
    checkThrows
    for easy exception-based tests • Deprecated the KotlinX.Datetime compatibility module (all related functionality has been merged into the main module using
    kotlin.time
    ) • Stabilized the resource management APIs • Kotest 6.0.0.M4 and TestBalloon 0.4.0 support Full changelog
    👍🏼 1
  • a

    Albertas

    08/01/2025, 8:50 AM
    Hi! I've been working on a project similar to KtMongo for a while and I no longer have the time to maintain it by myself, so I'm looking into migrating to yours. A few questions, however: • does KtMongo automatically use SerialNames for filters/aggregations/etc? Having to name a property
    _id
    feels incorrect to me, so I prefer annotating it with
    @SerialName("_id")
    instead, along with other properties. • is the
    Parent::child / Child::property
    syntax the only way to refer to nested properties? Using the division operator feels very hacky, how difficult would it be to implement nesting like
    Parent::child { Child::property eq ??? }
    c
    • 2
    • 5
  • c

    CLOVIS

    08/11/2025, 7:00 AM
    KtMongo 0.20.1 is out! • Added the update operators
    $currentDate
    and
    $addToSet
    • Added support for reading and writing
    ObjectId
    But also, the documentation website has been moved to https://ktmongo.opensavvy.dev/! Please share the link to help with SEO 🙏
    K 1
  • r

    Robert Jaros

    08/24/2025, 3:27 PM
    Hi @CLOVIS. I'm testing your vite plugin and I'm not sure why the reload process is slow (slower than with webpack).
    🤔 1
    ✅ 1
    c
    • 2
    • 16
  • c

    CLOVIS

    08/26/2025, 7:00 AM
    KtMongo 0.21.0 is out! • Added the
    $group
    stage and its
    $sum
    accumulator • Added the
    $multiply
    ,
    $divide
    and
    $subtract
    aggregation operators • Added 12 aggregation operators for string management! Full changelog
  • c

    CLOVIS

    08/29/2025, 10:05 AM
    Vite for Kotlin 0.6.1 is out! • Fixed "maximum call stack exceeded" on large projects • Fixed Vite always reloading all files in development mode, now Vite will only reload changed files, this speeds up reload times considerably https://vite-kotlin.opensavvy.dev/news/2025/08/29/v0.6.1.html
    thank you color 2
    🎉 2
  • r

    Robert Jaros

    08/31/2025, 3:48 PM
    I've tested this new version and the .mjs files are correctly cached now. Still, even when using cache, loading a few hundreds of modules takes noticeable time. I don't think using "per-file" granularity with Vite will ever be a good idea 🙂 I'll continue my tests without this option.
  • r

    Robert Jaros

    08/31/2025, 5:18 PM
    In general the Vite plugin works great. I've tested it with one of my largest web apps (built with Kilua) and was able to reduce time from code change to browser refresh from ~12 to ~8 seconds. Still most of that time is Kotlin code compilation (~7 seconds). I use full HMR with webpack, so it's already a lot faster than standard webpack configuration. But I was able to configure full HMR for Vite plugin as well. It requires a bit different module loading and some changes in the application code. And I need to experiment a bit more with module disposal.
    🤷 1
    🤷🏾 1
  • r

    Robert Jaros

    08/31/2025, 5:31 PM
    I need to keep compatibility with both webpack and vite and I've got a problem with resources paths. With webpack I use
    @JsModule("/kotlin/css/style.css")
    but with Vite I need
    @JsModule("/css/style.css")
    . I think the difference is in the directory where node command is executed. With webpack it's
    build/js/packages/<module>
    and
    kotlin
    is one level below. With vite it's
    build/vite/dev/kotlin
    . Could it be changed?
  • r

    Robert Jaros

    08/31/2025, 5:35 PM
    And could you remind me how to configure custom vite plugins? I tested that last year (https://gitlab.com/opensavvy/automation/kotlin-vite/-/issues/50) but I don't remember and can't find any docs.
  • c

    CLOVIS

    08/31/2025, 6:10 PM
    I don't think using "per-file" granularity with Vite will ever be a good idea 🙂 I'll continue my tests without this option.
    My understanding is that it is the use-case Vite aims to tackle...
    r
    • 2
    • 3
  • c

    CLOVIS

    08/31/2025, 6:13 PM
    With webpack I use
    @JsModule("/kotlin/css/style.css")
    but with Vite I need
    @JsModule("/css/style.css")
    .
    I think so. It's this issue, if you want to follow it. I'll increase its priority. https://gitlab.com/opensavvy/automation/kotlin-vite/-/issues/39
    r
    • 2
    • 9
  • c

    CLOVIS

    08/31/2025, 6:14 PM
    The doc on Vite plugins is here: https://vite-kotlin.opensavvy.dev/api-docs/vite-base/opensavvy.gradle.vite.base.config/-vite-config/plugin.html
    thank you color 1
    r
    • 2
    • 15
  • c

    CLOVIS

    09/04/2025, 8:03 PM
    There is now a "getting started" configuration guide for the Vite plugin → https://vite-kotlin.opensavvy.dev/guides/
    🚀 2
  • j

    joseph_ivie

    09/04/2025, 8:33 PM
    Where's KtMongo's BSON KotlinX serialization at? I need to use it or something like it soon.
    c
    • 2
    • 3
  • r

    Robert Jaros

    09/05/2025, 9:13 AM
    Hi. In regards to wasmJs support (https://gitlab.com/opensavvy/automation/kotlin-vite/-/issues/46). I've played a bit with the sources and managed to modify the plugin to work with
    wasmJs
    target insted of
    js
    . The changes are really simple and wasm target works perfectly fine. I would be happy to contribute, but the problem is how to implement both js and wasmJs at the same time, considering that we can have only js, only wasmJs or both targets enabled in the same project. Do you have any suggestions how would you like this to work?
    c
    • 2
    • 12
  • r

    Robert Jaros

    09/05/2025, 10:06 AM
    What is this path pointing at: https://gitlab.com/opensavvy/automation/kotlin-vite/-/blob/main/vite-kotlin/src/main/kotlin/tasks/ConfigWriter.kt#L23 ?
    c
    • 2
    • 11
  • r

    Robert Jaros

    09/05/2025, 12:37 PM
    I'm trying to get along with tailwindcss vite plugin and it doesn't want to play nice 🙂 I think it adds
    /src/**/*.kt
    as files being watched. After every kt file change it reloads the application. And then Vite reloads again when compilation is finished. It is similar to this: https://github.com/tailwindlabs/tailwindcss/issues/16764 . Any idea if we can somehow "de-watch" files in vite?
    c
    • 2
    • 23
  • r

    Robert Jaros

    09/07/2025, 9:26 AM
    For the same application webpack produces smaller JS bundle (webpack: 494KB, vite: 520KB). Perhaps some additional configuration of vite is needed?
    c
    • 2
    • 3
  • r

    Robert Jaros

    09/07/2025, 1:25 PM
    I've published new Kilua template project with Vite plugin configured and ready to use (currently only for JS target). Full HMR with passing compose state to new cycle is implemented. You can compare the implementation with the standard, webpack based template. You can also compare the production bundles.
    👀 1
  • r

    Robert Jaros

    09/09/2025, 4:40 PM
    Could the vite plugin automatically modify standard
    index.html
    file to by compatible with it. The file is already copied to vite directory, just some simple regexp filtering would be enough in my opinion.
    👀 1
    c
    • 2
    • 15
  • c

    CLOVIS

    09/13/2025, 9:53 AM
    Dokka for MkDocs 0.5.3 is out! This release contains a bug fix for the Gradle
    :clean
    task and dependency updates. https://dokka-mkdocs.opensavvy.dev
    o
    • 2
    • 10
  • r

    Robert Jaros

    09/13/2025, 12:07 PM
    What is the correct way to get the plugin configuration? I can't see anything I set inside
    vite {}
    block.
    c
    • 2
    • 13
  • r

    Robert Jaros

    09/13/2025, 2:37 PM
    Is there any particular reason why you create copy tasks using
    DefaultIncrementalSyncTask
    class instead of standard
    Copy
    class?
    c
    • 2
    • 16
  • c

    CLOVIS

    09/13/2025, 3:59 PM
    Vite for Kotlin 0.6.3 is out! • The config file is now called
    vite.config.mjs
    by default (this allows using ES5 and ES6 plugins) • The app won't reload a first time anymore when the Kotlin code changes, it waits for the JS files to change too • The source maps are fixed for the current module • Removed an intermediary copy that happened between all reloads https://vite-kotlin.opensavvy.dev/news/2025/09/13/v0.6.3.html
    🎉 2
  • f

    Florent Martin

    09/15/2025, 6:39 AM
    Hi, you mentionned in June that “The Vite plugin is broken since K2”. I guess this newer 0.6.3 Version should work?
    c
    • 2
    • 16
  • c

    CLOVIS

    09/15/2025, 7:00 AM
    gitlab-ci.main.kts 0.7.1 is out! • Fixed some incorrect defaults with docker images, Pacman and Kaniko • Improved the documentation of artifacts https://gitlab-ci-kts.opensavvy.dev/news/2025/09/13/v0.7.1.html
  • c

    CLOVIS

    09/22/2025, 8:48 AM
    Hey everyone! If you were at KTConf and are interested in KtMongo, this is the place to be! If you have any questions, don't hesitate to ask here. I'm currently searching for early adopters, ideally people who have codebases with high-quality tests, so they can help me figure out the best API shape, and detect edge cases I may have missed. See you next year there too!