Replies: 3 comments 2 replies
-
Yes, but ... This could be addressed by introducing a conventional interface e.g. |
Beta Was this translation helpful? Give feedback.
-
What I really liked about the idea is to have practical defaults in place where possible, and not having to implement the whole thing in case I wanted to customize something trivial. For instance, I expect to have a Consequently, let's assume that return (
<Crud {... PersonEndpoint}>
<Grid columns="name, family" />
</Crud>
); In the above snippet, the |
Beta Was this translation helpful? Give feedback.
-
I got the impression that a lot of people involved in our discussion imagined this feature to result in a single component that would contain both a grid and the form. I just want to point out that a CRUD feature could span over different routes, for example:
This has some advantages over a single component:
Disadvantages are:
|
Beta Was this translation helpful? Give feedback.
-
We have started investigating how Hilla could help when building different types of CRUD functionality. More specifically, we're focusing on the master-detail UI pattern where the user sees a list of items and can select any of them for editing in a separate form.
As a full-stack framework that touches both the UI and the backend, Hilla has some special opportunities that aren't available for a solution that focuses only on the UI or only the backend. Hilla can use metadata from backend types to provide a good starting point for rendering a UI and hooking it up with the backend. At the same time, we need to be very mindful of how to allow customizing any part without having to also re-implement the parts where the defaults are sufficient.
Simplest possible starting point
We assume that the developer wants to get started as quickly as possible by creating an RPC endpoint that reads entities straight from a Spring Data JPA repository into a Vaadin Grid component. The grid is automatically configured with a column for each of the properties in the JPA entity. Thanks to Spring Data, the grid can also be lazy-loaded and sortable without additional application code. There's also some (potentially AI-generated) sample data in that grid right away rather than only showing an empty grid.
Expressed in code, the endpoint could thus look like this:
Whereas usage from TypeScript would be like this with the help of a React hook:
When the developer also provides an RPC endpoint for saving a new or existing entity into the repository, then the UI could automatically also have a form with appropriate input fields for editing an existing entity selected in the grid and optionally also submitting a new entity to insert into the database. Just like with regular form binding in Hilla, the form would automatically have client-side validation based on bean validation rules defined in the Java entity class.
Hilla can automate all of this based on metadata from the Java types similarly to how the form binder already discovers rules for client-side validation.
Beyond the starting point
This very simple CRUD might already be enough for an admin view but there are many dimensions where expansion might be needed for CRUDs that are used in other parts of an application. The challenge with all of these options is to make sure each one is individually and incrementally customizable without having to give up the defaults in other areas.
These are the main customization directions that we have identified (in no particular order):
Specific questions to the community
Aside from these specific questions, we are of course also happy to hear any other thoughts that you have on the topic.
Beta Was this translation helpful? Give feedback.
All reactions