Smaller Bundles and Faster Pipelines
We cleaned up one of our largest frontend repos — dropped hundreds of unused screens, removed dead dependencies, and halved the JS bundle. CI got 2x faster with a few clever optimizations. Here's how boring cleanup and smart tweaks led to big wins.
Over time, any large codebase starts to resemble a city that's expanded without a zoning plan - ours was no exception. Since 2016, udaan had picked up a lot of baggage: unused screens, legacy modules, abandoned workflows, and app bundles that hadn't been touched in years.
We finally hit the point where we couldn't ignore it anymore. So we rolled up our sleeves and got to work.

We ran a focused cleanup drive on some of our core frontend repositories, and the payoff was significant:
- React Native bundle size reduced from
17MBto6.88MB - As a happy side-effect, our app startup time for our P90 users improved by
~500ms. - CI optimization brought down execution time from
8m 30sto just3m 30s
This post walks through how we approached the cleanup, the tooling that helped, and the real-world impact it had on our builds and workflows.
Some Context
We maintain a shared repository called ui-screens that houses the UI code for multiple apps. It includes hundreds of screens, used across different verticals and products. For faster development, we run this codebase in the browser using React Native Web. This setup gives us the flexibility to use modern dev servers like vite or rspack instead of being tied to Metro.
The actual React Native apps consume ui-screens as a package, dynamically loading their respective screens at runtime. While this setup gives us modularity and speed, it also means any unused or legacy screen still contributes to the final bundle - unless explicitly removed.
The Cleanup Process
As the product scaled, the codebase expanded unevenly. Deprecated workflows, multiple iterations of the same screen, and entire app bundles were left behind as priorities shifted. But these artifacts never left our final bundle - they were still being built and shipped, adding cost to every release.
We knew there was a lot we could safely remove, but the risk of deleting something still in use was too high. What we needed was a reliable, data-backed way to identify dead code without breaking user experience. That's what pushed us to invest in the right internal tooling — and huge props to @bogas04 for building it out 🎉
Here's how we approached it:
- We built a bespoke "Workflow Explorer", a simple dashboard powered by Percept, to track daily active users per screen and confidently flag what could go.
- Combined that with TypeScript's type safety and rspack build failures to catch dangling references early and keep deletions safe.
- We also found that even a harmless-looking import could pull in a large dependency graph - another reason the bundle shrunk so drastically.
- A quick
npx depcheckrevealed 14 unused third-party dependencies - gone. - Final screen count: down from 400+ to 204

Even with a leaner codebase, we were still spending over 8 minutes just to publish a package. It was far from ideal.
2x CI Speed Without Cutting Corners
While cleaning up the codebase, we turned our attention to something just as critical: CI performance. Our pipeline had become noticeably slow - with an average runtime of 8m 30s, it was starting to bottleneck everyday development.

After digging into the pipeline, we found a handful of choke points that, when addressed, gave us a massive improvement. Here's how we tackled them:
1. Optimized git checkout
- Reduced from
30s --> 3sby settingfetch-depth=1 - Previously, we used depth=0 to fetch the entire git history, which was necessary to access annotated tags - these were used to derive package versions in our CI
- But with over 20,000 commits on master and hundreds of branches, fetching the full history became increasingly expensive
- We changed our versioning strategy to avoid relying on tags during CI, which allowed us to use a shallow clone and dramatically reduce checkout time
2. Faster dependency installs
- Reduced install time from
60s+ --> ~10s - Switched from yarn to pnpm for package management
- Used actions/cache@v4 for automatic caching of dependencies
- Kept the cache key logic simple and deterministic: we used
hash(pnpm-lock.yaml)as key so that any change to dependencies would automatically bust the old cache
3. Eliminated cross-repo sync jobs
- Our CI workflow included steps to sync ui-screens with two other React Native apps.
- So we eliminated these sync jobs that added
180sto every build. - We inverted the control: instead of ui-screens trying to update its consumers, it now simply dispatches a
bump-ui-screensevent - Each consumer repository listens for this event and updates itself independently via its own GitHub Action
- This decoupling made the pipeline faster, easier to maintain, and much less error-prone

Wrapping up
By focusing on code hygiene, streamlining our pipelines, and removing unused dependencies, we made things lighter, faster, and easier to maintain. It was just deliberate, systematic work backed by good tooling and clear intent.
One thing we were reminded of: developer experience matters, but it doesn't have to be fancy to be effective. It's easy to get carried away building elaborate internal tools. But in our case, a simple dashboard showing screen usage and bundle size trends gave us just enough visibility to make confident decisions. Seeing that bar graph shrink with every PR was all the motivation we needed.
If you've been putting off this sort of cleanup - take this as your sign! :)