Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Refactoring, from AngularJS to React

Avatar for Alex Tzeng Alex Tzeng
November 03, 2018

Refactoring, from AngularJS to React

Avatar for Alex Tzeng

Alex Tzeng

November 03, 2018
Tweet

Other Decks in Programming

Transcript

  1. W About Senior-ish frontend developer Often credited as a good

    storyteller 
 ( not what I expected )
  2. Main problems Rewrite from a 5-year-old codebase Recompile time >

    40s Outdated abstraction Several 3000+ line behemoths Legacy tooling Chaos coding style
  3. Always communicate Transparency is one of the most important values

    in Agile Tip A Only if you express the problems, then you can solve them
  4. If you expected the codebase will at least last 1

    year Tip B Caring about enginneering health will save your time in the long run
  5. Most managers want good code, even when they are obsessing

    about the schedule. Tip C They may defend the schedule and requirements with passion; but that’s their job. It’s your job to defend the code with equal passion.
  6. And auto inject with angularJS magic Makes it hard to

    find where the depedency come from
  7. Reasons to use Redux Relatively easy to debug Completely framework-agnostic

    ( works well when migrating ) Well known enough for newcomers
  8. Reasons to move from Gulp to npm + webpack Supports

    CommonJS module, url rewrite out of the box Better dev experience with dev-server Easier to audit module size, compile time
  9. Why migrate to React More mature ecosystem Easier to hire

    / get in project Familiar with team member
  10. Total rewrite ( rm -rf ./ ) Too risky for

    production project Only apply for core components Hard to estimate time
  11. Summary (Story) Care more about engineering health Self-aware is the

    key to clean code Refactoring using the scrum way
  12. Summary (3 problems) Nested dependency is more scalable Redux for

    cross-framework state Gulp -> Webpack Progressively migrate to React