Thread
#compose-web
    Mihai Voicescu

    Mihai Voicescu

    10 months ago
    Live reload does not seem to work. I make changes, save, webpack runs and nothing happens. You have to restart the server for it to work... I running with
    jsBrowserDevelopmentRun
    The browser just states that no actual changes were detected...
    Big Chungus

    Big Chungus

    10 months ago
    You need gradle continuous build
    ./gradlew jsBrowserRun -t
    Mihai Voicescu

    Mihai Voicescu

    10 months ago
    Thank you @Big Chungus
    LeoColman

    LeoColman

    10 months ago
    @Big Chungus on the same subject, my project seems to reload twice before actually displaying updates. Do you know what exactly causes this?
    Big Chungus

    Big Chungus

    10 months ago
    That's expected. It reloads once due to webpack changes (as described in the original post) and once again once kotlin files are recompiled to js
    Should be fixable, but looks like kotlin/js teams didn't get to it just yet.
    LeoColman

    LeoColman

    10 months ago
    It's not exactly urgent 😄
    Big Chungus

    Big Chungus

    10 months ago
    Yep, it won't be any quicker even if we get rid of first reload since the main blocker is kjs compilation. Just annoying is all.
    LeoColman

    LeoColman

    10 months ago
    Usually it goes:1. First reload: Why didn't my div size change? 2. Second reload: Ah, it did
    n

    Norbi

    10 months ago
    "I make changes, save" - It does not work for me either. I don't know if it should or not. Although if1. I build the project (CTRL+F9 in Idea) 2. AND after the build I reload the application explicitly (F5 in the browser) it works. Not fast but works 😃 Usually there is an automatic reload in the browser between 1. and 2. but to see the changes I have to manually refresh in the browser after the build is finished. So, the development flow is far from perfect but acceptable 😃
    Big Chungus

    Big Chungus

    10 months ago
    @Norbi you can skip step 1 with gradle continuous builds (same end result just automated)
    n

    Norbi

    10 months ago
    "you can skip step 1 with gradle continuous builds" - Yes... But if you have a multi-module project where the backend is also part of the same Idea project then the continuous build is not always practical...
    Big Chungus

    Big Chungus

    10 months ago
    Why not? You don;t have to start it from root project. Consider this module structure
    /root
      /server
      /client
    With that then you can start continuous build just for the client via
    ./gradlew :client:jsBrowserRun -t
    n

    Norbi

    10 months ago
    The problem is with common projects shared by both the client and the server. When I modify common code the continuous build forces the automatic reload of the Spring Boot server application as well which I not always want. (At least as I remember that was the cause why I stopped using the continuous build.)
    Big Chungus

    Big Chungus

    10 months ago
    Why wouldn't you want to reload your server if it depends on common code that has changed?
    To avoid this, you could start your server from prebuilt fat-jar. That way code changes won't reload it
    n

    Norbi

    10 months ago
    "you could start your server from prebuilt fat-jar" - I'm not sure that Spring Boot live reloading works with pre-built jar but I will try it some day, thanks 😃
    Big Chungus

    Big Chungus

    10 months ago
    Isn't the point to avoid spring live reloading? Fat jar is means to do exactly that - start server once and disconnect it from source code and gradle that way