vaadin / flow

Vaadin Flow is a Java framework binding Vaadin web components to Java. This is part of Vaadin 10+.
Apache License 2.0
623 stars 167 forks source link

hotswap no longer reliably hotswapping #20502

Open jorgheymans opened 1 week ago

jorgheymans commented 1 week ago

Description of the bug

Hotswap has been very reliable for more than a year. But recently, i noticed that recompiling a class sometimes does nothing. I get no hotswap output in the logs. Also, sometimes hotswap is happening, but for some reason the page no longer automatically reloads. Lastly, sometimes the page reloads but it hangs for a very long time.

These symptoms started appearing in the last month or so, initially i did not pay attention to them but it's now apparent that something has regressed somewhere. I would rollback to one of the 1.4.2-SNAPSHOTS but they are no longer available.

Expected behavior

hotswap should reliably hotswap classes

Minimal reproducible example

It's a matter of 'sometimes' in our project, which i cannot share.

Versions

hotswap 2.0.0, Vaadin 24.5.3, jdk 17

Artur- commented 1 week ago

Hotswap support in Vaadin 24.5 changed so it recreates the components instead of reloading the page. There is one known issue #20473

There has also been some problems in some releases of Jetbrains Runtine where memory leaks might stop it from hotswapping at some point and some issues in HotswapAgent 2.0.0 fixed in 2.0.1

If you manually handle these version and not use the new Vaadin IntelliJ plugin, you should start by checking you have the latest version of everything.

jorgheymans commented 1 week ago

ok, good to know thanks. Using jbr 17.0.12, i'll try updating the agent to 2.0.1.

If the components are recreated, should we still reload the page then or navigate to the same screen for the changes to take effect? Or, it pops in the new version in the ui automagically?

Artur- commented 1 week ago

It recreates the component tree so the effect should be the same as a refresh but without reloading all resources and with less waiting

jorgheymans commented 6 days ago

So, the hotswap agent part is ok i think, there is logging output that indicates the hotswap worked. But after that, the blue vaadin loading bar starts flashing for quite a long time, 30-40s

EDIT: it does this "sometimes".