Changes since 25.3.0-alpha3
Breaking changes
-
Restore cached Gradle frontend build outputs
Commit · Pull request · IssueGradle production builds could produce application archives (JAR/WAR) without the Vaadin frontend resources when the
vaadinBuildFrontendoutput was restored from Gradle's build cache, causing the packaged application to fail in production because the client bundle was missing. The production frontend output is now a declared task output, so it is correctly restored from the build cache and reliably packaged into the application archive, including custom archive tasks. The newincludeArchiveTasksandexcludeArchiveTasksoptions let you control which archives receive the frontend bundle. Breaking change: a customfrontendOutputDirectorymust now follow theMETA-INF/VAADIN/webapplayout (as the default does). A value that does not end inMETA-INF/VAADIN/webappis rejected with a build error in production mode. Previously it silently produced an archive without the frontend bundle and, on Gradle 9, failed with an implicit task-dependency error.
New features
-
Reject uploads with a synchronous validator
Commit · Pull request · IssueThe pre-made upload handlers offered no supported way to refuse an upload while it was being received; only a fully custom
UploadHandlercould callUploadEvent.reject(...). Subclassing a pre-made handler to reject a captured event did not help: rejection was signalled asynchronously and never checked, so the success callback still ran and file handlers left the written file on disk. AddUploadValidator, registered viawithValidator(...), which is invoked synchronously while the upload is received and can callUploadEvent.reject(...)to abort it before it is stored. Downloads are unaffected.
Fixes
-
Respect custom npm registry in seeded package-lock.json
Commit · Pull requestWhen seeding a project's
package-lock.jsonfrom the dev-bundle template, Flow copied it verbatim, keeping the hardcodedregistry.npmjs.orgURLs in everyresolvedfield. With a custom npm registry configured, this leaves a committed lock (withcleanFrontendFiles=false) that still points atregistry.npmjs.org, and packages can end up being downloaded from npmjs instead of the configured registry — for example when only a scoped@scope:registryis set, or when npm's registry-host rewriting is turned off. This breaks private/air-gapped setups and any tooling that consumes the lock without npm's rewriting. Strip theresolvedfields from the seeded npmpackage-lock.jsonwhen a custom registry is configured, so npm re-resolves the download URLs against that registry. Theintegrityhashes are kept so npm still verifies the downloaded tarballs against the versions Vaadin tested. Default setups keep the verbatim fast-path copy. Whether a custom registry is configured is now determined by npm itself (npm config ls --json) rather than by scanning.npmrcfiles, so it also covers registries set through environment variables, the global npmrc, or the command line, as well as scoped registries. -
Prevent NPE in ElementEffect detach listener on re-attach
Commit · Pull request · IssueElementEffect registered a new detach listener on every attach, stored it in the single detachRegistration field, and relied on each detach listener removing itself. When an element is re-attached without a detach event firing in between - StateNode.removeFromTree(false), as used by UIInternals.moveToNewUI for
@PreserveOnRefresh- a second detach listener was registered while the first was still present. The next real detach ran both: the first nulled detachRegistration, the second dereferenced null and threw a NullPointerException. Register the detach listener through a helper that removes any previous registration before adding a new one, and null-guard the removal inside the listener so at most one detach listener is ever active. -
Skip vaadinBuildFrontend in development mode
Commit · Pull request · IssueThe Gradle vaadinBuildFrontend task is now skipped when Vaadin production mode is not enabled. This prevents development and multi-module builds from failing when the task is part of the build graph, and avoids producing a production configuration while running in development mode.