Class JsDefinitionHotswapper
- All Implemented Interfaces:
VaadinHotswapper
JsDefinition interface whose JavaScript the frontend bundle
does not carry.
The JavaScript a definition method declares with JsExpression is
collected into the bundle when the frontend is built. Redefining the
interface therefore does not change what the browser can run: a call made
after the change either runs the JavaScript the bundle was built with, or
finds no function at all when the redefinition renamed or added a method.
With the frontend dev server running, the file the functions are generated into is written again from what the interfaces now declare. The dev server replaces the module in every browser that has it, the file registers the new functions, and a call made afterwards runs them - no restart, and nothing is compiled from a string in the browser, since the dev server serves the file it just read. Without the dev server, a bundle is what the browser runs and only a build produces a new one, so the change is reported instead.
The comparison is against the generated file the bundle was built from, which is what the browser can run, and it uses the same rendering the build wrote, so the declared JavaScript of every method and the number of arguments it takes have to match for an interface to pass silently.
For internal use only. May be renamed or removed in a future release.
-
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.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
onClassesChange, onClassLoadEvent, onClassLoadEvent, onHotswapComplete, onInit, onResourcesChange
-
Constructor Details
-
JsDefinitionHotswapper
public JsDefinitionHotswapper()
-
-
Method Details
-
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:
-