Package io.jmix.flowui.devserver
Class ViteHandler
java.lang.Object
io.jmix.flowui.devserver.AbstractDevServerRunner
io.jmix.flowui.devserver.ViteHandler
- All Implemented Interfaces:
com.vaadin.flow.internal.DevModeHandler
,com.vaadin.flow.server.RequestHandler
,Serializable
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
Modifier and TypeFieldDescriptionstatic final String
The local installation path of the server node script.Fields inherited from class io.jmix.flowui.devserver.AbstractDevServerRunner
DEV_SERVER_HOST
-
Constructor Summary
ConstructorDescriptionViteHandler
(com.vaadin.flow.di.Lookup lookup, int runningPort, File npmFolder, File studioFolder, 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 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.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) Methods inherited from class io.jmix.flowui.devserver.AbstractDevServerRunner
checkConnection, doStartDevServer, getApplicationConfiguration, getFailedOutput, getPort, getProjectRoot, getStudioRoot, getWatchDog, handleRequest, onDevServerCompilation, serveDevModeRequest, stop, triggerLiveReload, updateServerStartupEnvironment, validateFiles, waitForDevServer, writeStream
-
Field Details
-
VITE_SERVER
The local installation path of the server node script.- See Also:
-
-
Constructor Details
-
ViteHandler
public ViteHandler(com.vaadin.flow.di.Lookup lookup, int runningPort, File npmFolder, File studioFolder, CompletableFuture<Void> waitFor) 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:
getServerFailurePattern
in classAbstractDevServerRunner
-
getServerSuccessPattern
Description copied from class:AbstractDevServerRunner
Gets a pattern to match with the output to determine that the server has started successfully.- Specified by:
getServerSuccessPattern
in classAbstractDevServerRunner
-
prepareConnection
- Specified by:
prepareConnection
in interfacecom.vaadin.flow.internal.DevModeHandler
- Overrides:
prepareConnection
in classAbstractDevServerRunner
- Throws:
IOException
-
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
-