Old codebase, outdated tool chain - how to limit the blast?
I have a 5-6 year-old enterprisey React codebase at work with a bunch of dependencies that for the most part haven't been upgraded since the day they were first installed. Most of the build chain is two+ major versions behind current: webpack 3, babel (& all loaders/plugins) v6, from before the monorepo reorg, Jest v23, and Flow version 0.37. For those who haven't been keeping up with Flow (and who has?) the current version is 0.195.0. It's so old that the flow-language-server in vs code won't start, and the Stripe flow-to-typescipt-codemod works only partially and leaves several thousand compiler errors that it can't address.
Oh, and it's also an ejected create-react-app codebase with a lot of custom build scripts and a really bespoke end-to-end testing setup that I don't pretend to understand.
Anyone who understood this codebase has long since moved on. Right now I'm as expert as anyone else here, and I have the team's blessing to take the reins and upgrade this all to a modern stack. But as I experiment with it, it's a pile of pickup sticks, because anything I pull on seems to require me to upgrade everything else. Target state is Typescript replacing Flow, and either Vite and Vitest replacing the rest of the toolchain— or if that's impossible, at least modern versions of Webpack and Jest.
Question for the channel, as per title: is there any way to avoid a big rewrite that takes a month and breaks a bunch of things I don't know about? Anybody have experience with something similar?
Codemod Stripe used to migrate 6.5m+ lines of code from Flow to TypeScript - GitHub - stripe-archive/flow-to-typescript-codemod: Codemod Stripe used to migrate 6.5m+ lines of code from Flow to Type...