Class JavaScriptHotswapper
- All Implemented Interfaces:
VaadinHotswapper
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
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidonClassesChange(HotswapClassEvent event) Called by Vaadin hotswap entry point when one or more application classes have been updated.voidCalled by Vaadin hotswap entry point when one or more application classes have been updated.voidCalled by Vaadin hotswap entry point after all hotswap related operations have been completed.voidonInit(VaadinService vaadinService) Called during the initialization of the VaadinHotswapper.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.base.devserver.hotswap.VaadinHotswapper
onClassLoadEvent, onClassLoadEvent, onResourcesChange
-
Constructor Details
-
JavaScriptHotswapper
public JavaScriptHotswapper()Creates the hotswapper. It is found through the service loader.
-
-
Method Details
-
onInit
Description copied from interface:VaadinHotswapperCalled during the initialization of the VaadinHotswapper. This method provides an entry point for executing logic that needs to occur when the associated VaadinService is initialized and before any hotswap events are triggered.- Specified by:
onInitin interfaceVaadinHotswapper- Parameters:
vaadinService- the activeVaadinServiceinstance being initialized
-
onClassesChange
Description copied from interface:VaadinHotswapperCalled by Vaadin hotswap entry point when one or more application classes have been updated.This method is meant to perform application-wide updates. Operation targeting Vaadin session should be implemented in
VaadinHotswapper.onClassesChange(HotswapClassSessionEvent)method.Currently, the default implementation delegates to the deprecated
VaadinHotswapper.onClassLoadEvent(VaadinService, Set, boolean)method for backward compatibility.- Specified by:
onClassesChangein interfaceVaadinHotswapper- Parameters:
event- the event instance carrying the information about the changed classes.- See Also:
-
onClassesChange
Description copied from interface:VaadinHotswapperCalled by Vaadin hotswap entry point when one or more application classes have been updated.This method is meant to perform updates at
VaadinSessionlevel. Operation targeting the entire application should be implemented inVaadinHotswapper.onClassesChange(HotswapClassEvent)method.Currently, the default implementation delegates to the deprecated
VaadinHotswapper.onClassLoadEvent(VaadinSession, Set, boolean)method for backward compatibility.- Specified by:
onClassesChangein interfaceVaadinHotswapper- Parameters:
event- the event instance carrying the information about the changed classes.- See Also:
-
onHotswapComplete
Description copied from interface:VaadinHotswapperCalled by Vaadin hotswap entry point after all hotswap related operations have been completed.- Specified by:
onHotswapCompletein interfaceVaadinHotswapper- Parameters:
event- an event containing information about the hotswap operation.
-