React-native-reanimated: Support Hermes on iOS

Created on 23 Oct 2020  ·  6Comments  ·  Source: software-mansion/react-native-reanimated

EDIT

I've created a PR for this here: https://github.com/software-mansion/react-native-reanimated/pull/1469 🎉

Description

Since react-native 0.64 will ship with Hermes engine as an opt-in for iOS (see: https://github.com/react-native-community/releases/issues/207), I was wondering if the Hermes engine will be supported by react-native-reanimated v2?

❓Question 🏠 Reanimated2 💡 Feature request

Most helpful comment

Hi @mrousavy – Thanks for bringing this to our attention. From the technical standpoint I don't see why it wouldn't be possible to support hermes on iOS when react-native supports it. Reanimated uses JSI which is a VM-agnostic interface and we already work with hermes on Android. When it comes to supporting two VMs at once there are some restrictions on Android where we need to ship pre-build libraries that are linked with a selected VM, however this is not the case on iOS where Reanimated native code is compiled along with the app.

I will keep this issue open but we definitely won't be looking into this more unless React Native 0.64 RC is published. If you or anyone is willing to test it sooner with RN master we'd be open to merging a patch.

All 6 comments

Hi @mrousavy – Thanks for bringing this to our attention. From the technical standpoint I don't see why it wouldn't be possible to support hermes on iOS when react-native supports it. Reanimated uses JSI which is a VM-agnostic interface and we already work with hermes on Android. When it comes to supporting two VMs at once there are some restrictions on Android where we need to ship pre-build libraries that are linked with a selected VM, however this is not the case on iOS where Reanimated native code is compiled along with the app.

I will keep this issue open but we definitely won't be looking into this more unless React Native 0.64 RC is published. If you or anyone is willing to test it sooner with RN master we'd be open to merging a patch.

@kmagiera I've tested out react-native 0.64-rc.0 and enabled hermes on iOS and everything's working fine! 🎉

There were a few small adjustments I had to make, I've created a PR for those: https://github.com/software-mansion/react-native-reanimated/pull/1469.

Everyone interested, this is how you get 0.64 with hermes on iOS going:

  1. Install rn 0.64 rc0 (npm i react-native@next)
  2. Clean all your caches, Pods/ node_modules, lockfiles
  3. Follow this upgrade helper
  4. Update your Podfile like this:
-  use_react_native!(:path => config[:reactNativePath])
+  use_react_native!(:path => config[:reactNativePath], :hermes_enabled => true)

@mrousavy @kmagiera reanimated 2 doesn't work for me with 0.64-rc1 with or without hermes enabled.

I've not filed any issues since RN is still a RC.

@a-eid what does "doesn't work for me" mean? did you try my fixes? (#1469)

@mrousavy I've not, I'm assuming your fixes are hermes related.
but even without heremes RN doesn't compile, give me a sec I'll upload a screenshot with the error I get, keep in mind that reanimated 1.13.* does work fine.

Screen Shot 2020-11-27 at 11 01 52 AM

Issue validator - update # 1

Hello!
It seems like there are some problems with your issue. Please fix them and wait for the validator to confirm that everything is alright.
Thank you!

Validator encountered the following problems:

  • Section required but not found: motivation(for label 💡 feature request)
Was this page helpful?
0 / 5 - 0 ratings

Related issues

sa8ab picture sa8ab  ·  3Comments

levibuzolic picture levibuzolic  ·  3Comments

ArsalanCsquare picture ArsalanCsquare  ·  3Comments

wasim-abuzaher picture wasim-abuzaher  ·  3Comments

dinhmai74 picture dinhmai74  ·  3Comments