Urgent.News

What's breaking now, across hundreds of outlets.

Tech

Strangler Fig, Branch by Abstraction, Vertical Slices: Choosing a Frontend Migration Strategy

Strangler fig, branch by abstraction, vertical slicing: the strategy decides whether a frontend migration ships, more than the framework you move to. Here's how each one works, where each one bites, and how we combine them on real projects. Teams that plan a frontend migration spend weeks on the target: React or Vue, Next.js or Vite, Redux or TanStack Query. Then they spend almost no time on the…

Frontend migration strategies like "strangler fig", "branch by abstraction", and "vertical slicing" determine whether a migration ships, more so than the chosen framework. These strategies dictate how the old and new apps will coexist until the old app is fully replaced.

The big-bang rewrite is the baseline approach where the whole app is moved to the new framework all at once. However, it can lead to problems if the app is large, frozen, or uses legacy stacks that make coexistence difficult. This approach also poses risks as the old app remains in production and may hold unknown bugs and knowledge. Furthermore, rollback to the old app becomes problematic as it's no longer maintained.

Strangler fig addresses this by using a routing layer to gradually redirect user requests from the old app to the new one. New routes are migrated one at a time, allowing new features to be launched in the new app while keeping the old app running. This strategy helps avoid the pitfalls of the big-bang rewrite by allowing real users to see progress early and ensuring rollback is as simple as redirecting traffic back to the old app.

Branch by abstraction takes a different approach by introducing a seam in the codebase. Services, stores, and widgets used by both apps are separated behind this seam. By flipping the switch between the new and old implementations, developers can gradually migrate to the new approach without disrupting the entire system. This approach provides flexibility in handling complex dependencies and enables incremental migration without affecting the entire application.

Vertical slicing focuses on migrating one user-facing feature from top to bottom. Instead of breaking down the migration into small pieces, vertical slicing moves an entire feature together, including its front-end and back-end components. This strategy is effective when a feature is relatively small and can be completed incrementally by the development team. It allows for a cohesive migration process while minimizing the risk of introducing bugs or inconsistencies across different parts of the application.

While the framework-specific guides provide deeper details on each starting point, the focus of this post is on the underlying strategy that ties these approaches together. By understanding the migration strategy, teams can make informed decisions about the best approach to take based on their app's complexity, size, and migration requirements.

Ultimately, the choice of strategy depends on factors such as the size of the app, the presence of clear routes or features, the ability to coexist with the old app, and the need for rollback capabilities.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in Tech

Building Reliable API Integrations for PHP Web Applications

Modern web applications often depend on external services for payments, customer information, notifications, booking data, and other business operations.

  • Focus on data flow direction and failure points in design
  • Secure authentication methods with limited permissions
  • Validate requests and responses, record errors securely

More from Monday 12 October →