-
Notifications
You must be signed in to change notification settings - Fork 25.1k
Add ISerialization interface #52624
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
Add ISerialization interface #52624
Conversation
|
This pull request was exported from Phabricator. Differential Revision: D76547681 |
239efbf to
198848b
Compare
|
This pull request was exported from Phabricator. Differential Revision: D76547681 |
Summary: Changelog: [Internal] Add a new optional interface `ISerialization` to JSI. This interface contains two APIs to copy objects from one runtime to another runtime. Two methods are introduced in this interface: `serialize` will take in some JS value (represented by `jsi::Value`) and serialize the object into an opaque `Serialize` object. The lifetime of the serialized object is independent from the original object. `deserialize` will take in the serialized object and deserialize it into the runtime, returning the created JS object. 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. Reviewed By: dannysu Differential Revision: D76547681
198848b to
badac84
Compare
Summary: Changelog: [Internal] Add a new optional interface `ISerialization` to JSI. This interface contains two APIs to copy objects from one runtime to another runtime. Two methods are introduced in this interface: `serialize` will take in some JS value (represented by `jsi::Value`) and serialize the object into an opaque `Serialize` object. The lifetime of the serialized object is independent from the original object. `deserialize` will take in the serialized object and deserialize it into the runtime, returning the created JS object. 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. Reviewed By: dannysu Differential Revision: D76547681
|
This pull request was exported from Phabricator. Differential Revision: D76547681 |
Summary: Pull Request resolved: facebook#52624 Changelog: [Internal] Add a new optional interface `ISerialization` to JSI. This interface contains two APIs to copy objects from one runtime to another runtime. Two methods are introduced in this interface: `serialize` will take in some JS value (represented by `jsi::Value`) and serialize the object into an opaque `Serialize` object. The lifetime of the serialized object is independent from the original object. `deserialize` will take in the serialized object and deserialize it into the runtime, returning the created JS object. 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. Reviewed By: dannysu Differential Revision: D76547681
f68955f to
ce8550d
Compare
Summary: Changelog: [Internal] Add a new optional interface `ISerialization` to JSI. This interface contains two APIs to copy objects from one runtime to another runtime. Two methods are introduced in this interface: `serialize` will take in some JS value (represented by `jsi::Value`) and serialize the object into an opaque `Serialize` object. The lifetime of the serialized object is independent from the original object. `deserialize` will take in the serialized object and deserialize it into the runtime, returning the created JS object. 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. Reviewed By: dannysu Differential Revision: D76547681
|
This pull request was exported from Phabricator. Differential Revision: D76547681 |
Summary: Pull Request resolved: facebook#52624 Changelog: [Internal] Add a new optional interface `ISerialization` to JSI. This interface contains two APIs to copy objects from one runtime to another runtime. Two methods are introduced in this interface: `serialize` will take in some JS value (represented by `jsi::Value`) and serialize the object into an opaque `Serialize` object. The lifetime of the serialized object is independent from the original object. `deserialize` will take in the serialized object and deserialize it into the runtime, returning the created JS object. 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. Reviewed By: dannysu Differential Revision: D76547681
ce8550d to
2eb5ad8
Compare
2eb5ad8 to
8357357
Compare
Summary: Changelog: [Internal] Add a new optional interface `ISerialization` to JSI. This interface contains two APIs to copy objects from one runtime to another runtime. Two methods are introduced in this interface: `serialize` will take in some JS value (represented by `jsi::Value`) and serialize the object into an opaque `Serialize` object. The lifetime of the serialized object is independent from the original object. `deserialize` will take in the serialized object and deserialize it into the runtime, returning the created JS object. 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. Reviewed By: dannysu Differential Revision: D76547681
|
This pull request was exported from Phabricator. Differential Revision: D76547681 |
Summary: Pull Request resolved: facebook#52624 Changelog: [Internal] Add a new optional interface `ISerialization` to JSI. This interface contains two APIs to copy objects from one runtime to another runtime. Two methods are introduced in this interface: `serialize` will take in some JS value (represented by `jsi::Value`) and serialize the object into an opaque `Serialize` object. The lifetime of the serialized object is independent from the original object. `deserialize` will take in the serialized object and deserialize it into the runtime, returning the created JS object. 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. Reviewed By: dannysu Differential Revision: D76547681
860b9cb to
1637df1
Compare
Summary: Changelog: [Internal] Add a new optional interface `ISerialization` to JSI. This interface contains two APIs to copy objects from one runtime to another runtime. Two methods are introduced in this interface: `serialize` will take in some JS value (represented by `jsi::Value`) and serialize the object into an opaque `Serialize` object. The lifetime of the serialized object is independent from the original object. `deserialize` will take in the serialized object and deserialize it into the runtime, returning the created JS object. 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. Reviewed By: dannysu Differential Revision: D76547681
|
This pull request was exported from Phabricator. Differential Revision: D76547681 |
Summary: Pull Request resolved: facebook#52624 Changelog: [Internal] Add a new optional interface `ISerialization` to JSI. This interface contains two APIs to copy objects from one runtime to another runtime. Two methods are introduced in this interface: `serialize` will take in some JS value (represented by `jsi::Value`) and serialize the object into an opaque `Serialize` object. The lifetime of the serialized object is independent from the original object. `deserialize` will take in the serialized object and deserialize it into the runtime, returning the created JS object. 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. Reviewed By: dannysu Differential Revision: D76547681
c00656b to
df2a36b
Compare
Summary: Changelog: [Internal] Add a new optional interface `ISerialization` to JSI. This interface contains two APIs to copy objects from one runtime to another runtime. Two methods are introduced in this interface: `serialize` will take in some JS value (represented by `jsi::Value`) and serialize the object into an opaque `Serialize` object. The lifetime of the serialized object is independent from the original object. `deserialize` will take in the serialized object and deserialize it into the runtime, returning the created JS object. 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. Reviewed By: dannysu Differential Revision: D76547681
d2c3645 to
6ddb2c1
Compare
|
@tsaichien has exported this pull request. If you are a Meta employee, you can view the originating diff in D76547681. |
6ddb2c1 to
2bc8ea7
Compare
|
@tsaichien has exported this pull request. If you are a Meta employee, you can view the originating diff in D76547681. |
Summary: Changelog: [Internal] Add a new optional interface `ISerialization` to JSI. This interface contains two APIs to copy objects from one runtime to another runtime. Two methods are introduced in this interface: `serialize` will take in some JS value (represented by `jsi::Value`) and serialize the object into an opaque `Serialize` object. The lifetime of the serialized object is independent from the original object. `deserialize` will take in the serialized object and deserialize it into the runtime, returning the created JS object. 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. Reviewed By: dannysu Differential Revision: D76547681
2bc8ea7 to
953c31a
Compare
Summary: Changelog: [Internal] Add a new optional interface `ISerialization` to JSI. This interface contains two APIs to copy objects from one runtime to another runtime. Two methods are introduced in this interface: `serialize` will take in some JS value (represented by `jsi::Value`) and serialize the object into an opaque `Serialize` object. The lifetime of the serialized object is independent from the original object. `deserialize` will take in the serialized object and deserialize it into the runtime, returning the created JS object. 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. Reviewed By: dannysu Differential Revision: D76547681
|
@tsaichien has exported this pull request. If you are a Meta employee, you can view the originating Diff in D76547681. |
953c31a to
9095137
Compare
Summary: Changelog: [Internal] Add a new optional interface `ISerialization` to JSI. This interface contains two APIs to copy objects from one runtime to another runtime. Two methods are introduced in this interface: `serialize` will take in some JS value (represented by `jsi::Value`) and serialize the object into an opaque `Serialize` object. The lifetime of the serialized object is independent from the original object. `deserialize` will take in the serialized object and deserialize it into the runtime, returning the created JS object. 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. Reviewed By: dannysu Differential Revision: D76547681
9095137 to
264f966
Compare
Summary: Changelog: [Internal] Add a new optional interface `ISerialization` to JSI. This interface contains two APIs to copy objects from one runtime to another runtime. Two methods are introduced in this interface: `serialize` will take in some JS value (represented by `jsi::Value`) and serialize the object into an opaque `Serialize` object. The lifetime of the serialized object is independent from the original object. `deserialize` will take in the serialized object and deserialize it into the runtime, returning the created JS object. 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. Reviewed By: dannysu Differential Revision: D76547681
264f966 to
0867d8b
Compare
Summary: Changelog: [Internal] Add a new optional interface `ISerialization` to JSI. This interface contains two APIs to copy objects from one runtime to another runtime. Two methods are introduced in this interface: `serialize` will take in some JS value (represented by `jsi::Value`) and serialize the object into an opaque `Serialize` object. The lifetime of the serialized object is independent from the original object. `deserialize` will take in the serialized object and deserialize it into the runtime, returning the created JS object. 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. Reviewed By: dannysu Differential Revision: D76547681
0867d8b to
bbc75eb
Compare
Summary: Changelog: [Internal] Add a new optional interface `ISerialization` to JSI. This interface contains two APIs to copy objects from one runtime to another runtime. Two methods are introduced in this interface: `serialize` will take in some JS value (represented by `jsi::Value`) and serialize the object into an opaque `Serialize` object. The lifetime of the serialized object is independent from the original object. `deserialize` will take in the serialized object and deserialize it into the runtime, returning the created JS object. 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. Reviewed By: dannysu, fbmal7 Differential Revision: D76547681
Summary: Changelog: [Internal] 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. Reviewed By: dannysu, fbmal7 Differential Revision: D76547681
bbc75eb to
a657212
Compare
Summary: Changelog: [Internal] 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. Reviewed By: dannysu, fbmal7 Differential Revision: D76547681
a657212 to
0fa1e44
Compare
|
This pull request has been merged in 257f036. |
|
This pull request was successfully merged by @tsaichien in 257f036 When will my fix make it into a release? | How to file a pick request? |
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
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
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
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
Summary:
Add a new optional interface
ISerializationto JSI. This interfacecontains two APIs to copy objects from one runtime to another runtime.
Two methods are introduced in this interface:
serializewill take in some JS value (represented byjsi::Value) andserialize the object into an opaque
Serializeobject. The lifetime ofthe serialized object is independent from the original object.
deserializewill take in the serialized object and deserialize it intothe runtime, returning the created JS object.
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.
Differential Revision: D76547681