Modernization Strategy: Incremental Migration or Rewrite
Weighing incremental migration (ngUpgrade) against a full rewrite, and how to decide.
What you'll learn
- Describe what ngUpgrade enables for incremental migration
- List factors that favor incremental migration versus a full rewrite
- Explain why 'stay on AngularJS indefinitely' is not a viable long-term option
Explanation
Given AngularJS's end-of-life status (from this course's first lesson), every AngularJS application eventually needs a modernization plan. There are two broad strategies.
Incremental migration, historically enabled by tools like ngUpgrade, lets AngularJS and modern Angular run side-by-side in the same application during a transition period -- you migrate one feature/section at a time to the new framework while the rest of the app keeps running on AngularJS, rather than needing a single big-bang rewrite. This reduces risk (smaller, independently-testable changes) and lets a team keep shipping other features during the migration, at the cost of running two frameworks' overhead simultaneously for a while and needing genuine expertise in both to bridge them correctly.
A full rewrite starts fresh (in modern Angular, React, Vue, or another current framework), often becoming the more practical choice when the existing AngularJS codebase is small, when its architecture has degraded significantly over years of maintenance, or when the team wants to also change frameworks entirely (not just AngularJS-to-Angular) as part of the same effort.
Factors that typically favor incremental migration: a large, actively-used application where a full rewrite's multi-month/multi-year timeline is too risky; a team that needs to keep shipping features throughout. Factors that typically favor a full rewrite: a smaller application; a codebase whose AngularJS-era architecture itself needs fundamental rethinking, not just a framework swap; or a decision to move to a framework other than modern Angular, where ngUpgrade-style interop doesn't apply at all.
What's not a viable long-term option: staying on unmaintained, end-of-life AngularJS indefinitely -- security patches have stopped, and the ecosystem (browser compatibility, hiring developers familiar with it, third-party library maintenance) only gets harder over time.
Guided lab
Predict: A simple migration-strategy heuristic
This models (as a simplified, illustrative heuristic, not a real formula) a rough decision function weighing app size and target framework. Predict its output for both inputs.
interface AppProfile {
linesOfCode: number;
targetIsModernAngular: boolean;
}
function suggestsIncrementalMigration(profile: AppProfile): boolean {
return profile.linesOfCode > 50000 && profile.targetIsModernAngular;
}
const smallApp: AppProfile = { linesOfCode: 8000, targetIsModernAngular: true };
const largeAngularApp: AppProfile = { linesOfCode: 120000, targetIsModernAngular: true };
const largeReactTarget: AppProfile = { linesOfCode: 120000, targetIsModernAngular: false };
console.log(suggestsIncrementalMigration(smallApp));
console.log(suggestsIncrementalMigration(largeAngularApp));
console.log(suggestsIncrementalMigration(largeReactTarget));Stuck? Get a hint.
Common mistakes
- Treating 'do nothing, stay on AngularJS' as a viable long-term strategy -- it isn't, given the end-of-life status covered at the start of this course.
- Assuming a full rewrite is always the right choice, without weighing the real risk/cost of a long rewrite for a large, actively-used application.
- Assuming ngUpgrade-style incremental migration applies when moving to a framework other than modern Angular -- that specific tool is Angular-to-Angular-specific interop.
Knowledge check
Takeaway
Weigh incremental migration (ngUpgrade, lower risk for large active apps) against a full rewrite (often better for small or architecturally-troubled apps) -- but 'stay on AngularJS forever' isn't a real option.
Summary
ngUpgrade enables incremental AngularJS-to-Angular migration; a full rewrite often suits smaller or architecturally-troubled codebases; staying on end-of-life AngularJS indefinitely isn't viable.
References
Your notes
Notes save automatically.
Finished this lesson?
Mark it complete to track your progress and schedule a future review.
AI tutor
The optional AI tutor isn't enabled in this deployment. All lessons, exercises, quizzes, and search work fully without it.