varabyte / kobweb

A modern framework for full stack web apps in Kotlin, built upon Compose HTML
https://kobweb.varabyte.com
Apache License 2.0
1.41k stars 64 forks source link

Add support for a loading UX #268

Open bitspittle opened 1 year ago

bitspittle commented 1 year ago

Basically, if the user goes to load a page that's taking a long time to pull down (mostly because of large JS files), it would be nice to allow users to determine how to render some UI to show that the page isn't just dead.

This will probably require revisiting how the index.html file gets generated, as the following should happen:

1) index.html gets pulled down 2) some minimum JS gets pulled down for rendering a spinner, etc. (or maybe raw html + css?) 3) the remaining JS gets pulled down 4) the final page renders.

bitspittle commented 1 year ago

Probably a first pass (or maybe even the only thing required to close this bug?) is to let users edit their body html in the kobweb block (which currently only lets you modify the block)

So something like this:

kobweb {
   app {
      body { ... }
   }
}