TexteaInc/funix

Type incorrect implementation

Closed this issue · 5 comments

For now, the response of types to the frontend is based on string. However, this will cause serious problems.

  1. We need to implement N-to-N parsers for both sides. For now, we only have the javascript and python sides. Supporting basic type has caused many bugs on both sides. WHAT IF we have more than two languages support?

  2. type checks based on string matches will become shit codes. For example:

https://github.com/TexteaInc/PyDataFront/blob/abaf7ee6929bee265391748fd63ee7577e10c028/backend/pydatafront/decorator/__init__.py#L41-L67

The regex is human unreadble code. For now, we have only str, int, and list, but the code already become unreadable.

  1. Making a wheel will cost extra time on defining the proposals

Our type checking should be based on JSON schema, one of the famous and stable formats for describing data structure.

https://json-schema.org/

And you can just write one code to build your own data form, https://react-jsonschema-form.readthedocs.io/en/latest/

@himself65 Please revise the issue below. What changes do you suggest us to make ?

I think we should study how Google App Script does this.

TURX commented

I think this is almost solved with rjsf in dev branch