github vaadin/flow 25.2.0-beta1
Vaadin Flow 25.2.0-beta1

pre-release5 hours ago

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 vaadinPrepareFrontend in development mode (Gradle)
    Commit · Pull request · Issue

    IDE-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 @StyleSheet values
    Commit · Pull request

    Bare relative @StyleSheet hrefs now resolve relative to the context root instead of <base>, fixing 404s when vaadin.urlMapping is 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 request

    A new Geolocation utility wraps the browser Geolocation API. One-shot reads via getPosition(...), continuous tracking via watchPosition(...), all asynchronous and delivered on the UI thread. Results use sealed types (GeolocationPosition | GeolocationError, plus GeolocationPending for the watcher signal) for exhaustive pattern matching. Watches auto-stop on detach; stop() and resume() 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() into onSuccess/onError callbacks
    Commit · Pull request

  • Add addPositionListener to GeolocationWatcher
    Commit · Pull request

  • Add GeolocationClient port for external test drivers
    Commit · Pull request

Clipboard API

  • Add Clipboard text/html write API
    Commit · Pull request

    A new Clipboard entry point binds clipboard writes to a user gesture — the browser requires a fresh gesture for each write. Fluent chaining via Clipboard.onClick(component) produces a ClipboardBinding with fire-and-forget and observed (onCopied / onError) variants for plain text, HTML, field values, and multi-format ClipboardContent.

    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 request

    Read-only signal tracking whether the browser tab is visible+focused, visible+not-focused, or hidden.

  • Add UI router state signal
    Commit · Pull request

    UI.routerStateSignal() is a read-only Signal<RouterState> updated atomically alongside AfterNavigationEvent dispatch, so reactive consumers can observe the active route without registering an AfterNavigationListener.

Components and Events

  • Add getUI() to ComponentEvent
    Commit · Pull request

    No more event.getSource().getUI().ifPresent(...) boilerplate.

  • Support explicit UI in ComponentEvent constructor
    Commit · Pull request

  • Add relevant API to allow drag and drop to a certain location
    Commit · Pull request · Issue

    Exposes clientX/clientY for all D&D events plus offsets of the target and start element to enable repositioning absolutely-positioned components on drop.

  • Introduce HasComponentsOfType for typed child containers
    Commit · Pull request

executeJs and Client-Side JS

Data and Binding

Build, Frontend, and Tooling

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)

Don't miss a new flow release

NewReleases is sending notifications on new releases.