taniarascia / comments

Comments
7 stars 0 forks source link

schema-based-form-system/ #120

Open utterances-bot opened 2 years ago

utterances-bot commented 2 years ago

Creating a Schema-Based Form System | Tania Rascia

View the Source or Demo for the schema-based form system described in this article. Working with forms on the front end is tedious and…

https://www.taniarascia.com/schema-based-form-system/

hseritt commented 2 years ago

I find it interesting that Django has handled this sort of thing for years but support for it among JS frameworks and libraries is spotty at best. I applaud you for coming up with a schema to handle it. I did something like this with PHP a LONG time ago and to be honest, it was tedious to implement and maintain.

olivierdelomez commented 2 years ago

Very nice write up, I came across https://jsonforms.io/docs a few days ago and it seems to be perfect for schema based forms with React & al !

chakrihacker commented 2 years ago

One small optimisation you can do is use components as object instead of array, avoiding loop for every new field

taniarascia commented 2 years ago

I specifically used an array instead of an object because that makes it more difficult to add more things into the schema that might not necessarily be directly correlated with a single value.

4braincells commented 2 years ago

I am investigating how to migrate thymeleaf+lots of jquery/js and manual validations and dynamic form modifications (Promises+ajax) (2.5K LOC only JS, 10K LOC java (Spring boot) to a new frontend platform (VUE3) plus something magical (which you might have inspired now), as all of us know, UI costs 60% of all development efforts. And reducing the form generation and validation to a "generator", is a great approach and we will look at it if the magic works :-) But it might be not too easy, cause we are using quite organized and dynamic forms with Bootstrap cards, Datatables, which are highly configurable.

AdePhil commented 2 years ago

Does this take into account the layout of the form inputs on the page?