Skip to content

Releases: vaadin/flow

Vaadin Flow 24.3.10

06 May 06:51
668e0c8
Compare
Choose a tag to compare

Changes since 24.3.9

All changes

Fixes

  • Include filesystem dependencies in gradle plugin class finder (#19287) (CP: 24.3)
    Commit · Pull request · Issue

  • Prevent embedded styles to leak main document (#19274)
    Commit · Pull request · Issues 12704, 19265

    When using an exported a themed Flow web-component, Lumo style may leak the embedding document, causing invalid CSS rules to be applied. This change prevents applying Lumo global imports when the theme is applied to a web-component.

  • Prevent embedded styles to leak main document (#19221)
    Commit · Pull request · Issue

    When using an exported a themed Flow web-component, Lumo style may leak the embedding document, causing invalid CSS rules to be applied. This change prevents applying Lumo global imports when the theme is applied to a web-component.

Vaadin Flow 24.4.0.beta1

30 Apr 14:24
f8f1774
Compare
Choose a tag to compare
Pre-release

All Changes since Vaadin Flow 24.3

Changes since 24.4.0.alpha32

New and Noteworthy Since Vaadin Flow 24.3:

  • Mixing Flow and Hilla views in one single application
    Docs · Example Project

    Vaadin project can now have both server-side and client-side routes, written in Java or React, aka Flow views and Hilla views respectively. This doesn't need any special configuration, Vaadin Flow uses the React Router by default, adds all needed React dependencies and React components, provided by Vaadin.
    Start adding Flow views as Route-annotated Java classes in src/main/java/com/example/ and React views written in TypeScript in src/main/frontend/views/.
    Use Main annotation for Flow views that have to be shown in the main layout written in React.

    Example of a Flow view:
    src/main/java/com/example/application/FlowView.java

    @Route
    @Menu
    public class FlowView extends VerticalLayout {
    }

    See the linked online documentation above for more information.

  • Using React components from Flow
    Docs

    You can wrap any React component as a Flow component and use it in your Flow view, change the component's state and send events from server to client and vice-versa.

    src/main/frontend/rgba-color-picker.tsx:

    class RgbaColorPickerElement extends ReactAdapterElement {
       protected override render(hooks: RenderHooks): ReactElement | null { 
          const [color, setColor] = hooks.useState<RgbaColor>("color"); 
          return <RgbaColorPicker color={color} onChange={setColor} />; 
       }
    }
    
    customElements.define("rgba-color-picker", RgbaColorPickerElement); 

    src/main/java/com/example/application/RgbaColorPicker.java:

    @NpmPackage(value = "react-colorful", version = "5.6.1") 
    @JsModule("./rgba-color-picker.tsx") 
    @Tag("rgba-color-picker") 
    class RgbaColorPicker extends ReactAdapterComponent {
        public RgbaColorPicker() {
           setColor(new RgbaColor(255, 0, 0, 0.5));
        }
    
        public RgbaColor getColor() {
           return getState("color", RgbaColor.class);
        }
    
        public void setColor(RgbaColor color) {
           setState("color", color);
        }
    }

    src/main/java/com/example/application/FlowView.java:

    @Route
    public class FlowView extends VerticalLayout {
       public FlowView() {
          add(new RgbaColorPicker());
       }
    }
  • Using Flow components from React
    Docs

    Flow components can be embedded in a Hilla/React view by using a known WebComponentExporter API and using the exported Web component on the React view:

    src/main/java/com/example/application/MyFlowComponentExporter.java:

    public class MyFlowComponentExporter
         extends WebComponentExporter<CustomComponent> {
        public static final String TAG = "my-flow-component";
        public MyFlowComponentExporter() {
           super(TAG);
        }
    
        @Override
        protected void configureInstance(WebComponent<CustomComponent> webComponent,
                                      CustomComponent component) {
        }
    }

    src/main/frontend/views/hilla.tsx:

    function MyFlowComponent() {
       return createWebComponent("my-flow-component");
    }
    
    export default function HillaView() {
       return (
           <>
               <VerticalLayout className={'centered-content'}>
                  <h3>Hilla View</h3>
                  <MyFlowComponent/>
               </VerticalLayout>
          </>
       );
    }
  • Use React Router by default
    Docs · Issue

    Vaadin Flow uses React Router by default, which gives an opportunity to start adding React components/views immediately into Vaadin application and develop in React.
    The legacy @vaadin/router is still supported and can be enabled with the reactEnable=false configuration parameter, see the linked online documentation. E.g. when you develop your client-side views with Lit and Hilla.

  • Move /frontend directory under /src/main by default
    Issue · Pull Request

    Vaadin now uses src/main/frontend/ directory as a default location of frontend resources, which is more natural for Maven projects. It fallbacks to frontend directory if the src/main/frontend/ does not exist.

  • Open tab in dev mode less often
    Docs · Commit · Pull request

    After default 30 min Vaadin opens a new tab on server restart. If server is restarted again before timeout, then the browser tab is reused.

  • Add translation file request handler
    Commit · Pull request · Issue

    This PR adds a request handler to serve translation properties files. For the request to be handled by this handler, the request type should be i18n. There is one optional parameter to construct the locale: langtag. If a translation properties file that corresponds to the locale, the response contains the translation entries in JSON format. Otherwise, it contains the default file or returns a not found response. The default file is the bundle for the root locale. The system default locale is not considered to be the default, and is not used for fallback. The response header also contains information regarding the retrieved file locale.

  • Add getItemIndex to DataView
    Commit · Pull request · Issue

    New getItemIndex method in DataView affects ListDataView and LazyDataView implementations. LazyDataView introduces in addition a new method setItemIndexProvider(ItemIndexProvider). With ListDataView, getItemIndex works out-of-the-box with the in-memory data. With LazyDataView, it's required to set item index provider first with setItemIndexProvider(ItemIndexProvider). Otherwise getItemIndex will throw UnsupportedOperationException. Provider can be implemented to fetch correct item index using item and Query parameters. Query object is set up to fetch all items with sorting and filter.

  • Support DataProviderWrapper better in AbstractDataView
    Commit · Pull request · Issue

    Adds in AbstractDataView a better support for wrapper data providers that implements DataProviderWrapper. AbstractDataView won't throw exception anymore if wrapped data container is supported by the data view implementation. Adds public getWrappedDataProvider method in DataProviderWrapper.

  • Allow disable component tracker
    Commit · Pull request · Issue

    Adds a configuration parameter that allows developers to disable component tracking.

  • Write source information for React components defined in the project
    Commit · Pull request

    When transpiling tsx/jsx to ts/js, Babel writes the source information for where components are used. This adds the information about where components are defined.

  • SBOM generation
    Commit · Pull request

  • Add skipDefaultValidator API to Binder and BindingBuilder
    Commit · Pull request · Issue

    Provides means to skip default validators of bound fields. Skipping can be done either for the Binder instance (skips all), or per-binding via BindingBuilder.

  • Section and IFrame implements HasAriaLabel
    Commit · Pull request · Issue

    Implement HasAriaLabel for html elements with a landmark role.

  • Add method to write only the changed properties to the bean
    Commit · Pull request

  • Add methods for checking roles and authorities
    Commit · Pull request

  • Wrap the JS snippet in async function
    Commit · Pull request

  • Support top-level await
    Commit · Pull request

  • Update gradle plugin clean tasks
    [Commit](https://github.com/vaadin/flow/co...

Read more

Vaadin Flow 24.4.0.alpha32

26 Apr 10:54
Compare
Choose a tag to compare
Pre-release

Changes since 24.4.0.alpha31

All changes

New features

Fixes

  • Generate flow imports in the same folder
    Commit · Pull request

  • Fix URL rewrite for nested CSS
    Commit · Pull request · Issue

    In addition, CssBundler now tries to guess if a theme relative path that do not match a physical file might be a reference to a theme asset, and in this case it replaces the URL with one resolvable by StaticFileHandler. Refs #19094

  • Delete only unnecessary generated files
    Commit · Pull request

    Prevents built tool plugins to to delete all frontend genreated files as first step in the prepare-frontend task, moving the login in BuildFrontendUtil and changing it to only delete files that are no longer created by node tasks. Part of #18907

Vaadin Flow 23.3.30

26 Apr 06:38
1c25fcf
Compare
Choose a tag to compare

Changes since 23.3.29

All changes

Fixes

  • Prevent embedded styles to leak main document (#19242)
    Commit · Pull request · Issue

    When using an exported a themed Flow web-component, Lumo style may leak the embedding document, causing invalid CSS rules to be applied. This change prevents applying Lumo global imports when the theme is applied to a web-component.

  • Upgrade license-checker to 1.12.8 (#18739)
    Commit · Pull request

Vaadin Flow 24.4.0.alpha31

24 Apr 12:07
31e2cb5
Compare
Choose a tag to compare
Pre-release

Changes since 24.4.0.alpha30

All changes

New features

  • Add API for automatic main menu
    Commit · Pull request · Issue

    Adds API to get and control only accessible routes for automatically build routes based on Menu annotated routes. This change is targeting primarily client side menu build with Hilla. Adds RouteRegistry#getRegisteredAccessibleMenuRoutes to get a list of accessible RouteData objects. Method takes in a collection of access control objects which are implementing BeforeEnterListener. Supports NavigationAccessControl and ViewAccessChecker. Adds MenuAccessControl interface to control getRegisteredAccessibleMenuRoutes return value. This change adds first part of control by adding API to enable, disable or automate populating client side main menu with the server side routes. Interface has space for future for more advanced control. Default MenuAccessControl implementation can be customized by implementing it as a Spring bean, or by providing the implementation class via 'menu.access.control' property.

Fixes

  • Prevent embedded styles to leak main document
    Commit · Pull request · Issue

    When using an exported a themed Flow web-component, Lumo style may leak the embedding document, causing invalid CSS rules to be applied. This change prevents applying Lumo global imports when the theme is applied to a web-component.

  • Allow css properties in react components (#19077)
    Commit · Pull request · Issue

  • Only minify in production
    Commit · Pull request · Issue

    Only minify in production mode. For development and devBundle builds do not minify sources.

Vaadin Flow 24.3.9

23 Apr 10:12
a4e3b47
Compare
Choose a tag to compare

Changes since 24.3.8

All changes

Fixes

  • Set correct debug status blip color
    Commit · Pull request

  • Support OpenLiberty and Wildfly URL when listing translation files (#19167)
    Commit · Pull request · Issue

    OpenLiberty provides URL with a 'wsjar' protocol; Wildfly offers JBoss VFS URLs.

  • Show java livereload status with shared ws
    Commit · Pull request

  • Unwrap router target class in getRouteTarget (#19151)
    Commit · Pull request · Issue

    AbstractNavigationStateRenderer.getRouteTarget filters the active router targets chain comparing collection items class with the route target type. The filter may fail if routes instances are proxy objects created by frameworks like spring, since the class will not match the required one. This cahnge ensures that synthetic and proxy classes are discarded, allowing for more accurate comparison when filtering objects based on their real application class.

  • Upgrade vulnerable dependency (#19149)
    Commit · Pull request

  • I18n default translation from thread (#19136)
    Commit · Pull request · Issue

    when executing from thread.

  • Postpone creation of WebIconsRequestMatcher (#19102)
    Commit · Pull request · Issue

    During a hot reload, there may be requests incoming before VaadinService completes its intialization. In this situation a NPE is thrown when trying to create WebIconsRequestMatcher. This change postpones the instantiation until VaadinService is available.

  • Detect Flow PUSH requests as internal framework requests (#19085)
    Commit · Pull request · Issue

    HandlerHelper is currently not considering Flow PUSH requests (/VAADIN/push) as internal, preventing VaadinWebSecurity to ignore CSRF checks. The issues happen only for ping requests; the connection request is not affected because it is a GET request.

  • Do not deactivate expanded item keys (#19006) (#19047)
    Commit · Pull request

  • Reorder unhandled imports in CSS bundler (#19021)
    Commit · Pull request

    Currently, CssBundler just replaces @imports with inlined file contents and returns the result. That can be problematic if an unprocessed import, for example to an external URL, comes after an inlined import. Now the unprocessed import comes after a regular CSS rule, which is invalid and ignored by the browser.

  • Restore hasBeenAttached on resync (#19023) (#19068)
    Commit · Pull request · Issue

Vaadin Flow 24.4.0.alpha30

24 Apr 12:08
13408c8
Compare
Choose a tag to compare
Pre-release

Changes since 24.4.0.alpha29

All changes

Fixes

  • Use less strict regexp for export validation
    Commit · Pull request · Issue

  • Set correct debug status blip color
    Commit · Pull request

  • Correct sample in file
    Commit · Pull request · Issue

    Make the sample code return the correct type of RouteObject[] instead of only RouteObject

  • Support OpenLiberty and Wildfly URL when listing translation files
    Commit · Pull request · Issue

    OpenLiberty provides URL with a 'wsjar' protocol; Wildfly offers JBoss VFS URLs.

Vaadin Flow 24.4.0.alpha29

16 Apr 13:38
cb1045f
Compare
Choose a tag to compare
Pre-release

Changes since 24.4.0.alpha28

All changes

New features

  • Add Menu annotation
    Commit · Pull request · Issue

    Menu annotation has information like title, order and icon for automatically populated menu. Matches with ViewConfig menu API in Hilla.

Fixes

Vaadin Flow 24.4.0.alpha28

15 Apr 06:48
48cc8be
Compare
Choose a tag to compare
Pre-release

Changes since 24.4.0.alpha27

All changes

New features

  • Throttle page resize events
    Commit · Pull request

    Not built with complex JS hacks anymore, but with normal event listening system.

  • Allow receiving specified dom events for inert elements
    Commit · Pull request

    Closes #18940

Fixes

  • Handle exception from BrowserLiveReloadAccessor
    Commit · Pull request · Issue

    Updates PushHandler to catch and log debug message of IllegalStateException from BrowserLiveReloadAccessor when it's thrown from already closed Spring context.

  • Unwrap router target class in getRouteTarget
    Commit · Pull request · Issue

    AbstractNavigationStateRenderer.getRouteTarget filters the active router targets chain comparing collection items class with the route target type. The filter may fail if routes instances are proxy objects created by frameworks like spring, since the class will not match the required one. This cahnge ensures that synthetic and proxy classes are discarded, allowing for more accurate comparison when filtering objects based on their real application class.

  • Filter hilla and copilot packages better
    Commit · Pull request · Issue

    Filter "com/vaadin/hilla" and "com/vaadin/copilot" packages by default from the class scanner in VaadinServletContextInitializer and include only what is really needed: com.vaadin.copilot.startup and com.vaadin.hilla.startup. This speeds up mostly reload time and also startup time a bit.

  • Upgrade vulnerable dependency
    Commit · Pull request

  • I18n default translation from thread
    Commit · Pull request · Issue

    when executing from thread.

Vaadin Flow 24.4.0.alpha27

10 Apr 03:43
a07e2ad
Compare
Choose a tag to compare
Pre-release

Changes since 24.4.0.alpha26

All changes

New features

  • Use a new RouterBuilder API for routes.tsx
    Commit · Pull request · Issues 2238, 18988

    Removes the buildRoutes method and replaces it with a new RouterBuilder API that automatically injects server side routes where needed and adds the auth level.

Fixes

  • Postpone creation of WebIconsRequestMatcher
    Commit · Pull request · Issue

    During a hot reload, there may be requests incoming before VaadinService completes its intialization. In this situation a NPE is thrown when trying to create WebIconsRequestMatcher. This change postpones the instantiation until VaadinService is available.

  • Detect Flow PUSH requests as internal framework requests
    Commit · Pull request · Issue

    HandlerHelper is currently not considering Flow PUSH requests (/VAADIN/push) as internal, preventing VaadinWebSecurity to ignore CSRF checks. The issues happen only for ping requests; the connection request is not affected because it is a GET request.

  • Query in path
    Commit · Pull request

    parameters into the route breaking route resolution when navigating thrhough link. part of #19080

  • Normalize and replace line separator in node task lock file
    Commit · Pull request · Issue

    Normalizes and replaces line separators potentially present in the process command line before writing the lock file, so that it will contain only two lines. Same normalization is applied when getting the command line for the process identified by the pid in the lock file before comparing it with the value stored in the lock file.

  • Return empty list
    Commit · Pull request · Issue

    Return an empty list if no listeners for type exist.