eregs / eregs.github.io

Documentation for the eRegulations project.
https://eregs.github.io/
Creative Commons Zero v1.0 Universal
18 stars 16 forks source link

Proposal: Incrementally shift -site to React + Redux #54

Open cmc333333 opened 7 years ago

cmc333333 commented 7 years ago

As we've added new features (particularly Notice & Comment) which have required significant JS code, we've run into difficulties testing the frontend and following the logic between events. React should help the testing problem by providing very clean abstractions. Redux should make the eventing system easier to follow as it keeps track of the app's state in a single location.

We've also spoke a bit about isomorphic JS and how that could solve some of our split-brain backend-frontend issues. Getting these libraries in will make that direction easier to take, but let's keep the existing backend-generated HTML and focus only on the chunks of markup that are generated in JS. We can revisit once we prove the strategy's usefulness.

The incremental replacement approach is being using now in https://github.com/18F/calc and described in this talk: https://www.youtube.com/watch?v=BF58ZJ1ZQxY

Thanks to @jmcarp for suggesting this originally. What are your thoughts, @theresaanna @ascott1 @xtine?

xtine commented 7 years ago

I would agree to an incremental change while keeping templates, if CALC is shown successful in implementing that. I also really support trying out Redux especially as a lot of the custom event and state handling JS could probably be handled (and tested) better using it.

cmc333333 commented 7 years ago

Thanks @xtine!

theresaanna commented 7 years ago

I'm not familiar with the Notice & Comment work on a technical level, but knowing the foundation of the JS, modern tools/frameworks would help A LOT in reducing the complexity that must still be present. Word is that I'll be involved in an upcoming 18F eRegs engagement - I'm happy to look at incorporating some of this work into that as appropriate.

ascott1 commented 7 years ago

:+1: Though I don't see us tackling this work at CFPB in the near-term, I think it's a good and logical shift.