Skip to content
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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

piaskowyk
Copy link
Member

@piaskowyk piaskowyk commented Dec 19, 2024

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

@piaskowyk piaskowyk requested review from tomekzaw and tjzel December 19, 2024 18:03
Comment on lines 3 to 4
// JS_RUNTIME_HERMES is only set on Android so we have to check __has_include
// on iOS.
Copy link
Member

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>
Copy link
Member

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?

Copy link
Member Author

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)

@piaskowyk piaskowyk added the Check compatibility Trigger a time-consuming compatibility check action label Dec 20, 2024
@piaskowyk
Copy link
Member Author

I've also tested it with JSC, and it works properly 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Check compatibility Trigger a time-consuming compatibility check action
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants