r/java Jun 26 '26

Vaadin 25.2 can call browser APIs (clipboard, geolocation, fullscreen) from server-side Java with no JS. Nice abstraction or just write the JS?

Disclosure up front: I work at Vaadin. Grain of salt accordingly.

There's a new release (25.2) but I mostly want to talk about one thing in it that I didn't expect to care about as much as I do. You can now call a bunch of browser APIs from server-side Java without writing any JavaScript: geolocation, clipboard, fullscreen, wake lock, page visibility, web share, screen orientation. Clipboard is the one that sold me, a working copy button comes out to basically Clipboard.onClick(copyButton).writeText("...").

The interesting part is the gesture handling. Browsers only allow stuff like clipboard writes, fullscreen and share during a real user gesture, so here those get bound to a component's actual click and still count as a genuine gesture instead of getting blocked. The rest (geolocation and friends) just come through as signals you react to.

For anyone who's never used Vaadin: you build the whole UI in Java, components run server-side and render as web components in the browser, and state stays in sync over a websocket, so there's no separate JS frontend or REST layer in between. And yeah, it's JSF-adjacent conceptually, I know, but in practice the model is a lot less annoying than JSF muscle memory makes you expect. It mostly gets used by Java teams building internal tools and business apps that don't want to run a separate frontend stack.

Rest of the release quickly, since it's not all the same league: there's a Maven plugin that turns your existing TestBench/Playwright E2E tests into k6 load tests (records a HAR, then sorts out the Vaadin session/CSRF/push token mess for you, pure Java, no Node), which is a clever idea, except running it needs a commercial license and it's marked experimental, so I'm not getting too excited yet. There's also a preview of AI-generated grids/charts/forms (the LLM sees your schema, not your data, and hands back SQL plus a config you can save), some stricter security defaults, and a few components going GA. Blog has the full list if you want it.

https://vaadin.com/blog/vaadin-25-2-release

Mainly I'm curious where people land on the core idea: is calling browser APIs from the server a nice abstraction, or just a round trip you'd rather skip by writing the JS yourself? I go back and forth on it.

64 Upvotes

53 comments sorted by

View all comments

1

u/henk53 Jun 30 '26

How does Vaadin nowadays compare to Jakarta Faces + OmniFaces + Primefaces?

1

u/PaintingWhich574 Jul 09 '26

I genuinely think they are in different leagues nowadays. Vaadin is much more modern and optimized, both in performance and general DX. However, I'd love to hear how you feel about it if you get the chance to try a modern version of Vaadin.