$ show vaadin/hilla
Vaadin Hilla (formerly Vaadin Fusion) is a full-stack framework that bridges Java Spring Boot backends with TypeScript/React frontends. Its core function is automatic, type-safe code generation: Java classes annotated with @Endpoint or @BrowserCallable are parsed into OpenAPI specifications, which are then used to generate TypeScript client stubs, form models (with validation constraints mapped from JSR-380 annotations), and reactive signal bindings. This eliminates the need for manual API contracts and provides end-to-end type safety between server and client. The framework also includes a file-based router, a CRUD layer (ListService, FormService) integrated with JPA repositories, and reactive full-stack signals for real-time data synchronization via WebSocket push. Architecturally, Hilla is a monorepo organized into Java backend packages (endpoint, engine-core, typescript-generator) and TypeScript frontend packages (generator-core, react-crud, react-form, file-router, react-signals). Build integration is provided through Maven and Gradle plugins that trigger code generation during the build lifecycle. The code generator follows a plugin-based pipeline where each plugin (backbone, model, signals, push, subtypes, transfertypes) processes the OpenAPI schema to produce specific TypeScript output. The frontend runtime includes a middleware-enhanced ConnectClient for HTTP calls, declarative authorization via @AnonymousAllowed/@RolesAllowed, and a full i18n system. Security is a first-class concern with CSRF protection, JWT support, and Spring Security integration demonstrated across multiple test applications. The system does not include data pipeline or research code; it is a production-ready application framework. Notable reusable artifacts include a clean validator pattern in lit-form, a generic CommandRunner interface for external process execution, tree-merging utilities in the file router, and the full-stack signal implementation that demonstrates a command-based reactive state pattern. The codebase is actively maintained with extensive integration tests, though some areas (snapshot tests, dual Lit/React support, Atmosphere push dependency) introduce maintenance complexity and potential drift risks.
The LLM identified 4 files worth highlighting for reuse:
Provides a hierarchy of client-side validators (Required, Size, Min, Max, Email, Pattern, Past, Future, etc.) that directly mirror Java Bean Validation annotations. Each validator implements a common interface with name, message, impliesRequired, and validate(value) methods, supporting custom error messages and client-only constraints. This pattern is self-contained and can be extracted into any TypeScript project for form validation.
A clean interface for executing external commands with fallback executable resolution. Implementations handle Maven and Gradle invocation, environment detection (Windows cmd.exe, JAVA_HOME inference), and graceful error handling. This component is decoupled from the framework and can be reused in any Java project requiring external tool execution with cross-platform fallback logic.
Implements a recursive tree-merging algorithm that combines server-side and client-side route definitions into a unified React Router configuration. It supports wildcard overrides, layout nesting, and index route detection. The algorithm is independent of the routing library and can be reused for any hierarchical configuration merging (e.g., menu trees, permission sets) with similar override semantics.
Base class for bidirectional reactive signals that synchronize state between server and client. Uses a command-based architecture (SetCommand, IncrementCommand, InsertCommand) for atomic updates and dependency tracking for efficient subscription management. The implementation encapsulates WebSocket communication, pending/error states, and reconnection logic in a self-contained module that can be extracted for real-time data synchronization in other frameworks.