local dev

Hi everyone, how’s your local dev flow like?

What’s the quickest way to generate the typescript from the backend specs ?

I feel like I always need to do ‘mvn’ to build the typescript generared files and this always take like 3 to 5 minutes and it doesn’t feel really good! I suppose there’s a better way, but couldn’t find anything.

In general it should be enough to recompile classes / rebuild the project in your IDE. There’s usually a keyboard shortcut for that. It should also be possible to configure your IDE to recompile on save.

You actually do not need to run mvn and wait for the application to fully load if you just want to trigger the generation of Typescript files for the Java endpoints and related classes. The following should be enough for TS generation:

mvn clean compile vaadin:generate

and if you are using Hilla 2.x then:

mvn clean compile hilla:generate

SpringBoot applications can be slow during startup (due to startup tasks, DB initializations, etc.), and while your application is running in dev mode, relying on SpringBoot DevTools’s hot-reload is not very pleasant, since changing some endpoint’s related Java classes, causes a restart and while it is called a hot-restart, it is not giving you a fast development cycle. Consider using either JRebel (commercial) or HotSwapAgent (Free) for class reloading without restarts.