Advertisement
Guest User

Untitled

a guest
Apr 25th, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.71 KB | None | 0 0
  1. # Frontend repo improvements
  2.  
  3. ## Tests
  4. Before any major improvements can be made safely, I think we should write a full suite of tests (Cypress, Selenium, whatever) covering the majority of the flows through the FMS.
  5.  
  6. This will not only give us a suite of tests that we can run against the product periodically, but would also be a good learning exercise for everyone on the team, as there are definitely parts of the site that noone knows about!
  7.  
  8. We can then also extract a small suite of smoke tests from this that we can run against PR's to ensure safety around releases.
  9.  
  10. This would also hopefully flag up some currently broken/unused bits of functionality that we could remove.
  11.  
  12. ## Repository shape
  13. Moving to a Lerna (or alternative) managed monorepo with each app powered by Create React App, as proposed by Luca, would allow us to make future changes to the apps in an easier manner. We would also benefit from the Webpack configurations being a bit more standardised, and Webpack would not rebuild every single app on changes, which should improve the developer experience.
  14.  
  15. ## React upgrades
  16. Upgrading React would obviously be a good idea, in terms of product health, performance, and hiring/retaining talent (no-one wants to work with fossils).
  17.  
  18. This has been attempted in the past, with one of the major stumbling blocks being our ancient monkey-patched version of React Router.
  19.  
  20. Along with the monorepo change above, we could take some of the pain out of the upgrade process by upgrading the apps one by one.
  21.  
  22. Upgrading React would also mean we could use some of the newer features of React, such as hooks, which would allow us to gradually remove our dependency on `recompose` HOCs (make the components a bit nicer in the process).
  23.  
  24. ## Flow
  25. Morgan proposed removing Flow when he joined. A bit of work was done on this, but we should either just remove Flow or use it properly. I have no strong feelings either way on this.
  26.  
  27. ## Recall
  28. I would vote to get rid of this. I spiked replacing it with GraphQL & Apollo, which didn't seem too onerous, and would allow us to use both at the same time while we migrate.
  29.  
  30. The spike was for the supplier page, and took us from about 10-15 queries to just 1. Apollo handles all of the caching & record stores, so we could remove a large bunch of code by making this change, and could speed up the app for our users.
  31.  
  32. ## Immutable.js
  33. Another large library that we could remove with the above change. I'm not sure if we can use Immutable.js alongside Apollo out of the box, but currently we half use it and half don't, so I don't think removing it would be too much of a hardship.
  34.  
  35. If we were to move to Apollo, immutable records wouldn't really give us much benefit, as Apollo keeps track of whether or not a re-fetch is required.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement