player-ui / player

https://player-ui.github.io
MIT License
71 stars 46 forks source link

[Hermes] JSI JNI #395

Closed sugarmanz closed 1 month ago

sugarmanz commented 3 months ago

Initial groundwork for using the Hermes runtime on the JVM. There are a few parts to this PR:

  1. Configuring Hermes & FBJNI as part of our build
  2. Wrap JSI (JavaScript Interface) constructs through JNI holders
  3. Create Hermes runtime through JNI constructs

What we're aiming for (some slight inaccuracies): https://gist.github.com/sugarmanz/d07d443f24f6eee1db9ac1c7ba1681c1

Some helpful links:

There are several docs around intro to JSI, but they mainly are in the context of React Native. Our paradigm is different, as we aim to extend the JSI to the JVM to enable "direct" (at least through JNI) integration with the native JavaScript Runtime implementations. This way, we can connect it to our existing JS abstraction (Node & Runtime) for use within Player without having to change any of the Player code. This is a realization of the goals for that abstraction piece, and really, I see that abstraction piece as a parallel to the native JSI definition. We'll likely want to converge the two abstractions and maybe even position this as bringing JSI to the JVM.

For diving in, start with the JVM JSI definitions and see how they're used in the tests (relies on HermesRuntime):

Change Type (required)

Indicate the type of change your pull request is:

Does your PR have any documentation updates?