Package com.vaadin.flow.server.frontend
Class TaskGenerateReactFiles
java.lang.Object
com.vaadin.flow.server.frontend.AbstractFileGeneratorFallibleCommand
com.vaadin.flow.server.frontend.TaskGenerateReactFiles
- All Implemented Interfaces:
FallibleCommand
Generate default files for react-router if missing from the frontend folder.
The generated files are Flow.tsx and routes.tsx.
Where Flow.tsx is for communication between the Flow and the
router and contains the server side route target
serverSideRoutes to be used in routes.tsx.
Flow.tsx is always written and thus updates automatically if
there are changes.
For internal use only. May be renamed or removed in a future release.
- Since:
- 3.0
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute()Runs the given command.protected StringgetFileContent(String fileName) static voidwriteLayouts(Options options, Collection<Class<?>> layoutsClasses) Writes the `layout.json` file in the frontend generated folder.Methods inherited from class com.vaadin.flow.server.frontend.AbstractFileGeneratorFallibleCommand
setGeneratedFileSupport, track, track, writeIfChanged, writeIfChanged
-
Field Details
-
CLASS_PACKAGE
- See Also:
-
NO_IMPORT
-
MISSING_ROUTES_EXPORT
-
-
Method Details
-
execute
Description copied from interface:FallibleCommandRuns the given command.If execution fails then the command may throw an exception which may give a message and a cause of the failure.
- Throws:
ExecutionFailedException- if there is an execution error
-
writeLayouts
Writes the `layout.json` file in the frontend generated folder.- Parameters:
options- the task optionslayoutsClasses-Layoutannotated classes.
-
getFileContent
- Throws:
IOException
-