October 24th, 2024

New Architecture is here

React Native 0.76 introduces a New Architecture as default, enhancing performance with modern features, synchronous communication, and improved rendering. It has been successfully used in major apps like Facebook and Instagram.

Read original articleLink Icon
New Architecture is here

React Native has released version 0.76, which introduces a New Architecture as the default. This update enhances support for modern React features such as Suspense, Transitions, and automatic batching, while also implementing a new Native Module and Native Component system that allows for type-safe code and direct access to native interfaces without the need for a bridge. The New Architecture is a comprehensive rewrite of React Native's core systems, addressing limitations of the previous architecture, particularly in terms of synchronous updates and performance bottlenecks. Key improvements include a new Native Module System that enables synchronous communication between JavaScript and native code, a revamped Renderer that supports multiple threads for rendering updates, and an Event Loop that prioritizes urgent user interactions. The removal of the bridge facilitates faster startup times and better error handling. This architecture has been successfully utilized in production by major applications like Facebook and Instagram. The update aims to provide a smoother migration experience for developers, with many popular libraries already compatible with the New Architecture.

- React Native 0.76 introduces a New Architecture by default, enhancing performance and capabilities.

- The update supports modern React features, including Suspense and Transitions.

- A new Native Module System allows synchronous communication between JavaScript and native code.

- The revamped Renderer supports multiple threads, improving responsiveness and reducing UI jank.

- The New Architecture has been successfully implemented in major applications like Facebook and Instagram.

Related

Understanding React Compiler

Understanding React Compiler

React's core architecture simplifies development but can lead to performance issues. The React team introduced the React Compiler to automate performance tuning by rewriting code. Transpilers like Babel convert JSX for efficiency. Compilers, transpilers, and optimizers analyze and produce equivalent code. React Compiler enhances functionality using Abstract Syntax Trees, memoization, and hook storage for optimized performance.

Enhancing New York Times Web Performance with React 18

Enhancing New York Times Web Performance with React 18

The New York Times upgraded to React 18 for better performance and new features like Concurrent Mode and server-side rendering. Challenges with "embedded interactives" were overcome, leading to improved website performance.

Enhancing the New York Times Web Performance with React 18

Enhancing the New York Times Web Performance with React 18

The New York Times upgraded to React 18 for better performance and new features like Concurrent Mode and server-side rendering. Challenges with interactive content were overcome, resulting in improved site performance.

Migrating Coinbase's 56M Users to React Native: Key Lessons and Takeaways

Migrating Coinbase's 56M Users to React Native: Key Lessons and Takeaways

Coinbase transitioned 56 million users to React Native, addressing performance challenges like re-rendering. Nick Cherry discussed platform-specific optimizations, Farcaster/Warpcast development, React Navigation, Expo benefits, and AI in front-end development. StepChange offers database modernization services.

Next.js 15 and Turbopack Dev (Stable)

Next.js 15 and Turbopack Dev (Stable)

Next.js 15 has been released, featuring stability improvements, breaking changes to caching and Async Request APIs, support for React 19, a new CLI for upgrades, and stable Turbopack Dev.

Link Icon 20 comments
By @mhammerc - 3 months
I have been working for the past four years exclusively on react-native apps and their backend API, from bootstrap to publishing, adding new features every few months and maintaining the apps.

It was a mixed experience. When I migrated to expo two years ago, many problems were solved but not all.

But I still encounters bugs and problems with many common dependencies. It is not uncommon to have bugs on certain Android brands, with the community on github reporting the bug but waiting months for it to be fixed.

iOS is by far better and more stable than Android.

Performance is great on iOS, but less great on Android.

Our apps are animation heavy using react-native-reanimated and react-native-skia. Everything went perfect on iOS but we had to remove some animations or simplify them on Android.

Upgrading your dependencies every four months will probably break something somewhere : deep links stop working, some animations stop working, or maybe it's another dependency from the JS world. Sometime the fix is easy, other time an issue with the regression can be found on Github, other time we have no data.

Overall I'd say react-native is perfectly servicable and is easy to learn for anyone, which is a big plus. I'd recommend react-native because it is easy, have a big JS ecosystem, but I am now on the Flutter side.

By @adolfojp - 3 months
At the time of writing this comment, we've got:

1 person talking about how they wish react native didn't exist

1 person asking about Capacitor

1 person complaining about Expo

1 person saying that they wouldn't use react native and recommending Kotlin Multiplatform instead

1 person complaining about the quality of the discussion (Me)

0 people talking about the new architecture

I still love Hacker News but the discussions are becoming increasingly pointless.

All that's missing is:

1 person complaining about the style in which the article was written

By @serial_dev - 3 months
I'm a Flutter dev since 2018 and I am honestly not sure if Flutter or React Native still make sense in 2024 and onwards.

When they emerged, the mobile development scene was completely different than today.

Today, we have Swift UI and Compose, both are pretty solid. I'm not sure if it's the consensus amongst mobile developers, but I believe that on the mid/long run you will be better off - even if you write things twice. In terms of end user experience, developer experience, and in the business sense, everywhere.

Sure if you have an Flutter / RN app that has years of engineering efforts invested into it, go ahead and continue (duh), but I wouldn't start new apps with them.

By @matlin - 3 months
I've used React Native quite a bit in the past and I gotta say I wish it didn't have to exist at all.

It's often times fine on iOS and then incredibly slow on Android. Hermes is very exciting but still requires many polyfills to make simple NPM packages work. I hope one day, the web (and embedding web apps on mobile) makes React Native fully obsolete.

By @pfraze - 3 months
We use Expo/RN for Bluesky. The way I see it, if it's a separate codebase then it's a separate product. I honestly don't think we could've survived trying to build 3 different apps at once, so when I get hit with one of the warts (and believe me we hit them) it's not hard to shrug it off.

The team has been able to progressively target the different platforms where needed with native modules and TS files targeting the arch. Expo's build plugins have also saved our bacon.

We've been pretty excited for the new architecture. Our early tests show a lot of performance benefits on android, and so far the conversion process has been pretty good.

By @rickhanlonii - 3 months
I helped write this post, so feel free to ask me anything about the New Architecture!
By @theThree - 3 months
I did a performance test last year, rendering thousands of views, and Flutter's rendering speed was 5 times faster than React Native. I wonder if this version will be improved after the update. Interestingly, I used React on the web to render the same number of views, and its speed was much faster than React Native.
By @terandle - 3 months
Seems to be a lot of negativity around RN, and I can understand that if you haven't used it in a while. But these days I have nothing but great things to say about React Native when used with Expo. It's great to want custom bespoke individual native apps for each platform but as a solo dev that just isn't really practical and RN has enabled me to ship things I wouldn't have been able to otherwise. Also that hot reloading react DX is just great in general. And I really want the RN model of using the platforms native controls to win out vs rendering everything to a canvas like Flutter.

Can't wait to try out the new arch when 0.76 lands in expo.

By @cynicalpeace - 3 months
Is Capacitor a viable solution yet? I saw this tweet saying "it just works" for porting a webapp on NextJS: https://x.com/marc_louvion/status/1836023560462360746
By @ramesh31 - 3 months
Is there any sane way of using RN without locking into the Expo ecosystem? Last I checked it was a nightmare dealing with native dependencies otherwise.
By @tcoff91 - 3 months
React native is finally pretty good this year. It still has problems but I feel like it's really starting to pick up momentum.

When react-strict-dom is totally ready for prime time it's going to be a game changer and react native will become an absolute juggernaut.

By @jurmous - 3 months
I have built a React Native app in the past. Nowadays I would go for Kotlin Multiplatform. It is already the primary language on Android and now it is possible to create native binaries on iOS. With Compose multiplatform it also has the ability to also share UI code with a declarative syntax on multiple platforms.

I think React Native was the go to place in the past but it has been surpassed now.

By @ppsreejith - 3 months
This is pretty incredible, kudos to the team! I wonder if there's still an option to call native modules asynchronously (since I'd guess the synchronous native calls block JS execution?)

Also, I remember transferring lots of data through the bridge could be a bottleneck for some use cases. Is that effectively solved with this architecture?

By @e63f67dd-065b - 3 months
I'm not familiar with UI development at all, but I'm kind of amazed that the old solution of a giant async bridge where the renderer enqueued native function calls worked at all. What was the initial reasoning behind this architecture? (that is to say, why did it seem like a good idea at the time?)
By @arijo - 3 months
Guys, help me understand these changes:

Can I comprehend this as a new Virtual Native UI immutable tree running in native space?

And react native mounts and updates basically synchronally updating this immutable tree and reconciliation being done in native space, dynamically updating the app layout?

By @tmitchel2 - 3 months
Love react native, I'll be updating to this version soon. Really hoping it makes suspense work correctly with libs like Relay. Well done and thank you RN team.
By @pixelready - 3 months
It’s looking really good so far. Some known issues in the expo and RN ecosystem are called out under the troubleshooting section here:

https://docs.expo.dev/guides/new-architecture/

By @coldblues - 3 months
I will now inform everyone here that the Windows 11 Start Menu uses React Native. You're welcome :)
By @pbreit - 3 months
Could someone suggest a good CRUD starter kit?
By @slorber - 3 months
Honestly, can we even trust a technology that is not 1.0 ?