Closed sourcefilter closed 6 years ago
Yeah, the BuildUCLA web team students I supervise are always agitating to burn down any existing framework we're using and replace it with a JSON bucket on the backend and whatever hotrod Javascript front-end is in vogue. Apparently this is called a "progressive" stack. I'm not against it in principle, though for this project, I think I'd prefer to get #1 working and then explore #3 or #5 if there's time.
The problem
Potential Solutions
1. Be inflexible. Force users to conform to a strict, hard-coded schema. Clearly separate the imported data, which can be stored in a JSONField but not edited.
To be honest, I hadn't even been considering this option. It'd be so much easier. Maybe I'm wasting a lot of energy on things that don't add that much value...
2. No JSONField - use a separate table of (Object, property, value) triples.
Pros:
Cons:
3. Write new Django FormFields and Widgets.
Pros:
Cons:
4. JavaScript option 1: make a jquery widget.
Pros:
Cons:
5. Javascript option 2: make a react widget.
Cons:
Pros:
Cons to switching entirely to react:
Current Status
I've made significant progress on #3 (a new Django widget), but am really leaning toward #1 (inflexible metadata) or #5 (switching to React). The middle ground options just don't seem to be worth the trouble.
I've also made some progress on the react version and it seems doable, but it'd really only be worth it if we wanted to change our frontend framework to react – which is a pretty big decision.