The Airbnb Tech Blog

Creative engineers and data scientists building a world where you can belong anywhere. http://airbnb.io

Follow publication

How Airbnb Smoothly Upgrades React

Andre Wiggins
The Airbnb Tech Blog
9 min readJul 23, 2024

Introduction

Challenges of upgrading

Ideal vs Reality graphs of our major and minor versions of React over time.

Designing the React Upgrade System

Simplified diagram of our ideal upgrade system
import React18 from 'react'; 
import React16 from 'react'; // duplicated import?

if (shouldEnableReact18()) {
const root = React18.createRoot(container);
root.render(<App />);
} else {
React16.render(<App />, container);
}

Module aliasing

"react-18": "npm:react@18"

TypeScript discrepancies

Environment targeting

Module aliasing and environment targeting in use together to deploy different versions of the framework together in production

Testing the upgrade

Progressive rollout

Feature adoption and future work

Conclusion

Acknowledgments

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

The Airbnb Tech Blog
The Airbnb Tech Blog

Published in The Airbnb Tech Blog

Creative engineers and data scientists building a world where you can belong anywhere. http://airbnb.io

Andre Wiggins
Andre Wiggins

Responses (9)

Write a response

Will you be sharing the code that powers this React upgrade system? Curious to see if this will work for non-monorepos as well.

Nice read Andre, thanks. I love this kind of web platform work and had to solve a similar issue when I was at Hilton with Node.js and Next.js upgrades.

I previously led the React 18 upgrade effort for the huge codebase of a very reputed FAANG company. Many of us in the community are encountering significant and numerous issues due to the implicit children changes in React v18. Neither codemods nor…