Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add Hermes Root API in all other versions of Hermes #51082

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

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

Conversation

tsaichien
Copy link
Contributor

Summary:
Introduces the IHermesRootAPI interface and a class implementation.
This root API will contain the previously static methods on
HermesRuntime.

The root API will serve as an entry point for users to create the Hermes
runtime and invoke methods that do not necessarily require a runtime.

Diff also moves all usages of the static methods on HermesRuntime to
getting the methods from the root API.

Multiple places are depending on Hermes, Hermes snapshot, and Shermes,
so this diff will also update all of these verions of Hermes at once.

Differential Revision: D71132855

tsaichien added 5 commits May 2, 2025 10:54
Summary:

Build JSI with C++17.

Changelog: [Internal]

Reviewed By: dannysu

Differential Revision: D72079417
Summary:

Add UUID struct to JSI. This will be used in the incoming changes, such
as identifying JSI interfaces and storing custom runtime data.

Changelog: [Internal]

Reviewed By: tmikov

Differential Revision: D71826382
Summary:

Add JSI castInterface API. This provides a structured way to provide
optional APIs that may or may not be supported in all engines.

Every interface will have its own set of APIs. For instance, Hermes
will provide an interface (`IHermes`) containing Hermes-specific
APIs. In the future, an interface may be created to expose optional
APIs.

A runtime will inherit the interfaces of which the APIs are supported by
the runtime. Users who want to access a specific API may call
castInterface with the UUID of interface containing the API.

For backwards compatibility, the current `jsi::Runtime` will remain as
an object, and its functionalities will not be described by an
interface. However, this may be revisited later.

Changelog: [Internal]

Reviewed By: tmikov

Differential Revision: D68964360
Summary:
After introducing the interfaces, runtime should be managed through a
shared pointer instead of a unique pointer.

This diff will change the usage in JSI testlib. Later diffs will
actually change the HermesRuntime usages.

Reviewed By: lavenzg

Differential Revision: D70113190
Summary:
Introduces the `IHermesRootAPI` interface and a class implementation.
This root API will contain the previously static methods on
`HermesRuntime`.

The root API will serve as an entry point for users to create the Hermes
runtime and invoke methods that do not necessarily require a runtime.

Diff also moves all usages of the static methods on `HermesRuntime` to
getting the methods from the root API. 

Multiple places are depending on Hermes, Hermes snapshot, and Shermes,
so this diff will also update all of these verions of Hermes at once.

Differential Revision: D71132855
@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner labels May 2, 2025
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D71132855

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported p: Facebook Partner: Facebook Partner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants