SlideShare a Scribd company logo
How to
Migrate from
Angular to React
Feb 28, 2019
Tomasz Bąk
t.bak@selleo.com
About me
● 13 years software developer at selleo.com
● 6+ years senior frontend developer
Agenda
● Why migrate?
● Migration strategies
● Micro Frontends architecture
Before migration consider
the business value and costs
“Old code has been used. It has been tested. Lots of bugs
have been found, and they’ve been fixed. Each of these bugs
took weeks of real-world usage before they were found.
When you throw away code and start from scratch, you are
throwing away all that knowledge.”
Source: https://www.joelonsoftware.com/2000/04/06/things-you-should-never-do-part-i/
Joel Spolsky
“This code is a mess”
is not a good reason to migrate
● ugly code - fix cryptic variables names, mixed
_camelCase/snake_case etc.
● architecture problems - can be solved, one at a time, by
carefully moving code, refactoring, changing interfaces
● performance problems - when optimizing for speed, 1%
of the work gets you 99% of the bang
Source: https://www.joelonsoftware.com/2000/04/06/things-you-should-never-do-part-i/
Why migrate?
● Hiring and talent retention
● Tech stack unification
● Leverage other tech ecosystem
React advantages
● JavaScript superpowers
○ JSX blends well together with JavaScript
○ your components are functions
○ static type checking (TypeScript instead of PropTypes)
● stronger libraries community
○ Redux, Jest + Enzyme, Formik + Yup
○ React / Redux developer tools
● strict unidirectional data flow
Migration vs business value
Legacy
App
New
App
Time
Added Value
Migration vs business value
Legacy
App
New
App
Time
Added Value ... ......
Migration strategies
Bottom-up Top-down
Migration strategies
Bottom-up Top-down
Embed React components in Angular
Usually delays state management
layer migration
Replace larger chunks, usually URL based
Two separate state management layers
Martin Fowler’s
Strangler Application pattern
Transform - create a parallel new view
Coexist - leave the existing view for a time, so the
functionality is implemented incrementally
Eliminate - remove the old functionality as users
stop using it
Source: https://developer.ibm.com/articles/cl-strangler-application-pattern-microservices-apps-trs/
How to apply
Strangler Application pattern
Identify the Bounded Contexts in your application
design - e.g. in an airline application, flight booking
would be one Bounded Context, while the airline
loyalty program would be a different Bounded
Context.
Choose the Bounded Context that is the smallest
and least costly to refactor
Source: https://developer.ibm.com/articles/cl-strangler-application-pattern-microservices-apps-trs/
Micro Frontends architecture
The idea behind Micro Frontends is to think
about a website or web app as a composition of
features which are owned by independent
teams. Each team has a distinct area of
business or mission it cares about and
specialises in. A team is cross functional and
develops its features end-to-end, from database
to user interface.
Source: https://micro-frontends.org
Micro Frontends architecture
Micro Frontends architecture
Who is using Micro Frontends?
HelloFresh
“At first, we found development speed to be a bit slow. Since this approach
requires you to own your entire project E2E, the learning curve can be steep. But
after cresting the curve we were able to push out projects like never before;
the new HelloFresh shop, for example, took 3 people 4 weeks to roll out. Our
developers also claim increased confidence and breadth of knowledge after
adopting this approach.”
Source: https://engineering.hellofresh.com/front-end-microservices-at-hellofresh-23978a611b87
Who is using Micro Frontends?
Ikea
“Today, we are aware that we should normally not have our whole enterprise in one service, and so we
split up the enterprise architecture in smaller services, for example, microservices. However, we are
also starting to realize that we have the same problems with the frontend monolith as we had with the
backend monolith, Gustaf Nilsson Kotte explained in a recent interview hosted by Stefan Tilkov. Using
a micro frontend architecture, he breaks the frontend into smaller parts to allow for teams to deploy
autonomously, thus enabling continuous delivery for web frontends.”
Source: https://www.infoq.com/news/2018/08/experiences-micro-frontends
Micro Frontends architecture - Single SPA framework https://single-spa.js.org
Micro Frontends architecture - Single SPA framework https://single-spa.js.org
import {declareChildApplication, start} from 'single-spa';
declareChildApplication('navbar',
() => import('./navbar/navbar.app.js'), () => true);
declareChildApplication('home',
() => import('./home/home.app.js'), () => location.pathname === "" || location.pathname === "/");
declareChildApplication('angular',
() => import('./angular/angular.app.js'), pathPrefix('/angular'));
declareChildApplication('react',
() => import('./react/react.app.js'), pathPrefix('/react'));
declareChildApplication('vue',
() => import('src/vue/vue.app.js'), pathPrefix('/vue'));
start();
Micro Frontends architecture - Single SPA framework https://single-spa.js.org
import React from 'react';
import ReactDOM from 'react-dom';
import singleSpaReact from 'single-spa-react';
import rootComponent from './root.component.js';
const reactLifecycles = singleSpaReact({
React, ReactDOM,
rootComponent,
domElementGetter: () => document.getElementById('react-app')
});
export const bootstrap = [reactLifecycles.bootstrap];
export const mount = [reactLifecycles.mount];
export const unmount = [reactLifecycles.unmount];
Summary
● Consider the business value and costs
● Identify the Bounded Contexts in your application
● Make your application more modular, break the
Monolith!
Q&A
t.bak@selleo.com

More Related Content

PPTX
Container Orchestration
PPTX
Micro Front Ends : Divided We Rule by Parth Ghiya - AhmedabadJS
PDF
Micro frontends with react and redux dev day
PDF
JSFest 2019: Technology agnostic microservices at SPA frontend
PPTX
JS Fest 2019/Autumn. Влад Федосов. Technology agnostic microservices at SPA f...
PPTX
Micro-frontends – is it a new normal?
PPTX
Micro Frontends.pptx
PDF
OdessaJs 2020 - How to build your first micro frontend in a matter of minutes
Container Orchestration
Micro Front Ends : Divided We Rule by Parth Ghiya - AhmedabadJS
Micro frontends with react and redux dev day
JSFest 2019: Technology agnostic microservices at SPA frontend
JS Fest 2019/Autumn. Влад Федосов. Technology agnostic microservices at SPA f...
Micro-frontends – is it a new normal?
Micro Frontends.pptx
OdessaJs 2020 - How to build your first micro frontend in a matter of minutes

Similar to How to migrate large project from Angular to React (20)

PDF
Building Micro-Frontends: Scaling Teams and Projects Empowering Developers 1s...
PPTX
Building Microtrends With React
PDF
Building Micro-Frontends: Scaling Teams and Projects Empowering Developers 1s...
PDF
The Modern Web with Microfrontends
PDF
'How to build your first micro frontend in a matter of minutes' by Vladlen Fe...
PDF
Ivan Jovanovic - Micro Frontends - Codemotion Rome_2019
PPTX
Building applications in a Micro-frontends way
PDF
Scaling frontend applications with micro-frontends Presentation.pdf
PDF
FEVR - Micro Frontend
PDF
Find a React Developer Specialized in Micro-Frontends & Modular Architecture.pdf
PPTX
Micro-Frontends JSVidCon
PDF
Micro Frontends
PDF
Embrace the front-end revolution - Sánchez-Mariscal
PDF
Embrace the frontend revolution
PDF
Front end microservices: architectures and solution
PDF
Micro Frontends
PDF
MicroForntends.pdf
PDF
Micro frontends
PPTX
DIGIT Noe 2016 - Overview of front end development today
PPTX
Micro Front-End & Microservices - Plansoft
Building Micro-Frontends: Scaling Teams and Projects Empowering Developers 1s...
Building Microtrends With React
Building Micro-Frontends: Scaling Teams and Projects Empowering Developers 1s...
The Modern Web with Microfrontends
'How to build your first micro frontend in a matter of minutes' by Vladlen Fe...
Ivan Jovanovic - Micro Frontends - Codemotion Rome_2019
Building applications in a Micro-frontends way
Scaling frontend applications with micro-frontends Presentation.pdf
FEVR - Micro Frontend
Find a React Developer Specialized in Micro-Frontends & Modular Architecture.pdf
Micro-Frontends JSVidCon
Micro Frontends
Embrace the front-end revolution - Sánchez-Mariscal
Embrace the frontend revolution
Front end microservices: architectures and solution
Micro Frontends
MicroForntends.pdf
Micro frontends
DIGIT Noe 2016 - Overview of front end development today
Micro Front-End & Microservices - Plansoft
Ad

More from Tomasz Bak (18)

PDF
Design Patterns in React
PDF
Building React CRUD app in minutes?
PDF
JAMstack
PDF
e2e testing with cypress
PDF
How to GraphQL: React Apollo
PDF
How to GraphQL
PDF
Working with npm packages
PDF
How to replace rails asset pipeline with webpack?
PDF
Functional Reactive Angular 2
PDF
Jak wnieść wkład w Open Source?
PDF
JavaScript Promises
PDF
Replacing Rails asset pipeline with Gulp
PPTX
Ulepszanie aplikacji webowej z AngularJS
PDF
Bardziej produktywny gmail
PDF
Kerberos
PDF
Rails tobak2005
PDF
Ldap novell
PDF
Testowanie JavaScript
Design Patterns in React
Building React CRUD app in minutes?
JAMstack
e2e testing with cypress
How to GraphQL: React Apollo
How to GraphQL
Working with npm packages
How to replace rails asset pipeline with webpack?
Functional Reactive Angular 2
Jak wnieść wkład w Open Source?
JavaScript Promises
Replacing Rails asset pipeline with Gulp
Ulepszanie aplikacji webowej z AngularJS
Bardziej produktywny gmail
Kerberos
Rails tobak2005
Ldap novell
Testowanie JavaScript
Ad

Recently uploaded (20)

PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PPTX
Introduction to Artificial Intelligence
PDF
Digital Strategies for Manufacturing Companies
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PPT
Introduction Database Management System for Course Database
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PPTX
Transform Your Business with a Software ERP System
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
Nekopoi APK 2025 free lastest update
PDF
System and Network Administraation Chapter 3
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PPTX
L1 - Introduction to python Backend.pptx
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Introduction to Artificial Intelligence
Digital Strategies for Manufacturing Companies
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Wondershare Filmora 15 Crack With Activation Key [2025
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Introduction Database Management System for Course Database
How to Choose the Right IT Partner for Your Business in Malaysia
Odoo Companies in India – Driving Business Transformation.pdf
Transform Your Business with a Software ERP System
Odoo POS Development Services by CandidRoot Solutions
Nekopoi APK 2025 free lastest update
System and Network Administraation Chapter 3
Softaken Excel to vCard Converter Software.pdf
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Navsoft: AI-Powered Business Solutions & Custom Software Development
L1 - Introduction to python Backend.pptx
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025

How to migrate large project from Angular to React

  • 1. How to Migrate from Angular to React Feb 28, 2019 Tomasz Bąk t.bak@selleo.com
  • 2. About me ● 13 years software developer at selleo.com ● 6+ years senior frontend developer
  • 3. Agenda ● Why migrate? ● Migration strategies ● Micro Frontends architecture
  • 4. Before migration consider the business value and costs “Old code has been used. It has been tested. Lots of bugs have been found, and they’ve been fixed. Each of these bugs took weeks of real-world usage before they were found. When you throw away code and start from scratch, you are throwing away all that knowledge.” Source: https://www.joelonsoftware.com/2000/04/06/things-you-should-never-do-part-i/ Joel Spolsky
  • 5. “This code is a mess” is not a good reason to migrate ● ugly code - fix cryptic variables names, mixed _camelCase/snake_case etc. ● architecture problems - can be solved, one at a time, by carefully moving code, refactoring, changing interfaces ● performance problems - when optimizing for speed, 1% of the work gets you 99% of the bang Source: https://www.joelonsoftware.com/2000/04/06/things-you-should-never-do-part-i/
  • 6. Why migrate? ● Hiring and talent retention ● Tech stack unification ● Leverage other tech ecosystem
  • 7. React advantages ● JavaScript superpowers ○ JSX blends well together with JavaScript ○ your components are functions ○ static type checking (TypeScript instead of PropTypes) ● stronger libraries community ○ Redux, Jest + Enzyme, Formik + Yup ○ React / Redux developer tools ● strict unidirectional data flow
  • 8. Migration vs business value Legacy App New App Time Added Value
  • 9. Migration vs business value Legacy App New App Time Added Value ... ......
  • 11. Migration strategies Bottom-up Top-down Embed React components in Angular Usually delays state management layer migration Replace larger chunks, usually URL based Two separate state management layers
  • 12. Martin Fowler’s Strangler Application pattern Transform - create a parallel new view Coexist - leave the existing view for a time, so the functionality is implemented incrementally Eliminate - remove the old functionality as users stop using it Source: https://developer.ibm.com/articles/cl-strangler-application-pattern-microservices-apps-trs/
  • 13. How to apply Strangler Application pattern Identify the Bounded Contexts in your application design - e.g. in an airline application, flight booking would be one Bounded Context, while the airline loyalty program would be a different Bounded Context. Choose the Bounded Context that is the smallest and least costly to refactor Source: https://developer.ibm.com/articles/cl-strangler-application-pattern-microservices-apps-trs/
  • 14. Micro Frontends architecture The idea behind Micro Frontends is to think about a website or web app as a composition of features which are owned by independent teams. Each team has a distinct area of business or mission it cares about and specialises in. A team is cross functional and develops its features end-to-end, from database to user interface. Source: https://micro-frontends.org
  • 17. Who is using Micro Frontends? HelloFresh “At first, we found development speed to be a bit slow. Since this approach requires you to own your entire project E2E, the learning curve can be steep. But after cresting the curve we were able to push out projects like never before; the new HelloFresh shop, for example, took 3 people 4 weeks to roll out. Our developers also claim increased confidence and breadth of knowledge after adopting this approach.” Source: https://engineering.hellofresh.com/front-end-microservices-at-hellofresh-23978a611b87
  • 18. Who is using Micro Frontends? Ikea “Today, we are aware that we should normally not have our whole enterprise in one service, and so we split up the enterprise architecture in smaller services, for example, microservices. However, we are also starting to realize that we have the same problems with the frontend monolith as we had with the backend monolith, Gustaf Nilsson Kotte explained in a recent interview hosted by Stefan Tilkov. Using a micro frontend architecture, he breaks the frontend into smaller parts to allow for teams to deploy autonomously, thus enabling continuous delivery for web frontends.” Source: https://www.infoq.com/news/2018/08/experiences-micro-frontends
  • 19. Micro Frontends architecture - Single SPA framework https://single-spa.js.org
  • 20. Micro Frontends architecture - Single SPA framework https://single-spa.js.org import {declareChildApplication, start} from 'single-spa'; declareChildApplication('navbar', () => import('./navbar/navbar.app.js'), () => true); declareChildApplication('home', () => import('./home/home.app.js'), () => location.pathname === "" || location.pathname === "/"); declareChildApplication('angular', () => import('./angular/angular.app.js'), pathPrefix('/angular')); declareChildApplication('react', () => import('./react/react.app.js'), pathPrefix('/react')); declareChildApplication('vue', () => import('src/vue/vue.app.js'), pathPrefix('/vue')); start();
  • 21. Micro Frontends architecture - Single SPA framework https://single-spa.js.org import React from 'react'; import ReactDOM from 'react-dom'; import singleSpaReact from 'single-spa-react'; import rootComponent from './root.component.js'; const reactLifecycles = singleSpaReact({ React, ReactDOM, rootComponent, domElementGetter: () => document.getElementById('react-app') }); export const bootstrap = [reactLifecycles.bootstrap]; export const mount = [reactLifecycles.mount]; export const unmount = [reactLifecycles.unmount];
  • 22. Summary ● Consider the business value and costs ● Identify the Bounded Contexts in your application ● Make your application more modular, break the Monolith!