Class JsDefinitionHotswapper

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

public class JsDefinitionHotswapper extends Object implements VaadinHotswapper
Reports a 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.

Since:
25.4