-
Notifications
You must be signed in to change notification settings - Fork 0
TechnicalOverview
An overview of the adjustments and hacks applied to Hilla in order to run on Quarkus.
Hilla is based primarily on Spring and is using some Spring classes and utilities.
These are mostly not abstracted and thus it is required to replace or remove this calls directly at bytecode level.
The following gives an overview of the applied hacks.
-
created a shaded jar to contain the minimum possible set of Spring classes that allows to compile a module with Hilla components
-
ApplicationContext and directly referenced interfaces, classes and exceptions
-
subset of spring-web classes to be able to wrap the EndpointController instead of copy/paste its logics
-
to support the Auto-Grid feature, a subset of spring-data-common is required
-
-
create a jandex index for Hilla
-
partial implementation of a custom ApplicationContext, required by EndpointInvoker and EndpointController
-
custom ViewAccessChecker integrated with Quarkus security
-
custom Atmosphere InjectableObjectFactory to inject required beans in PushEndpoint
-
custom security policy and form authentication mechanism
-
bytecode manipulations to remove/replace calls to Spring classes
-
replacement of @Autowired annotation
-
support for package level @NonNullApi
-
added own @NonNullApi annotation
-
added new AnnotationMatcher for it to NonnullPluginConfig.Processor on bytecode
-
-
-
removed the
DevToolsMessageHandler
service loader descriptor from 'hilla-dev-mode' artifact, because ofDevToolsDatabase
plugin Spring coupling.
Modified Method | Called Method | Replaced / Dropped |
---|---|---|
dev.hilla.EndpointRegistry
dev.hilla.EndpointInvoker
|
org.springframework.util.ClassUtils
|
Replaced |
dev.hilla.EndpointInvoker
|
org.springframework.util.ClassUtils
|
Replaced |
dev.hilla.push.PushMessageHandler
|
dev.hilla.AuthenticationUtil
|
Replaced |
dev.hilla.push.PushEndpoint
|
org.springframework.security.core.context.SecurityContextHolder
|
Dropped |
These refactorings can be done by the Hilla team to ease the development and improve the overall adaptability of Hilla.
-
Replacement of field injection with constructor injection
-
Remove direct usage of ApplicationContext in Hilla components, providing instead the required beans or collections of beans
-
Refactor and avoid shortcuts to Spring API such as
ApplicationContextProvider.getApplicationContext()
-
Hilla OOB Jandex index
-
Hilla 2.3 Auto Grid: introduce Pageable abstraction to be used in ListService instead of using Spring org.springframework.data.domain.Pageable
-
Introduce and abstraction for spring ResponseEntity to be used in EndpointController. This should allow reusing the Hilla controller in any servlet-based framework, by wrapping it.
-
Another breaking refactoring, could be creating abstraction for request/response as in Vaadin so that the controller could be used even with not servlet toolkits (e.g. Vert.x, Micronaut, …)