classmodel / class-web

Web version of CLASS
https://classmodel.github.io/class-web
GNU General Public License v3.0
0 stars 0 forks source link

Extend and improve form functionality #1

Open Peter9192 opened 1 month ago

Peter9192 commented 1 month ago

I made a very simple form renderer, but it still needs work.

I found and tried some form generators for vanilla js, but so far without success:

Currently I was trying to prototype something simple and see how far I get with vanilla JS. However, if this is much easier in react (e.g. with jsonforms or rjsf), we should probably switch at some point, and not invest too much in perfecting this prototype.

Peter9192 commented 1 month ago

@sverhoeven would you like to have a look at this? Feel free to touch other parts of the web app as well in the process. In the meantime I can work on the class package.

sverhoeven commented 1 month ago

The issues you listed are things that UI frameworks (vue,react,solidjs) and formlibraries (rjsf, react hook form, tanstack form) solve.

About point 5

We don't want a dynamic server, but a static web server. So we build a single page application where all interactive html is generated by Javascript in the web browser.
I can imagine a generate step (pnpm generate-form) that generates form js (with html strings embedded) files from a json schema. Those files can be used later, which has the pro of being type-safe and the con of customizations are lost after re-generate.