Frontend rewrite/refactorings ideas
We recently had discussions about the frontend.
The biggest issue is that it is hard to learn how it works, for beginners. There's lot to acquire: PureScript, reactix bindings, and the toestand state management.
We could investigate some potential fixes.
-
Try to refactor the frontend as it is. For sure things like API communication could be moved to separate modules for clarity. Currently they are just crammed into wherever the component is. Also, GraphQL was introduced because for the REST API, construction of the request path itself is cumbersome.
-
I think the biggest pain point is toestand as it's not tied to the standard react ecosystem. We could investigate. React is mostly about components and rendering them. There is no framework provided for complex data that an app would have. Maybe Redux would help here?
-
Investigate whether a different framework would help. Web components or Svelte were proposed. With Web components we would still have the complex state management problem. With Svelte, we would have to abandon PureScript.
-
In any case, a raw demo must be shown so that one can see the benefits clearly.
-
One thing is that the requirement of adopting things to PureScript somehow slow down the development of the frontend: we need to write FFI to 3rd party libs or write things our own way. This has it's pluses and minuses. If we migrated to TypeScript, it would be much easier to interact with 3rd party libs at the cost of having an awkward type system (coming from the Haskell world). Also, not all 3rd party libs export TypeScript types.