Guest User

Untitled

a guest
Feb 21st, 2018
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.30 KB | None | 0 0
  1. React NYC 11/9/2017
  2.  
  3. reactNYC youtube channel: youtube.com/reactNYC
  4. Slack Channel: nycjs.org.now.sh
  5.  
  6. # Converting an application from angular 1.5 to react 16
  7.  
  8. ## Overview
  9. - It took 1 quarter
  10. - 15 engineers, 100+ employees (a little smaller than VTS)
  11. - 1700 files, 124k lines (over 6-8 months)
  12. - How to get buy-in from the org?
  13. - Can make things faster, clear technical debt, improve stability, make great tests
  14. - Concrete: Performance, stable, attractive to candidates
  15.  
  16. ## Side-by-side approach to the integration
  17. i.e. gradually port the whole codebase. No stop the world approach
  18. - Don't have to port the features you're already building
  19. - Similar angularJS architecture to VTS
  20.  
  21. ## Blending frameworks
  22. - Routing
  23. - ngreact
  24. - Redux
  25. - [ ] Can we port our angular services to redux without making them be consumed by react?
  26. - Map redux actions and selectors to angular
  27. - Angular doesn't have to talk to react directly, can leverage redux
  28. - Create angular constant that is the redux store
  29. - angular is allowed to call react, but react is not allowed to call angular
  30. - Except for changing routes
  31. - Inject angular router into react
  32.  
  33. ## Three phases
  34. 1. Bottom up
  35. - First do the small little components (e.g. avatars, pictures, etc.)
  36. 2. Page-by-page
  37. - Touch on the view/container components fully
  38. - Make the route map to an entire react component.
  39. - Can use the same feature testing on the components
  40. 3. Router switch
  41. - Change angular router to react router
  42.  
  43. ## Incremental onboarding of people
  44. 1. Initial team
  45. 2. New hires
  46. 3. Whole team
  47. - Kind of only relevant if we're hiring. We are not.
  48.  
  49. ## Results
  50. - +80% better page loads
  51. - +infinite% tests
  52. - Much happier
  53.  
  54. ## Lessons
  55. - Envision the final architecture from the get-go
  56. - Don't adapt to angular. Try to do it as react-ish as possible. Refactor!
  57. - Bridge angular and react router
  58. - This was pretty difficult and painful
  59. - Let them work together?
  60. - An angular component that takes some react router history and work together
  61.  
  62. ## Question:
  63. - You can implement many of the patterns that react uses in angular 1, why choose to rewrite your application?
  64. - Codebase was large, not well tested.
  65. - Looking at UX and page loading times, people were excited about what react brought to the table.
  66. - Would have been a big project anyway.
  67.  
  68. # Bringing Components to Legacy Code
Add Comment
Please, Sign In to add comment