vantezzen / autoform

🌟 Automatically render forms for your existing data schema
https://autoform.vantezzen.io
2.95k stars 111 forks source link

Proposal to incorporate @form-instant/react-input-mapping into this project, continuation of #107 #124

Open leomerida15 opened 1 month ago

leomerida15 commented 1 month ago

This is a continuation of issues #107, I created this little thing that is already in npm and is adnostic to the UI library and allows custom props for each component.

vantezzen commented 1 month ago

I think conceptually this is very similar to the new @autoform libraries, right? Both systems map the zod types to rendering specific form elements - just with a bit of a different syntax.

leomerida15 commented 1 month ago

Hi @vantezzen I think I know how to transform the schema into an interpretable object, but by completely separating mapping and component glossary from the component library, it allows you to do several things in a much simpler way,

  1. adding custom components is much simpler because you only have to add it to the mapping object and it is global to all the forms without having to add a prop to each form component.
  2. it is simpler to separate the form into multiple blocks.
  3. if someone wants to create an additional library that includes component glossaries, it is simpler since you can edit all the parameters that each input accepts.
  4. by separating the mapping from the UI you also separate it from the form hook, you can use react-hook-form, @mantine/form or tanstack/form.
  5. the layout is simpler since you can distribute your form in a simpler way.

If this package seems like it to you, I hope you take it into account because I feel that this repository is becoming more complicated than it needs to be.