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

TurboModule::emitDeviceEvent doesn't require jsi::Runtime argument anymore #43376

Closed
wants to merge 2 commits into from

Conversation

rshest
Copy link
Contributor

@rshest rshest commented Mar 7, 2024

Summary:

Changelog:

[Internal] -

Make it possible to call emitDeviceEvent from C++ TurboModules without the need to explicitly provide the reference to jsi::Runtime, as in some contexts (when we call e.g. not from the JS thread itself) it may be hard to get hold of.

Differential Revision: D54643903

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 7, 2024
@facebook-github-bot
Copy link
Contributor

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

@rshest rshest force-pushed the export-D54643903 branch from 5e27f7d to d1a84f3 Compare March 7, 2024 22:50
rshest added a commit to rshest/react-native that referenced this pull request Mar 7, 2024
…ymore (facebook#43376)

Summary:

## Changelog:
[Internal] - 

Make it possible to call `emitDeviceEvent` from C++ TurboModules without the need to explicitly provide the reference to `jsi::Runtime`, as in some contexts (when we call e.g. not from the JS thread itself) it may be hard to get hold of.

Reviewed By: rubennorte

Differential Revision: D54643903
@facebook-github-bot
Copy link
Contributor

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

rshest added a commit to rshest/react-native that referenced this pull request Mar 7, 2024
…ymore (facebook#43376)

Summary:

## Changelog:
[Internal] - 

Make it possible to call `emitDeviceEvent` from C++ TurboModules without the need to explicitly provide the reference to `jsi::Runtime`, as in some contexts (when we call e.g. not from the JS thread itself) it may be hard to get hold of.

Reviewed By: rubennorte

Differential Revision: D54643903
@rshest rshest force-pushed the export-D54643903 branch from d1a84f3 to e09de40 Compare March 7, 2024 23:15
@facebook-github-bot
Copy link
Contributor

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

rshest added a commit to rshest/react-native that referenced this pull request Mar 7, 2024
…ymore (facebook#43376)

Summary:

## Changelog:
[Internal] - 

Make it possible to call `emitDeviceEvent` from C++ TurboModules without the need to explicitly provide the reference to `jsi::Runtime`, as in some contexts (when we call e.g. not from the JS thread itself) it may be hard to get hold of.

Reviewed By: rubennorte

Differential Revision: D54643903
@rshest rshest force-pushed the export-D54643903 branch from e09de40 to 377ac76 Compare March 7, 2024 23:16
@facebook-github-bot
Copy link
Contributor

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

rshest added a commit to rshest/react-native that referenced this pull request Mar 7, 2024
…ymore (facebook#43376)

Summary:

## Changelog:
[Internal] - 

Make it possible to call `emitDeviceEvent` from C++ TurboModules without the need to explicitly provide the reference to `jsi::Runtime`, as in some contexts (when we call e.g. not from the JS thread itself) it may be hard to get hold of.

Reviewed By: rubennorte

Differential Revision: D54643903
@rshest rshest force-pushed the export-D54643903 branch from 377ac76 to afbb015 Compare March 7, 2024 23:18
@facebook-github-bot
Copy link
Contributor

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

rshest added a commit to rshest/react-native that referenced this pull request Mar 7, 2024
…ymore (facebook#43376)

Summary:

## Changelog:
[Internal] - 

Make it possible to call `emitDeviceEvent` from C++ TurboModules without the need to explicitly provide the reference to `jsi::Runtime`, as in some contexts (when we call e.g. not from the JS thread itself) it may be hard to get hold of.

Reviewed By: rubennorte

Differential Revision: D54643903
@rshest rshest force-pushed the export-D54643903 branch from afbb015 to 9cc751d Compare March 7, 2024 23:33
@facebook-github-bot
Copy link
Contributor

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

@rshest rshest force-pushed the export-D54643903 branch from 9cc751d to e56ec03 Compare March 8, 2024 00:11
rshest added a commit to rshest/react-native that referenced this pull request Mar 8, 2024
…ymore (facebook#43376)

Summary:

## Changelog:
[Internal] - 

Make it possible to call `emitDeviceEvent` from C++ TurboModules without the need to explicitly provide the reference to `jsi::Runtime`, as in some contexts (when we call e.g. not from the JS thread itself) it may be hard to get hold of.

Reviewed By: rubennorte

Differential Revision: D54643903
@facebook-github-bot
Copy link
Contributor

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

@rshest rshest force-pushed the export-D54643903 branch from e56ec03 to 7d6593b Compare March 8, 2024 00:11
rshest added a commit to rshest/react-native that referenced this pull request Mar 8, 2024
…ymore (facebook#43376)

Summary:

## Changelog:
[Internal] - 

Make it possible to call `emitDeviceEvent` from C++ TurboModules without the need to explicitly provide the reference to `jsi::Runtime`, as in some contexts (when we call e.g. not from the JS thread itself) it may be hard to get hold of.

Reviewed By: rubennorte

Differential Revision: D54643903
@facebook-github-bot
Copy link
Contributor

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

@analysis-bot
Copy link

analysis-bot commented Mar 8, 2024

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 18,032,980 +20,465
android hermes armeabi-v7a n/a --
android hermes x86 n/a --
android hermes x86_64 n/a --
android jsc arm64-v8a 21,391,510 +20,477
android jsc armeabi-v7a n/a --
android jsc x86 n/a --
android jsc x86_64 n/a --

Base commit: 9b1c486
Branch: main

rshest added a commit to rshest/react-native that referenced this pull request Mar 8, 2024
…ymore (facebook#43376)

Summary:

## Changelog:
[Internal] - 

Make it possible to call `emitDeviceEvent` from C++ TurboModules without the need to explicitly provide the reference to `jsi::Runtime`, as in some contexts (when we call e.g. not from the JS thread itself) it may be hard to get hold of.

Reviewed By: rubennorte

Differential Revision: D54643903
@rshest rshest force-pushed the export-D54643903 branch from 7d6593b to aad41bd Compare March 8, 2024 01:58
@facebook-github-bot
Copy link
Contributor

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

rshest added a commit to rshest/react-native that referenced this pull request Mar 8, 2024
…ymore (facebook#43376)

Summary:

## Changelog:
[Internal] - 

Make it possible to call `emitDeviceEvent` from C++ TurboModules without the need to explicitly provide the reference to `jsi::Runtime`, as in some contexts (when we call e.g. not from the JS thread itself) it may be hard to get hold of.

Reviewed By: rubennorte

Differential Revision: D54643903
@rshest rshest force-pushed the export-D54643903 branch from aad41bd to ab9b65e Compare March 8, 2024 02:20
@facebook-github-bot
Copy link
Contributor

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

rshest added a commit to rshest/react-native that referenced this pull request Mar 8, 2024
…ymore (facebook#43376)

Summary:

## Changelog:
[Internal] - 

Make it possible to call `emitDeviceEvent` from C++ TurboModules without the need to explicitly provide the reference to `jsi::Runtime`, as in some contexts (when we call e.g. not from the JS thread itself) it may be hard to get hold of.

Reviewed By: rubennorte

Differential Revision: D54643903
@rshest rshest force-pushed the export-D54643903 branch from ab9b65e to 6fa7c75 Compare March 8, 2024 02:20
@facebook-github-bot
Copy link
Contributor

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

rshest added 2 commits March 7, 2024 18:23
…book#43375)

Summary:

## Changelog:
[Internal] -

As discussed with the team, it makes more sense to pass the reference to the correct `jsi::Runtime` object as an argument to the ` CallInvoker::invoke*` callbacks, that are provided by the user.

There are various use cases when user would like to get a hold of the `jsi::Runtime` in the callback, and it makes sense, since it is guaranteed to run on the JS thread.

So far people have been coming up with all kinds of workarounds for that, none of them safe enough.

Reviewed By: rubennorte

Differential Revision: D54643171
…ymore (facebook#43376)

Summary:

## Changelog:
[Internal] - 

Make it possible to call `emitDeviceEvent` from C++ TurboModules without the need to explicitly provide the reference to `jsi::Runtime`, as in some contexts (when we call e.g. not from the JS thread itself) it may be hard to get hold of.

Reviewed By: rubennorte

Differential Revision: D54643903
@rshest rshest force-pushed the export-D54643903 branch from 6fa7c75 to 2c88b99 Compare March 8, 2024 02:23
@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 6c28c87.

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Mar 8, 2024
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 Merged This PR has been merged. p: Facebook Partner: Facebook Partner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants