Show HN: Undead – scary fast, bewitching web pages on the JVM with no JavaScript (github.com)
Hey HN. I wrote a LiveView implementation for the JVM called Undead. (The name Undead is a play on the "Live" part of LiveViews.)
I had been waiting for the new StringTemplates feature of Java 21 which made it scary-easy to get the right data structures to make things work.
It's been enchanting to write Java after about ten years in Javascript and Go lands. Would love folks to try it out and lmk what you think. If you aren't too scared that is. ;)
7 comments
[ 3.1 ms ] story [ 25.7 ms ] threadWhat is the use case for this project:
You can think about it as a server-rendered HTML page that gets updated via Websocket updates.
That doesn't really do it justice either. I think writing a little bit of code and running a LiveView server is probably the best way to truly grok it.
Like any new paradigm, it takes a bit of a mind shift to see the value.
If you can, try running the Undead example server by downloading the repo and running:
`mvn package exec:exec`
I've never heard of LiveViews before, but honestly this is what I think we've been looking for... treat the browser just as a rendering engine, keep your codebase on the server.
I'm curious if the protocol could be implemented on Quarkus, or preferably Tomcat or TomEE... one thing we've come to love in recent years is CDI. It just make writing large applications very easy because they can all be broken down into simple parts and tested individually using Mockito. I could imagine all sorts of cool CDI extensions with this... an 'EventScoped' bean and CDI Events would fit right into the whole concept.
Can you explain a little more about what's happening? Watching the network inspector, it looks like the browser is relaying events back to the server over a websocket (as you said). After that, what's happening on the server side? Somehow it arrives at a diff command for the client. Curious what's happening to calculate the diff!
https://www.jfx-central.com/
The code base is actually a desktop application written in JavaFX, where the browser just happens to be a "monitor screen" showing you the desktop app.
As for server-side state and server-side rendered UI, many other Java frameworks have implemented similar techniques, including but not limited to: JSF, Apache Wicket, Vaadin, etc.
I am not sure this project is truly innovating here, with things like: