Work
Migrating the widget platform to TypeScript and React
A multi-year migration of a customer-embedded widget from a legacy stack to TypeScript + React — taken seriously because it ships into pages we do not control.
- Senior Software Engineer III
- 2023
- TypeScript · React · Embed · Design system · Performance
A widget that sits inside other people’s web pages is not a normal frontend. Every byte is on someone else’s critical path; every CSS leak is a support ticket; every bug ships to traffic that did not opt in to your stack choices.
The framing
The migration was not really about TypeScript or React. Those were the tools. The interesting question was what does it cost the host page when our widget loads, and how do we shrink that cost without losing what the product needs to do?
What changed
- Migrated the widget platform end-to-end to TypeScript + React.
- Bundle size reduced by 60%.
- Twelve consecutive months without a release rollback after the migration stabilised.
- Built design-system components the widget could share with the dashboard without dragging styling into the host page.
- Designed cross-domain messaging primitives so the widget could coordinate with the dashboard without relying on tight coupling.
- Stood up an A/B testing surface that the product team could iterate inside without reshipping the widget for every experiment.
Tradeoffs
The migration was deliberately incremental. Old and new code paths ran side by side through the bulk of the work, so any regression was attributable rather than mysterious. That cost calendar time and bought confidence we still spent later.
Outcome
A widget that loads faster, breaks less, and gives the product team room to learn from real users without the engineering team holding its breath every release.