Overview
Vaadin Flow 25.2 adds Java API for two browser features — Geolocation and Clipboard. The reactive signal API gains pageVisibilitySignal() and routerStateSignal(), and the release ships major dependency upgrades (Vite 8, Spring Boot 4.1.0, JUnit Jupiter 6.1).
Breaking Changes
-
Stop auto-running
vaadinPrepareFrontendin development mode (Gradle)
Commit · Pull request · IssueIDE-triggered Gradle builds no longer interfere with the running Vite dev server. The previous behavior can be restored with
alwaysExecutePrepareFrontend = true. -
Auto-apply
context://for@StyleSheetvalues
Commit · Pull requestBare relative
@StyleSheethrefs now resolve relative to the context root instead of<base>, fixing 404s whenvaadin.urlMappingis set to a non-root path.http(s)://,//,context://,base://, and/-prefixed values pass through unchanged.
New Features
Geolocation API
-
Add Geolocation API
Commit · Pull requestA new
Geolocationutility wraps the browser Geolocation API. One-shot reads viagetPosition(...), continuous tracking viawatchPosition(...), all asynchronous and delivered on the UI thread. Results use sealed types (GeolocationPosition|GeolocationError, plusGeolocationPendingfor the watcher signal) for exhaustive pattern matching. Watches auto-stop on detach;stop()andresume()are explicit.// One-shot read Button locate = new Button("Use my location"); locate.addClickListener(e -> Geolocation.getPosition( pos -> showNearest(pos.coords().latitude(), pos.coords().longitude()), err -> showManualEntry())); // Continuous tracking via reactive signal GeolocationWatcher watcher = Geolocation.watchPosition(this); Signal.effect(() -> { if (watcher.positionSignal().get() instanceof GeolocationPosition pos) { map.setCenter(pos.coords().longitude(), pos.coords().latitude()); } });
-
Split
get()intoonSuccess/onErrorcallbacks
Commit · Pull request -
Add
addPositionListenertoGeolocationWatcher
Commit · Pull request -
Add
GeolocationClientport for external test drivers
Commit · Pull request
Clipboard API
-
Add Clipboard text/html write API
Commit · Pull requestA new
Clipboardentry point binds clipboard writes to a user gesture — the browser requires a fresh gesture for each write. Fluent chaining viaClipboard.onClick(component)produces aClipboardBindingwith fire-and-forget and observed (onCopied/onError) variants for plain text, HTML, field values, and multi-formatClipboardContent.Button copy = new Button("Copy"); // Copy a literal value Clipboard.onClick(copy).writeText("Hello, world"); // Copy the current value of a field, with success/error callbacks Clipboard.onClick(copy).writeText(textField, copied -> Notification.show("Copied " + copied), err -> Notification.show("Failed: " + err.message())); // Multi-format: text + HTML Clipboard.onClick(copy).write(ClipboardContent.create() .text("Hello") .html("<b>Hello</b>"));
Signals
-
Add
pageVisibilitySignal()to Page for tracking browser tab visibility
Commit · Pull requestRead-only signal tracking whether the browser tab is visible+focused, visible+not-focused, or hidden.
-
Add UI router state signal
Commit · Pull requestUI.routerStateSignal()is a read-onlySignal<RouterState>updated atomically alongsideAfterNavigationEventdispatch, so reactive consumers can observe the active route without registering anAfterNavigationListener.
Components and Events
-
Add
getUI()toComponentEvent
Commit · Pull requestNo more
event.getSource().getUI().ifPresent(...)boilerplate. -
Support explicit UI in
ComponentEventconstructor
Commit · Pull request -
Add relevant API to allow drag and drop to a certain location
Commit · Pull request · IssueExposes
clientX/clientYfor all D&D events plus offsets of the target and start element to enable repositioning absolutely-positioned components on drop. -
Introduce
HasComponentsOfTypefor typed child containers
Commit · Pull request
executeJs and Client-Side JS
-
Add
JsFunctionvalue type for composableexecuteJs
Commit · Pull request -
Add
Element.addJsInitializerfor scoped client-side JS lifecycle
Commit · Pull request
Data and Binding
-
Extract interface
HierarchicalTreeDatafromTreeData
Commit · Pull request -
Add overloaded
fromInputStreammethod withfileNameOverride
Commit · Pull request
Build, Frontend, and Tooling
-
Upgrade Vite 7 to Vite 8
Commit · Pull request -
Only install npm packages that have been available more than a day
Commit · Pull requestDefault
--min-release-ageguards against supply-chain attacks via fresh releases. -
BuildFrontend incremental build
Commit · Pull request · Issue -
Add help goal for the Maven plugin
Commit · Pull request
Dependency Updates
- Spring Boot updated to 4.1.0-RC1 (from 4.0.4)
- Vite updated to 8.0.14 (from 7)
- Node.js updated to 24.16.0 (from 24.14.1)
- pnpm updated to 11.1.3 (from 11.0.4)
- TypeScript updated to 6.0.3
- TestBench updated to 10.2.0-beta1 (from 10.1)
- JUnit Jupiter updated to 6.1.0 (from 6.0.3)
- Jackson BOM updated to 3.1.3 (from 3.1.0)
- Jetty updated to 12.1.9 (from 12.1.7)
- Tailwind CSS updated to 4.2.2
- Maven updated to 3.9.16 (from 3.9.14)
- ASM updated to 9.10.1 (from 9.9.1)
- Workbox bumped to current
- Guava updated to 33.6.0-jre (from 33.5.0-jre)