I really like the architecture of JSON Forms. The way it does the UI schema is great! I have some experience working on a similar project that has since been stopped because we ran into several problems. From a design perspective I think JSON Forms addresses the issues in defining the form. In the long term it would be very helpful to have a visual form builder so that less-technical people would design a form without coding. That can wait though!
The main issue I have concerns about is being able to use this for a site that needs to work on low-end phones with lower-speed connections. The seed application is 1.3 megabytes, which takes a long time to download and parse. Even the gzip size is over 300KB, and it’s one big file so there is no opportunity to load just a few things and do the rest later.
Is this something you’d be willing to work on with me? I’ve attached the output from a run of source-map-explorer on the seed app. A few things stick out immediately that we can probably fix:
- Moment is being used for date manipulation, and it’s a very large monolithic package. Switching to date-fns would save quite a bit of space, if there aren’t too many dependencies on moment quirks.
- The js-yaml package is pulling in an entire Esprima parser! Does the app really need to parse YAML files at runtime? If it needs to process YAML files, could they be preprocessed to JSON perhaps?
- We’re getting two copies of lodash, one appears to be modules and the other monolithic.
- Since everything is parsed and computed at runtime, the app is bundling everything that any schema might use. Some sort of static build step would really help to reduce the bundle size.
- My experience with react-jsonschema-form was that any change (even a keypress) recalculated the entire schema which can make for a very slow app. It looks like the same may happen with JSON Forms? If it was possible to calculate the dependencies every field has and only recompute a field if one of its dependent fields changes, that would save a huge amount of time.
Those are the things I can see up front. As far as quick fixes, switching out Moment and hunting down the redundant lodash might be the easiest one for me to start with. Let me know if you’re interested!