ELI5: Metro – JavaScript Bundler for React Native

This blog post examines an open source project called Metro, which acts as a JavaScript bundle for React Native. Our goal is to keep this post short by following the ELI5 style of explaining things in simple terms in the shortest possible time.

If you’d prefer to watch a companion video for Metro, visit our Meta Open Source YouTube channel.

Why Metro?

Metro is a development platform for React Native. This project acts as a JavaScript bundle; It manages assets, caches builds, and performs hot module reloads.

Metro is focused on improving the developer experience for the React Native community. When developers are working on their code, nothing is more frustrating than seeing your app take forever to reload after a change. For this reason, Metro attaches great importance to speed and strives for recharge cycles in the sub-second range, fast commissioning and fast bundling.

Since Metro has been used here at Meta since its inception, scalability and reliability are battle tested on our vast code base. Metro can work efficiently with thousands of modules in a single application.

One of the best quotes to describe a great developer experience is, “If you want people to do something, make it easy for yourself.” Staying true to this statement, Metro by Design supports every React Native project right out of the box. In other words, you don’t have to do any heavy lifting for Metro to work – it’s built in from the start!

Where is it used?

Metro was made open source by Meta in 2017. It was originally part of React Native itself, but was later separated from the project to make it easier for the open source community to report issues and contribute to Metro.

Where can I find out more?

If you want to learn more about Metro, visit their website. Metro has excellent documentation that includes instructions on how to get started, troubleshoot, and configure the project. If you have a question or want to get to know the community behind the project, join the #metro channel on their Discord community.

About the ELI5 series

In a series of short videos (approx. 1 minute long) one of our developer advocates in the Meta Open Source team explains a Meta Open Source project in an easily understandable and applicable way.

For each of these videos we will write an accompanying blog post (like the one you are reading now), which you can find on our YouTube channel.

To learn more about Meta Open Source, visit our open source site, subscribe to our YouTube channel or follow us on Twitter and Facebook.

Interested in working with open source at Meta? Check out our open source related job postings on our careers page by taking this short survey.

Comments are closed.