Opinions & Insights
Our conversion from Angular to React
Did you notice we switched all our code from Angular to React last week?
*This the first post of 3 part series on how we converted on site to React.
At Netlify we have already noticed a benefit in development time and design collaborations, thanks to React.
// jsx sample
We unveiled our newly converted React UI last week and it went mostly unnoticed by our users, which is ideal.
This is the first time I have personally been on a team that has successful converted towards a new framework and here are steps we took to be successful with that.
1. Don’t Attempt Until Ready
If you are considering converting your code from Angular to React, I recommend you to wait until you are ready to slow down development. Remember — you'll need to convert large amounts of code. This means no further upgrades to features and prioritizing bug fixes until the conversion is complete.
For a few months we rolled out some new features, including Slack Notifications and Deploy Previews, but only on the new React app. We were able to do this because we hid our new React UI behind an subdomain, which allowed us to constantly test out the UI in production without affecting the current user base.
The main thing that helped us during this transition is creating our app with the JAM stack philosophy (no more servers, host all your frontend on a CDN and use APIs for any moving parts). The functionality of our API never changed and allowed us to iterate on the UI while still staying open for business.
2. We Started New
The Netlify API is mature enough that it gave us the ability to start a brand new repo with brand new code.
The idea of updating code inline with your current repo is not ideal, so we avoided that all together. Nothing is scarier than using cutting edge technology while trying figure out bugs in different frameworks and syntaxes.
We were also able to grant access to specific users for testing out the new UI and receive immediate feedback on new changes and features without the worry of sending new bugs to production. This enabled us to really think through some changes and take advantage and change things we really didn’t like in the Angular app (i.e. the new Sign Up flow).
3. Invest in Learning
Set some time to not write code and just learn React. The library is generally small but ecosystem comes with the requirement to learn all, but not limited to Webpack, Mocha, Redux, etc.
Netlify even opted to send some of our developers to ReactJS training. In addtition to training we even hired the author of Pro React during the transition to React. Investing in knowledge helped save us from some new code spaghetti and gave us the confindence to work in a new framework.
So What’s New?
There are some more small changes we will be rolling out in the next few weeks that we are excited to announce, now that we have completed this upgrade.
Netlify is still the same place where you can deploy modern static websites with continuous deployment from a single click. Stay tuned for more posts on more specific new features and how we approached this conversion in code. Though this seems like a near perfect transition, there might be bugs hidden in the walls of our new app. If you see something, say something -- If you find a bug please report it in the platform.
Find out how to convert your Angular Controllers to React Components