-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix JS_RUNTIME_HERMES
flag definition
#6838
base: main
Are you sure you want to change the base?
Conversation
// JS_RUNTIME_HERMES is only set on Android so we have to check __has_include | ||
// on iOS. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's mention in the comment that on Android, JS_RUNTIME_HERMES
is set in CMakeLists.txt. On iOS, there's no simple way to detect if Hermes is enabled or not, so we check the existence of the header file.
#include <jsi/decorator.h> | ||
#include <jsi/jsi.h> | ||
|
||
#include <memory> | ||
#include <string> | ||
#include <utility> | ||
|
||
#if __has_include(<reacthermes/HermesExecutorFactory.h>) | ||
#include <reacthermes/HermesExecutorFactory.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please confirm in which version of RN HermesExecutorFactory.h
file was removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, both files exist, but #include <hermes/hermes.h>
is all we need to use. I've run compatibility tests on CI, and this change appears to be safe (expect one flaky check)
I've also tested it with JSC, and it works properly 👍 |
Summary
This PR streamlines the definition of the
JS_RUNTIME_HERMES
flag. Previously, the flag wasn't consistently defined across all usage points (which prevented the compilation of certain branches of code - for example in WorkletsModuleProxy.cpp), and it also had duplicated definitions. Additionally, I've removed outdated and unnecessary checks from the flag definition.Test plan