Skip to content

Conversation

@cipolleschi
Copy link
Contributor

@cipolleschi cipolleschi commented Jan 14, 2026

Summary

This PR syncs JSI with the latest commits that landed on static_h:

Test Plan

GHA

tsaichien and others added 2 commits January 14, 2026 10:52
Summary:
X-link: facebook/react-native#54547

We want to have a proper way of releasing new JSI features, rather than
releasing into JSI as they are added.

To do this, we are adding a new `JSI_UNSTABLE` flag that will gate new
features. Until Hermes releases a new version, all of these "unstable"
features are subject to change. Interfaces may be modified, API behavior
may be changed, etc.

When Hermes release a new version, the new additions will be moved out
of the "unstable" status and become frozen.

This diff adds the `JSI_UNSTABLE` flag to JSI and adds corresponding
changes to the BUCK build. Later diffs will use this gate new APIs.

Changelog: [Internal]

Reviewed By: lavenzg

Differential Revision: D85915163

fbshipit-source-id: b2f754af4bb53db8dfe837e3ea2e2543d691754d
Summary:
`jsi.h` uses types like `uint32_t` but never includes `<cstdint>`.

Changelog: [Internal]

Reviewed By: avp

Differential Revision: D87953504

fbshipit-source-id: 7d10e458ff14b01da293f2714d6a562958f9e8ff
@meta-cla meta-cla bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Jan 14, 2026
@cipolleschi cipolleschi changed the base branch from static_h to 250829098.0.0-stable January 14, 2026 10:54
@cipolleschi cipolleschi marked this pull request as ready for review January 14, 2026 10:56
Summary:
X-link: facebook/react-native#52624

Add a new optional interface `ISerialization` to JSI. This interface
contains four APIs to clone objects from one runtime to another runtime.

Four methods are introduced in this interface:
* `serialize`: Takes in a JS value (represented by `jsi::Value`) and
serialize the value into an opaque `Serialized` object.

* `deserialize`: Takes in the `Serialized` object created by `serialize`
and deserialize it into the runtime, returning the created JS value.

* `serializeWithTransfer`: Takes in a JS value (represented by
`jsi::Value`) and a `transferList` (a `jsi::Array` of `jsi::Value`s).
This will serialize the `value` into an opaque `Serialize` object and
transfer the ownership of everything in `transferList` into the
`Serialized` object. If any non-transferable values is passed into the
transferList, this will throw. This `Serialized` object must only be
deserialized once.

* `deserializeWithTransfer`: Takes in the `Serialized` object created by
`serializeWithTransfer`. It will deserialize the object into the runtime
and  any value owned by the `Serialized` object will now be owned by the
current runtime. It will return an `jsi::Array` where the first value is
the deserialized value passed into `serializeWithTransfer`, followed by
all transferred values.

The lifetime of the `Serialized` object created from the APIs is
independent of the original object and runtime.

Note that objects can only be copied into another runtime instance of
the same type. For example, a serialized object produced by the Hermes
runtime can only be deserialized by another Hermes runtime.

Changelog: [Internal]

Reviewed By: dannysu, fbmal7

Differential Revision: D76547681

fbshipit-source-id: 0c774f3f469c26d3894cac179f4ce5e32cf5ad7f
@cipolleschi cipolleschi merged commit 80149b7 into 250829098.0.0-stable Jan 14, 2026
31 of 32 checks passed
@cipolleschi cipolleschi deleted the cipolleschi/sync-jsi branch January 14, 2026 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Do not delete this pull request or issue due to inactivity.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants