PULSEPLAY_DIGITAL_LOGO
Pankaj Verma

Pankaj Verma

Full Stack Developer

September 12, 20222 min read215

All About React Native’s new architecture

/1_FLDFa6irbp-lvYUoQBvWnw.png

In this Blog, we’ll explore the upcoming React Native version and the changes to the React Native architecture.

Hermes as Default engine

Hernes is an open-source JavaScript engine optimised for React Native. Hermes will be the default engine . Hermes  work work on performance. Hermes is javascript engine design for  mobile env focused on startup performance .

Fabric

With the new rendering system, user interactions such as scrolling, gestures etc can be prioritized to be executed synchronously in the main thread or native thread. While other tasks such as API requests will be executed asynchronously.

Turbo Modules

In the current architecture, all the Native Modules used by JavaScript (e.g. Bluetooth, Geo Location, File Storage etc) have to be initialized before the app is opened. This means, even if the user doesn’t require a particular module, it still has to be initialized at start-up.

Turbo Modules are basically an enhancement over these old Native modules. As we have seen in the previous part of this article, now JavaScript will be able to hold reference to these modules, which will allow JS Code to load each module only when it is required. This will significantly improve start-up time for ReactNative apps.

Codegen

All this talk of Turbo Modules and Fabric sounds promising, but JavaScript is a Dynamically typed language, and JSI is written in C++, which is a Statically Typed Language. Consequently, there is a need to ensure smooth communication between the two.

That’s why the new architecture will also include a static type checker called CodeGen.

By using the typed JavaScript as the source of truth CodeGen will define interface elements used by Turbo Modules and Fabric. It will also generate more native code at build time, instead of run time.

What to expect from React Native in the near future?

It is fast, reliable, easy to learn, and continues to get better all the time. Meta is constantly updating the framework to ensure that it remains at the top for cross-platform development

With top brands such as Skype, Instagram, Airbnb, Bloomberg, and Uber all using it for their apps, you know there must be a good reason.