Skip to content

Vaadin Flow 2.0.0

Compare
Choose a tag to compare
@denis-anisimov denis-anisimov released this 20 Jun 10:31

This is a final version of Flow 2.0 targeted for Vaadin 14.0.0.

NOTE: if you are using any pre-release version of Flow 2.0 / Vaadin 14 in your project, remove the following file when updating to 2.0.0 / 14.0.0.rc1:

  • webpack-config.js

Optionally, if you still have issues, try removing:

  • package.json & package-lock.json & node_modules

Changes and additions since 2.0.0.rc3:

  • Migration instructions and differences to previous version can be found here
  • Make "dev mode" work properly being deployed as WAR (#5876, #5822)
  • Report additional browser details to server (#5900, #4864)
  • Report missing browser sizing details #5717
  • Delay calling property change listeners for exported web components until the initial values are known #5794
  • Avoid flat structure after parsing template #5920, #5916
  • NPM mode configuration from one module affects other modules #5805
  • @javascript with URLs does not work #5770
  • Unable to build Bower mode project using the supported Node version #5892
  • webpack.config.js is not updated #5790
  • ExtendedClientDetails#isTouchDevice always returns false #5747
  • NPM: If Lumo theme is the default theme then its styles are not applied. #5812

Known limitations in 2.0.0

  • In Eclipse IDE, "Run as -> Run on Server" is not working on npm mode (with eg. Tomcat) #5927
    • To workaround, for now you need to do mvn package first
  • In IntelliJ IDEA, running a Spring Boot project with "Run" from IDE is not working on npm mode #5931
    • Same for starting the app from Spring Boot main method
    • For now you need to use mvn package spring-boot:run
  • In npm mode, Spring Boot devtools reloading is broken after a while #5940

Flow 2.0 feature highlights:

npm & JavaScript Modules support

  • requires that node.js is installed either globally on system or locally for project
  • replaces webjars/Bower and HTML Imports, updates Polymer version 2 -> 3
  • For demo, see starters like https://github.com/vaadin/beverage-starter-flow
  • Existing V10-V13 (Flow 1.x) will work as is on 14 (Flow 2.0), but can opt-in to migrate from bower&p2&html-imports to npm&p3&es6modulese later on using the migration tool (#5037)
  • Migration instructions and differences to previous version can be found here

Embedding Flow Components

  • You can now Embed a Flow component to any* web page by exporting it as a web component.
    • *some limitations apply for using web components from multiple sources and doing cross origin embedding, see documentation
  • Documentation

@PreserveOnRefresh

  • Adding @PreserveOnRefresh on a router layout or route will preserve the user edited component state when the user refreshes the page by reusing the component instances
  • Documentation

Small improvements

  • It is possible to obtain details like screen width & height and time zone on the server side using Page.retrieveExtendedClientDetails( ExtendedClientDetailsReceiver receiver)
  • When executing JavaScript from the server side Java, it is possible to get the return value of the execution to the server side using Page.executeJs(String expression, Serializable... parameters) #5285

**The documentation for Flow 2.0 is available on vaadin.com/docs and the updated starters are available on vaadin.com/start **

See the complete list of changes since the previous version

Using Flow 2.0

New Flow 2.0 projects require that in addition to Java 8 and Maven you have node.js + npm installed. It can be installed either globally on your system or locally on the project, follow the instructions. Existing Flow 1.x projects updating to 2.0 will not need to install node, but can keep on running on bowerMode.

Easiest way to obtain Flow 2.0 is by using some of the Vaadin 14 starters, available soon from https://vaadin.com/start. Flow 2.0 will be included in the vaadin or vaadin-core Maven dependencies starting from version 14, available from the Vaadin prereleases repository.