hilla icon indicating copy to clipboard operation
hilla copied to clipboard

[FS router] New Flow views are not detected after a Spring Boot DevTools redeploy

Open Legioth opened this issue 1 year ago • 2 comments

Describe the bug

You need to restart the server for new Flow views to show up. New views don't appear after a redeploy managed by Spring Boot DevTools.

This is probably related to the way it reuses bean instances from external jar files to speed up redeploys. This in turn means that anything that ends up cached in an instance field or such in any Hilla bean will not be updated when redeploying. If this is the case, then we could probably listen to some suitable event to detect when instance fields values should be re-initialized.

Expected-behavior

No response

Reproduction

Can be reproduced with https://github.com/Lodin/hilla-file-router-example by adding a Flow route and then toggling whether the @Route annotation is commented out or not. Note that there's another issue in Flow that causes issues when adding new Java files so you need to restart the server anyways when adding the file. This means that to test it, you need to just toggle whether an existing file is a route or not.

System Info

Tip of the feat/file/menu branch

Legioth avatar Feb 23 '24 09:02 Legioth

The issue might actually be on the Flow side since it seems like the route registry is empty after the redeploy. The problem isn't only that view missing from the menu but rather that I cannot even navigate to the view if I have a hardcoded menu entry. I couldn't reproduce the exact same thing in a plain Flow application but I did notice an issue where different files behave in different ways so this might just be yet another variation of that issue. https://github.com/vaadin/flow/issues/18794

Legioth avatar Feb 23 '24 11:02 Legioth

Now that #18794 is fixed, does this still reproduce?

platosha avatar Mar 05 '24 12:03 platosha