This is a release candidate version of Flow 2.0 targeted for Vaadin 14.0.0.beta1.
Flow 2.0 feature highlights:
- The possibility to use Polymer 3, npm and JavaScript Modules instead of Polymer 2, Bower and HTML Imports. #4561
- 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
- Embedding Flow applications is now possible by exporting it as a web component. Flow 1.5 Added support for exporting as html-import, 2.0 adds support for exporting as JavaScript module
- 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 #3522 - It is possible to obtain details like screen width & height and time zone on the server side using
Page.retrieveExtendedClientDetails( ExtendedClientDetailsReceiver receiver)
#4665 - 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 and the updated starters will be available in https://vaadin.com **
Changes and additions since 2.0.0.beta2
:
- Generic Drag and Drop support for Flow #3978 has been moved to a separate artifact which will not be available in Vaadin 14.0, but can be added to any V14 project as an add-on. This is due to Firefox lacking DnD support inside Shadow DOM until Firefox 68 ships in July 2019 #5606. The feature will be later on included in to Vaadin 14 in a minor release once it works on all supported browsers. For now, you can use it by adding the following dependency to your V14 project:
<dependency> <groupId>com.vaadin</groupId> <artifactId>flow-dnd</artifactId> <version>2.0.0.rc1</version> </dependency>
- Embedding Vaadin applications now works in npm mode and can be embedded as JavaScript modules.
@PreserveOnRefresh
now preserves components added to theUI
while in an annotated view (such as dialogs and notifications).
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.