com.vaadin.base.devserver.
Class ViteHandler
All Implemented Interfaces:
Handles communication with a Vite server.
This class is meant to be used during developing time.
For internal use only. May be renamed or removed in a future release.
See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The local installation path of the server node script.
Fields inherited from class com.vaadin.base.devserver.AbstractDevServerRunner
DEV_SERVER_HOST
-
Constructor Summary
ConstructorsConstructorDescriptionViteHandler
(Lookup lookup, int runningPort, File npmFolder, CompletableFuture<Void> waitFor) Creates and starts the dev mode handler if none has been started yet.
-
Method Summary
Modifier and TypeMethodDescriptionGets the url path to the /VAADIN folder.
Gets the url path to the /VAADIN folder inside the context root.
protected File
Gets the binary that starts the dev server.
protected File
Gets the main configuration file for the dev server.
protected Pattern
Gets a pattern to match with the output to determine that the server has failed to start.
protected String
Gets the name of the dev server for outputting to the user and statistics.
protected Pattern
Gets a pattern to match with the output to determine that the server has been restarted.
protected Pattern
Gets a pattern to match with the output to determine that the server is restarting.
getServerStartupCommand
(FrontendTools frontendTools) Gets the commands to run to start the dev server.
protected Pattern
Gets a pattern to match with the output to determine that the server has started successfully.
prepareConnection
(String path, String method) Prepare a HTTP connection against the dev server.
Methods inherited from class com.vaadin.base.devserver.AbstractDevServerRunner
checkConnection, doStartDevServer, getApplicationConfiguration, getFailedOutput, getPort, getProjectRoot, getWatchDog, handleRequest, onDevServerCompilation, serveDevModeRequest, stop, updateServerStartupEnvironment, validateFiles, waitForDevServer, writeStream
-
Field Details
-
VITE_SERVER
The local installation path of the server node script.
See Also:
-
-
Constructor Details
-
ViteHandler
Creates and starts the dev mode handler if none has been started yet.
Parameters:
lookup
- the provided lookup to get required datarunningPort
- a port on which Vite is already running or 0 to start a new processnpmFolder
- folder with npm configuration fileswaitFor
- a completable future whose execution result needs to be available to start the dev server
-
-
Method Details
-
getServerStartupCommand
Description copied from class:
AbstractDevServerRunner
Gets the commands to run to start the dev server.
Specified by:
getServerStartupCommand
in classAbstractDevServerRunner
Parameters:
frontendTools
- the frontend tools object -
getServerName
Description copied from class:
AbstractDevServerRunner
Gets the name of the dev server for outputting to the user and statistics.
Specified by:
getServerName
in classAbstractDevServerRunner
-
getServerBinary
Description copied from class:
AbstractDevServerRunner
Gets the binary that starts the dev server.
Specified by:
getServerBinary
in classAbstractDevServerRunner
-
getServerConfig
Description copied from class:
AbstractDevServerRunner
Gets the main configuration file for the dev server.
Specified by:
getServerConfig
in classAbstractDevServerRunner
-
getServerFailurePattern
Description copied from class:
AbstractDevServerRunner
Gets a pattern to match with the output to determine that the server has failed to start.
Specified by:
-
getServerSuccessPattern
Description copied from class:
AbstractDevServerRunner
Gets a pattern to match with the output to determine that the server has started successfully.
Specified by:
-
getServerRestartingPattern
Description copied from class:
AbstractDevServerRunner
Gets a pattern to match with the output to determine that the server is restarting. Defaults to null, meaning that server restart is not monitored. Server restart is monitored only if both this method and
AbstractDevServerRunner.getServerRestartedPattern()
provides a pattern.Overrides:
-
getServerRestartedPattern
Description copied from class:
AbstractDevServerRunner
Gets a pattern to match with the output to determine that the server has been restarted. Defaults to null, meaning that server restart is not monitored. Server restart is monitored only if both this method and
AbstractDevServerRunner.getServerRestartingPattern()
provides a pattern.Overrides:
-
prepareConnection
Description copied from interface:
DevModeHandler
Prepare a HTTP connection against the dev server.
Specified by:
prepareConnection
in interfaceDevModeHandler
Overrides:
prepareConnection
in classAbstractDevServerRunner
Parameters:
path
- the file to request, needs to be safemethod
- the http method to useReturns:
the connection
Throws:
IOException
- on connection error -
getPathToVaadin
Gets the url path to the /VAADIN folder.
Returns:
the url path to the /VAADIN folder, relative to the host root
-
getPathToVaadinInContext
Gets the url path to the /VAADIN folder inside the context root.
Returns:
the url path to the /VAADIN folder, relative to the context root
-