Changes since 24.3.0.alpha7
New features
-
New Navigation Access Control API
Pull request · Docs in draftAdds the URL-based access checker in addition to existing Vaadin view-based access checker.
Allows to add custom access checkers and customise overall access control configuration.
URL-based access checker is mainly for cases when Spring URL-based security is used with no Vaadin view-based access checker (e.g. where custom access logic is implemented) to secure Vaadin routes when navigation is done withRouterLink
,Anchor
and server-side navigation. -
Add React router integration for Flow routes
Pull requestMakes it possible to add and use Flow routes in Vaadin Hilla + React applications.
To enable navigating to Flow routes, one needs to add the following tofrontend/routes.tsx
file:
Import for server-side routes object:import {serverSideRoutes} from "Frontend/generated/flow/Flow";
child entry for server-side routes:
export const routes = [ { element: <MainLayout />, handle: { title: 'Main' }, children: [ { path: '/', element: <HelloWorldView />, handle: { title: 'Hello World' } }, ...serverSideRoutes ], }, ] as RouteObject[];
-
Show error view on action exception
Commit · Pull request · Issue · DocsIf there is a error view for the thrown exception during RPC handling update view to error view. Using the util class enables custom error handlers to also opt in to the feature.
-
Reset focus on active element in ShortcutRegistration
Commit · Pull request · Issue · DocsAdds
setResetFocusOnActiveElement
,resetFocusOnActiveElement
andisResetFocusOnActiveElement
toShortcutRegistration
class to optionally reset focus on active element (focused element in browser). Resetting means calling blur() and focus() on the active element to ensure that input fields with ValueChangeMode ON_CHANGE will fire value change event before shortcut handler is run.This ensures any pending input value change events for that focused element are submitted before a shortcut is activated.
-
Default I18N provider
Commit · Pull request · Issue · DocsAdd implementation for a I18N provider that is loaded if there are translation properties files in the defined classpath folder
vaadin-i18n
. If a custom I18N is set, default will never be loaded. -
Add AccessDeniedException for ViewAccessChecker
Commit · Pull request · Issue · DocsViewAccessChecker
is changed to throwAccessDeniedException
instead ofNotFoundException
by default when access is denied. Added default error pageRouteAccessDeniedError
for theAccessDeniedException
. Page is same asRouteNotFoundError
by default (extendsAbstractRouteNotFoundError
). AddedAccessDeniedErrorRouter
annotation to
customise rerouting of access denied error per route withAccessDeniedErrorRouter#rerouteToError
. -
Add getActiveViewLocation and getActiveRouterTargetsChain to UI
Commit · Pull request · IssueAdds new public API for already existing features in
UIInternals
.UI#getActiveViewLocation()
is shortcut toUIInternals#getActiveViewLocation()
andUI#getActiveRouterTargetsChain()
is shortcut toUIInternals#getActiveRouterTargetsChain()
. -
Add Div constructor that accept text content
Commit · Pull request · Issue -
Log JavaScript exceptions in production mode
Pull request · Issue -
Add RouteParameters to AfterNavigationEvent
Commit · Pull request · IssueAdds a getter for RouteParameters in AfterNavigationEvent.
-
Add Component/Element to ErrorEvent
Commit · Pull request · Issue · DocsNow it is possible to query for the element/component that threw the exception leading to the ErrorEvent.
-
Add default I18N provider bean for Spring
Commit · Pull request · IssueExtends DefaultI18NProvider (#5917) for Spring.
VaadinApplicationConfiguration
definesDefaultI18NProvider
bean and initializes it with locales based on translation properties files found in the classpath under '/vaadin-i18n' path. -
Reuse the production bundle if no changes
Commit · Pull request · IssueMakes a copy of the production bundle in
src/main/bundles/prod.bundle
zip file to make it possible to reuse it without recreating same unchanged bundle again. When prod.bundle exists, it will be used as a primary source for stats.json file. -
Use devBundle from build folder
Commit · Pull request · IssueMove devBundle to build folder and create a single compressed file for devBundle that can be committed into the versioning system.
-
Restrict debug websocket connection to loopback addresses by default
Commit · Pull requestUsing the
devmode.hostsAllowed
property, you can define additional addresses (comma separated list using */? wildcards) that are allowed to use the debug websocket connection. -
Implement RangeInputElement
Commit · Pull request · Issue
Fixes
-
Redirect to error view by default for errors in RPC-handling
Commit · Pull request -
Postpone commands scheduled with runWhenAttached for detached nodes
Commit · Pull request · Issues 1434, 18020When detach listeners are called, the node still has a parent set, causing commands scheduled with runWhenAttached to be executed immediately. This change make runWhenAttached postpone the command by registering an attach listener, if the node has been detached during the same roundtrip.
-
RangeInput orientation: add support for Chrome, Edge and Safari
Commit · Pull request