Starting spring boot app with Vaadin Flow 14.0.0.rc9 is very slow

I just started a simple new application spring boot 2.3.3, vaadin 14.3.4, java OpenJDK 14, IntelliJ 2020.1.1, nothing more then a hello world label.
I tried to use vaadin.whitelisted-packages configuration property in application.properties
but the problem is always the same: starting time is unacceptable, about 1 minute for webpack to compile frontend resources.

anything to do to solve this problem? maybe a IntelliJ issue? otherwise i have to look for a vaadin alternative.

Hi Giuseppe

In development mode all vaadin components are always compiled. I can understand that with a slow machine the compilation can be slow, but at the moment the only help we can offer is to drop the paid components by changing the dependency from vaadin to vaadin-core or to manually add dependencies for each Vaadin component that is needed in the project. (The minimum dependencies being flow-server and flow-client)

  • Mikael

Hi Mikael, thanks for your help.
My machine is a MacBook pro 16 inch with 32GB RAM and a processor 2,3 GHz Intel Core i9 8 core, i do not think it is a slow one.
I found that executing maven goal vaadin:prepare-frontend and vaadin:build-frontend application startup is very fast.
The only problem is that vaadin:build-frontend takes about 6 minutes and it is necessary to run again every time i use a new ui component in my application

Hi Giuseppe.

Yes that not what one would count as a slow machine and it should perform the work in a timely manner.

For development you do not need to execute build-frontend which will make the execution faster as build-frontend will
go through the used components and optimize the bundle also it will do it on every startup as it is intended for a production mode build, but in dev mode everything is added to the bundle making it more straightforward, also it uses the dev server which won’t be used after running build-frontend.

My windows 10 machine with a i7-8750H CPU @ 2.20GHz, 2201 Mhz, 6 Core(s), 12 Logical Processor(s)
package a production build from a clean repository in around 1 minute and after initial node_modules have downloaded it goes down to <20 seconds.
The dev mode build seems to be around 30s without node_modules which then goes down to <8 seconds to server start.

  • Mikael

Hi Mikael,

how to use only vaadin-core if you use the vaadin-spring-boot-starter maven dependency?

You can just change in the pom for a starter project the dependency

        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin</artifactId>
        </dependency>

to be

        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-core</artifactId>
        </dependency>
  • Mikael

Mikael,

but I have the following in my pom.xml:

<properties>
	<java.version>1.8</java.version>
	<vaadin.version>14.3.6</vaadin.version>
</properties>
...
<dependency>
	<groupId>com.vaadin</groupId>
	<artifactId>vaadin-spring-boot-starter</artifactId>
</dependency>
...
<dependencyManagement>
	<dependencies>
		<dependency>
			<groupId>com.vaadin</groupId>
			<artifactId>vaadin-bom</artifactId>
			<version>${vaadin.version}</version>
			<type>pom</type>
			<scope>import</scope>
		</dependency>
	</dependencies>
</dependencyManagement>

Hi Marcus.

It would seem that the vaadin-spring-boot-starter only brings in the vaadin-core, vaadin-spring and spring-boot-starter-web dependencies so it’s already only with the core packages.

  • Mikael