Pydantic Forms v2 #712
pboers1988
started this conversation in
Ideas
Replies: 1 comment
-
Discussed this last wednesday:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Background
Pydantic forms is a form library that facilitates a backend, which is responsible for defining the form fields and validating the submitted information + a frontend that is able to render a collection of form fields. It was an integral component of the WFO, but when SURF began developing CIM, the backend elements were extracted into a separate repository. This separate project, named Pydantic Forms, was subsequently released as a PyPi package.
The frontend relies on JSON scheme and the Uniforms library to render the form fields. In the SURF Orchestrator V1 GUI there was a lot of (SURF)specific JS to handle fetching data, interacting with the App Context and to implement some complex fields like the port selectors. This makes it very hard to extract the functionality into a NPMJS package that can be used in other React applications as the ways of fetching data and handling state are too opinionated.
SURF Features
Before we implemented the dynamic forms we already had forms that we had to keep in sync between backend and frontend; which had a mix of validation problems and strategies. Most of the current features “evolved” from our use cases.
Community Features
There are at least 2 places where the forms are used in other web-applications. As the SURF frontend relies on uniforms with some hooks and uniforms doesn’t have any real progress in the newer version (mostly due to commercial plans), within one of the other projects a decision was made to rewrite the form on the client side removing the uniforms dependency in favor of React Hooks Form and ZOD. This form implementation was shared with SURF and could be the basis of the new Forms functionality in the V2 GUI of the orchestrator.
Goals
Challenges
Beta Was this translation helpful? Give feedback.
All reactions