/ Vaadin Flow Framework

Gradle Vaadin Flow plugin M4 released

This release focuses on improving production mode as well as client side dependency handling. It improves caching as well as adds support for Web templates.

Here is a more detailed overview of what improvements and features the new release contains:

Improved Yarn/Bower integration

The plugin client side handling has now been re-written to be fully built on top of Yarn instead of NPM.

This has allowed the plugin to take into use Yarn's caching and repository offline mirroring capabilities providing more stable, reproducable and faster builds.

Gradle Cache support

The plugin now supports the Gradle cache. The cache is leveraged when in production mode to store the component directories (bower_components and node_modules) as well as the transpiled results and other static resources. This should speed up the builds considerable and allowes pre-building production mode applications.

To enable the Gradle cache add --build-cache when running Gradle from the command line or put org.gradle.caching=true in your gradle.properties file.

Support for HTML/Javascript bundling

Previously the HTML and Javascript were not bundled when generating the transpiled production mode. That made the application make several HTTP requests for every component used. This again was causing the application startup to be slow.

Now Polymer Bundler is used, compressing all component javascript into one downloadable HTML file that can be cached by the browser.

Support for Web Templates

One new feature of Vaadin 10 is building components using pure HTML templates (Polymer Templates).

To create a Web Template the following task can be used:

gradle vaadinCreateWebTemplate --name MyWebTemplate

This will create two files; a Java class MyWebTemplate.java that contains the server side logic of the component and a MyWebTemplate.html in src/main/webapp/templates/ which contains the client side logic (HTML+JS).

The templates work as an alternative way of creating simple Vaadin components. For more advanced components separating between view and representation is highly suggested.

For more information about the templates see https://vaadin.com/docs/v10/flow/polymer-templates/tutorial-template-basic.html

Improved Maven BOM support

The plugin's BOM support is now taking advantage of the latest Gradle BOM features. That means that if you want to use the Vaadin BOM you will now need to add a settings.gradle file to your project with the following contents:

enableFeaturePreview('IMPROVED_POM_SUPPORT')

--

As usual the release is available to download from the Gradle Plugin Directory.

For more information about how to use the plugin see https://github.com/devsoap/gradle-vaadin-flow/wiki

If you find any issues do not hesitate to create an issue at https://github.com/devsoap/gradle-vaadin-flow/issues