finished not yet on protocol
Rewrite comments in Rails
Currently, comments are written in React, using TypeScript + the GraphQL API. this seemed like a good idea in the beginning, but currently adds a lot of complexity to the system:
1. Comments is the only piece of Decidim that actively uses the API. This forces the new developers to learn yet another piece of software, steeping the learning curve.
2. Comments use TypeScript instead of bare JS. This adds type safety, but steepens the learning curve.
3. In development, the API breaks. This is not a Decidim problem per se, it's a bug on the library we use to develop the API, but again it makes it harder to develop.
All this makes it harder to modify/improve the comments section, but we'd reduce a lot of lines of code, we'd slim dependencies down and we'd remove some complexity. Also, we'd gain some consistency in development.
The downside is that this could be a big refactor, but I think it's a nice investment.
5 comments
-
In favour
I agree with all that has been said, however, Let's not forget about OpenData and the easiness GraphQl brings.
0 votes up 0 votes down-
@Armand-OSP true, the GraphQL and OpenData can be kept! 😄
0 votes up 0 votes down
-
-
In favour
I agree
0 votes up 0 votes down -
In favour
Agreed. Customization of the comments component is currently a headache because we have to "fork" the whole React component. This also detaches the whole component from the Decidim core which increases the maintenance overhead of the customized component.
This would make more sense in case the whole Decidim frontend was written in React.
1 votes up 0 votes down -
Thanks a lot @ah !
0 votes up 0 votes down
Sign in with your Atmosphere account to comment.