form-js icon indicating copy to clipboard operation
form-js copied to clipboard

Investigate on architeture refactor of `form-js` viewer

Open vsgoulart opened this issue 1 year ago • 0 comments

What should we do?

Currently the form rendering layer is very coupled with the form mutation layer (FormFieldRegistry, PathRegistry) and this brings problems with reactivity/difficulty to maintain complex structures like groups and dynamic lists.

To try to solve that we should investigate on the possibility of refactoring and splitting the viewer into 3 different layers:

  1. Core viewer, which would handle the mutation of the schema and provide fine grained subscription to these mutations
  2. Preact/React compat library which provides primitives to trigger Preact rerenders when the form mutates
  3. The component library with all the form elements we have today which would contain only each component's logic

This way we would also provide ways for other people to support libraries in vue, svelte, solid, etc while we would support only Preact.

Why should we do it?

vsgoulart avatar Feb 15 '24 14:02 vsgoulart