github vaadin/flow 8.0.0
Vaadin Flow 8.0.0

latest releases: 24.4.0.beta1, 24.4.0.alpha32, 23.3.30...
2 years ago

Vaadin Flow 8.0.0

Vaadin Flow 8.0 is a major release of the Flow & Fusion frameworks targeted to Vaadin 21. To try it out, use the latest 21 release available from Maven central.

New Features in Flow 8.0

View-Based Access Control feature (Issues and PR's: #10609, #10705, #10863)

Since Flow 8, it is possible to use a built-in view-based access control mechanism to secure Flow navigation targets. The view-based access control mechanism uses the @AnonymousAllowed, @PermitAll, @RolesAllowed, and @DenyAll annotations on view classes to define the access control rules.

Preparations for Flow integration with Quarkus (Issues and PR's: #11241)

Quarkus is an increasingly popular Java Framework. Flow 8 includes preparations for using Vaadin as a UI framework in Quarkus applications. Despite Quarkus official support will be included in the next major version of Flow and Vaadin, you can try out the starter project.

Other features

  • Add target enums for Anchor (#8346). PR:8397

  • Use regular string enum instead of a const enum (#10853). PR:10860
    Given a Java enum as

    pubic enum Environment {
      DEV, TEST, PROD
    }

    Now it is possible to do any object action with the final Environment enum on the client-side:

    Object.keys(Environment).forEach(enumValue => console.log(enumValue));
  • Implement HasStyle in LitTemplate so you can add class names to the root element. PR:10903

    Makes it possible to use addClassName("hello") in the constructor. Class for the custom element cannot be added in the template.

  • Upgrade from es2017 to es2019. PR:10891. Ticket:10824

  • Bump lit-css-loader for Lit 2. PR:11062

  • Support non-nullability for collection items. PR:11290

  • Do not serialize VaadinSession by default in development. PR:11304. Ticket:11151

    Avoids writing VaadinSession to the HTTP session when the controlling properties are set (devmode + parameter). For implementation reasons, something must be serialized so only a boolean is written and these kind of "not actually serialized" sessions are removed when loading them after deserialization. This makes it unnecessary to login again to application when developing it with live reload tools and the authentication data is stored in the HttpSession.

  • Add Vaadin Nonnull annotation. PR:11341

    Adds a @Nonnull annotation that is applicable to not only fields/methods/parameters like javax.annotation.Nonnull but also to type parameters. It gives more control over the generated Typescript code. It is still possible to use any other annotation with the case-insensitive nonnull name.

  • Extract validation error handler from Binder (#11384). PR:11414

Breaking Changes in 8.0

  • use Lit 2.0.0-rc.1. PR:10023
    Use the new npm package lit (version 2.0.0-rc.1) instead of lit-html and lit-element. Update all imports and usage of Lit according to the upgrade guide https://lit.dev/docs/releases/upgrade/.

    As Lit 2 is a new major version, it is not 100% compatible. The biggest breaking changes are for people who create their own directives but there is one noteworthy change for template users: @internalProperty is now named @state.

    Fix the return type of CSS loader in types.d.ts from CSSResult to CSSResultGroup (this is what the new version of the css tagged template literal now returns). Existing projects will need to either delete types.d.ts so that it will be replaced with a new version on build (or alternatively manually update its contents) to get the correct type in TS files that import CSS files.

  • Generate nullable TS types for Java types by default. PR:10754. Ticket:8849

    Given a Java class as

    public class Contact {
          private String name = "";
          private Company company;
    }

the generated TypeScipt properties would be nullable by default, like

    export default interface Contact {
        company?: Company;
        name?: string;
    }

instead of non-nullable by default, as in previous versions

   export default interface Contact {
       company: Company;
       name: string;
   }
  • Extract DevModeHandler and BrowserLiveReload into a separate module. PR:10969. Ticket:10892

    Added module vaadin-dev-server containing dev server and live reload. The interfaces in flow-server (DevModeHandler, DevModeHandlerManger and BrowserLiveReloadAccessor) are implemented in this module. The module is optional: running without it in dev mode requires setting enableDevServer=false and building the frontend manually (vaadin:build-frontend mavne goal).

    This should not have any effect on Vaadin applications or add-ons, unless they for some reason are calling internal development mode related frontend build code in Flow. Many classes have moved to com.vaadin.flow.internal package from com.vaadin.flow.server. See the changeset for details.

  • Fusion package renaming. PR:11320

    Renamed the following Fusion packages in the fusion-endpoint module:
    1. com.vaadin.flow.server.connect -> com.vaadin.fusion
    2. com.vaadin.flow.server.frontend.fusion -> com.vaadin.fusion.frontend
    3. com.vaadin.flow.server.startup.fusion -> com.vaadin.fusion.startup

Known Issues

  • FrontendUtils fails to find pnpm if only the newer version is installed Issue
  • Endpoints stop working in Safari after first refresh Issue
    These two issues will be fixed in the following maintenance release.

Changes in Flow from 8.0.0.rc3

Don't miss a new flow release

NewReleases is sending notifications on new releases.