Upgrading CaseFox to React 18 and MUI v5, module by module
I migrated 87 of 92 modules and wrote the playbook a teammate used to finish the last 5 in 3 to 5 days.
Situation
CaseFox's frontend is split into 92 modules, all on React 16.8 and Material UI v4. The upgrade was handed to me, and the product could not stop shipping while I did it.
Decision
I went one module at a time, not all at once, and wrote each step down as I went. Teammates kept shipping features and fixes in the same modules, so before migrating each one I merged their latest changes. That way none of their work was lost.
What I did
- Migrated 87 modules from React 16.8 to 18.3.1 and from Material UI v4 to v5.
- Solved each kind of problem once (deprecated APIs, dependency conflicts, Hooks rule violations, repeated API calls) and reused the fix.
- Tested every module in the QA environment before release.
- Turned my notes into a step-by-step playbook. A teammate used it to migrate the remaining 5 modules.
Result
The migration took about 3.5 months, and it helped remove production freezing and repeated rendering. The playbook meant a teammate finished the last modules in 3 to 5 days.
Areas covered
- Billing and invoicing
- Accounts and trust accounting
- Time and expenses
- Cases, matters and conflict checks
- Documents and document assembly
- Calendar and tasks
- Messages and client portals
- Reports and performance
- Firm settings and staff
- Imports and exports
Module names are withheld. These are the feature areas they cover.
In numbers
- 87 (95%) Migrated by me
- 5 (5%) Migrated by a teammate, using my playbook
- LCP0.12 s0good up to 2.5 s
- INP120 ms0good up to 200 ms
- CLS00good up to 0.1
Local Chrome DevTools on my machine, with no throttling. The green zone is Chrome's good range.
Measured
- I migrated 87 of the 92 modules myself, about 95% of the total.
- On a CaseFox screen I profiled after the migration, LCP was 0.12 s, layout shift was 0 and INP was 120 ms, all in Chrome's good range.
There is no measurement from before the migration, so I don't claim a speed-up from the migration itself.
Used
- React 18
- MUI v5
- TypeScript
- Git