-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a system property -Dvaadin.hotswap.fullPageReload=true #20844
Comments
A workaround for this should be to add a custom |
class CustomVaadinHotswapper : VaadinHotswapper {
companion object {
var fullPageReload = true
}
override fun onClassLoadEvent(vaadinService: VaadinService, classes: Set<Class<*>>, redefined: Boolean): Boolean {
return if (fullPageReload) true else super.onClassLoadEvent(vaadinService, classes, redefined)
}
} if (!VaadinService.getCurrent().deploymentConfiguration.isProductionMode) {
extraInfoBottomLeft.add(Checkbox(CustomVaadinHotswapper.fullPageReload) { CustomVaadinHotswapper.fullPageReload = it.value }.style("--vaadin-checkbox-size: 0.7rem"))
} This seems to work! Can turn on/off full page reload at runtime Hope this will be added by Vaadin, with the toggle on the Vaadin Copilot button i browser |
A minor drawback of this approach is that the page will be reloaded even if the class change does not affect the UI directly. |
Found that returning public class CustomVaadinHotswapper implements VaadinHotswapper {
public static boolean fullPageReload = true;
@Override
public boolean onClassLoadEvent(VaadinService vaadinService, Set<Class<?>> classes, boolean redefined) {
return fullPageReload ? redefined : VaadinHotswapper.super.onClassLoadEvent(vaadinService, classes, redefined);
}
} |
Describe your motivation
When using HotSwapAgent 2.0.1 the new page merge/update has led to multiple problems/bugs. It is fine for some tasks when changing margins, padding, color, etc - and for Vaadin Copilot.
HotSwapAgent 1.4.2 will do a full refresh. It is always working, and every part of the page is run. It is safe and acts like a real situation when a user loads the page. The page reload also "flash" the page, make me sure it is fresh loaded. I use to add helpers, so I don't need to click on every reload. They will not always work in the new mode. E.g.
element.executeJs("setTimeout(()=>{$0.click()},100)", btn.element)
hotswap.fullPageReload default to false
Today I have a duplicate of my SDK, one with HotSwapAgent 2.0.1, the other with HotSwapAgent 1.4.2. Not sure if 1.4.2 will work on newer JDK.
Describe the solution you'd like
With a system property
-Dvaadin.hotswap.fullPageReload=true
it's easy to switch modeAlso doing the switch in Vaadin Copilot in runtime would be nice, but not necessary
The text was updated successfully, but these errors were encountered: