
As an established enterprise application continued to grow and evolve, opportunities emerged to modernize its technical foundation and improve developer efficiency. As UI Focus Group Leader, I helped guide a three-year initiative focused on adopting modern React practices, strengthening type safety, and improving maintainability. Through steady, incremental improvements, we made the codebase faster and easier to work with while preserving the stability and functionality customers depend on.
Modernization at a Glance
Tracking progress in type safety, React modernization, and development tooling.
The Challenge
Legacy patterns were slowing development.
Our development was hindered by outdated dependencies and inconsistent coding practices within a well-established enterprise application. With over 2,000 instances of TypeScript's any type, we faced significant challenges in type safety, debugging, and maintenance. It was clear that modernization was essential, but we needed to achieve this without disrupting existing functionality or delaying new feature delivery.
The Approach
Establishing a roadmap for incremental improvement.
As the UI Focus Group Leader, I spearheaded a long-term modernization initiative aimed at enhancing code quality and developer efficiency. We pinpointed key indicators of technical debt, such as TypeScript adoption rates, deprecated React functions, and legacy component patterns. By tracking these metrics, we established clear priorities and a transparent way to measure our progress.
The Strategy
Making modernization part of everyday development.
Instead of opting for a disruptive rewrite, we adopted an incremental approach that seamlessly integrated modernization into our ongoing feature development. Targeted refactoring was combined with improvements to legacy code encountered during regular work. Monthly UI Focus Group meetings allowed us to review our progress and tackle challenges, while annual presentations showcased our measurable advancements, maintaining team motivation. This approach turned modernization into a shared, ongoing responsibility.
The Outcome
Three years of measurable progress.
Over three years, our initiative led to significant improvements in the technical foundation of our application. Key milestones included:
- Upgrading from React 16 to 18
- Transitioning from Webpack to Vite, resulting in 60-80% faster builds
- Expanding TypeScript adoption with over 350 additional files
- Shifting to modern component patterns, with a jump to 361 functional components
- More than doubling the use of React Hooks
- Removing 140+ instances of deprecated lifecycle methods
The Value
A healthier codebase built for the future.
The result? A healthier, more maintainable codebase and a streamlined development process. Faster builds reduce overhead, better type safety helps catch errors early, and consistent React patterns make the code easier to manage. Importantly, we’ve established a sustainable approach to modernization—continuously reducing technical debt while delivering new features and ensuring stability in our enterprise platform.
Modernization in Practice
Applying modern React patterns and stronger type safety to an evolving codebase.
Formatting records
UNSAFE_componentWillReceiveProps(nextProps) {
if (nextProps.records) {
for (const item of nextProps.records) formatText(item);
}
}getFormattedRecords = memoizeFormattedRecords(formatDetailText);
render() { ... records={this.getFormattedRecords(this.props.records)} ... }Building select options
UNSAFE_componentWillReceiveProps(nextProps) {
this.initializePlantType(nextProps);
this.initializePlantLife(nextProps);
this.initializePlantStage(nextProps);
// ...plus 2 more, and the same shape repeated in 8 panels
}
initializePlantType = (nextProps) => {
if (nextProps[PICKLIST_PLANT_TYPE]) { // bare truthiness
this.setState({
[PICKLIST_PLANT_TYPE]: prepareSelectableOptions(
nextProps[LIST_PLANT_TYPE],
{ guid: LIST_GUID, label: VALUE, id: ID }
),
});
}
};
// render: options={this.state[LIST_PLANT_TYPE]}getPlantTypeOptions = memoizeSelectableOptions((options) =>
prepareSelectableOptions(options, { guid: LIST_GUID, label: VALUE, id: ID })
);
// render:
options={this.getPlantTypeOptions(this.props[LIST_PLANT_TYPE])}