Blog

Enabling Live Reload in Vaadin 14.3

By  
Johannes Häyry
Johannes Häyry
·
On Jul 8, 2020 5:31:07 PM
·
In Product

 

Live reload

Vaadin 14.3 ships with a new Live Reload feature that lets you see your UI changes in the browser without a manual refresh. It is automatically enabled in development mode and does not require any browser plugins. Read on to get started with Live Reload with JRebel, HotswapAgent, or Spring Boot dev tools.

What is Live Reload?

Live Reload is a small JavaScript code in the browser that communicates with the development-mode app server and implements reloading of the browser UI. In Vaadin 14.3, it’s packaged in the development mode and works without any plugins. There is also a new floating infobox on the UI to indicate that Live Reload is enabled.

 

How to enable Live Reload

Live Reload handles the browser window refresh, but you still need something to reload Java code changes. We have documented installation steps for three alternatives that take care of this: JRebel, HotswapAgent and Spring Boot DevTools.

Live Reload with JRebel

JRebel is a commercial plugin for the Java virtual machine for instantly reloading code changes. If you are a JRebel user, follow the installation instructions in our documentation. There is a free trial available for the plugin at jrebel.com. JRebel is not a specific JVM implementation and works with all Vaadin applications, regardless of whether you use Spring, CDI or plain Java servlet.

Live Reload with HotswapAgent

HotswapAgent is a plugin system to allow frameworks to implement special reloading mechanisms after class redefinition. The latest version of HotswapAgent ships with a plugin for Vaadin 14. HotswapAgent works with DCEVM (a special JVM with an enhanced version of HotSwap). Follow the instructions in our documentation to set up Trava OpenJDK and Live Reload.

Live Reload with Spring Boot DevTools

Spring Boot DevTools monitor classpath resources and automatically restart your application whenever you make a change. Although the restart is not as fast as a hot reload, it’s still typically faster than a “cold restart”. Read more about Spring Boot DevTools and follow the instructions in our documentation to setup Live Reload.

The new Live Reload feature (that requires no browser plugin) is available in Vaadin 14.3 and will also be available in September in Vaadin 17. See what else is new in Vaadin 14.3 on the release page.

Get started with Vaadin 14.3.
Johannes Häyry
Johannes Häyry
I'm a developer disguised as a product marketer. I usually write about new Vaadin releases or the upcoming cool features on the roadmap.
Other posts by Johannes Häyry