Problem: We need to replace an old feature with a similar new feature


Problem: We need to replace an old feature with a similar new feature.

Solution: Do it in phases.

PR 1: Rename the old feature to “old-x” and mark it deprecated.

PR 2: Create the new feature.

PR 3+: Migrate one spot at a time to use the new feature.

Benefits:
✅ Each PR is focused, technically simple, and easy to review.

✅ PR 1 and PR 2 are 100% safe. PR 1 is a type-safe rename. PR 2 just adds code.

✅ Renaming the old feature to “old-x” frees up the name for the new replacement and the name clarifies it should be avoided. Using the "old" name for the new feature helps people discover it.

✅ We don't have to rename stuff later. The new code has a valid name immediately.

View original on X