Class JavaScriptHotswapper

java.lang.Object
com.vaadin.base.devserver.hotswap.impl.JavaScriptHotswapper
All Implemented Interfaces:
VaadinHotswapper

public class JavaScriptHotswapper extends Object implements VaadinHotswapper
Reloads the page when a JavaScript value that is loaded at runtime is removed or changed on a component in use, and warns when a bundled JavaScript value changes.

A runtime JavaScript value is added to the page as a script element, and a script that has run cannot be removed from the page again. A refresh would only add the new script next to the previous one, so the affected UIs are reloaded instead. Adding a value does not need a reload, as the refresh adds the new script.

Bundled values are only collected into the bundle when the frontend is built, so changing them, or moving a value between bundled and runtime, needs a restart. That is logged rather than handled.

A component in use is also affected when the change is in one of its superclasses or in a class it refers to with Uses. The cached metadata of such a component still holds the previous values, so it is read as the previous values and then cleared. Components that are not in use keep their cached metadata.

Runtime values on the AppShellConfigurator are rendered into the initial page, so any change to them reloads all UIs.

For internal use only. May be renamed or removed in a future release.

Since:
25.4