React Native 0.64 — Hermes on iOS!
React Native 0.64 was released in March 2021 to the delight of thousands of developers. After the release of React 17 in October 2020, there were high hopes about the next version of React Native. The new release has certainly fulfilled my expectations and brings some exciting new features for the React Native community.
- Hermes on iOS
“Hermes is an open source JavaScript engine optimized for running React Native. It improves performance by decreasing memory utilization, reducing download size and decreasing the time it takes for the app to become usable.”
Previously, Hermes was only available for apps running on Android devices, leaving iOS users with the less efficient JavaScriptCore engine, which powers Safari. With the release of React Native 0.64, app developers can use Hermes to build on iOS as well. To enable Hermes on iOS, set hermes_enabled to true in your Podfile (located in your project’s ios directory) and install pods:
To install pods, open your project’s ios directory in the Terminal and run
pod install
Then rebuild your app to enjoy faster startup times and reduced memory usage!
2. Inline Requires are enabled by default
“Inline Requires is a Metro configuration option that improves startup time by delaying execution of JavaScript modules until they are used, instead of at startup.”
Inline requires has existed and been recommended for a few years as an opt-in configuration option, listed in the Performance section of React Native’s documentation. This option is now enabled by default for new applications to help people have fast React Native applications without extra configuration.
Inline Requires is a Babel transform that takes module imports and converts them to be inline. This delays the requiring of a module or file until that file is actually needed, which can improve performance by only loading modules that are actually used.
3. React 17
React Native has upgraded its React dependency, which does not include new developer-facing features or major breaking changes.
For React Native applications, the main change is a new JSX transform enabling files to no longer need to import React to be able to use JSX. Learn more about how to enable this transform and its benefits in my article “Enable the new JSX Transform in React Native 0.64”.