Skip to content

Ability to directly emit device events on Android/Java side#36279

Closed
rshest wants to merge 1 commit into
facebook:mainfrom
rshest:export-D43534174
Closed

Ability to directly emit device events on Android/Java side#36279
rshest wants to merge 1 commit into
facebook:mainfrom
rshest:export-D43534174

Conversation

@rshest
Copy link
Copy Markdown
Contributor

@rshest rshest commented Feb 24, 2023

Summary:
[Changelog][Internal]

To have a symmetry with the corresponding C++ API for TurboModules, this adds a helper method ReactContext.emitDeviceEvent, which allows to send device events to JS (RCTDeviceEventEmitter.emit).

This also allows for less boilerplate code and better discoverability.

See the next diff in stack for the application.

Reviewed By: NickGerleman

Differential Revision: D43534174

@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 fb-exported labels Feb 24, 2023
@facebook-github-bot
Copy link
Copy Markdown
Contributor

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

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 24, 2023

Fails
🚫

📋 Missing Changelog - Can you add a Changelog? To do so, add a "## Changelog" section to your PR description. A changelog entry has the following format: [CATEGORY] [TYPE] - Message.

DetailsCATEGORY may be:
  • General
  • iOS
  • Android
  • JavaScript
  • Internal (for changes that do not need to be called out in the release notes)

TYPE may be:

  • Added, for new features.
  • Changed, for changes in existing functionality.
  • Deprecated, for soon-to-be removed features.
  • Removed, for now removed features.
  • Fixed, for any bug fixes.
  • Security, in case of vulnerabilities.

MESSAGE may answer "what and why" on a feature level. Use this to briefly tell React Native users about notable changes.

Generated by 🚫 dangerJS against d92d17b

@analysis-bot
Copy link
Copy Markdown

analysis-bot commented Feb 24, 2023

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 8,471,374 -39
android hermes armeabi-v7a 7,793,482 -39
android hermes x86 8,946,798 -46
android hermes x86_64 8,804,069 -60
android jsc arm64-v8a 9,105,297 +29
android jsc armeabi-v7a 8,302,236 +25
android jsc x86 9,155,620 +20
android jsc x86_64 9,414,682 +24

Base commit: febf6b7
Branch: main

@facebook-github-bot
Copy link
Copy Markdown
Contributor

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

…#36279)

Summary:
Pull Request resolved: facebook#36279

[Changelog][Internal]

To have a symmetry with the [corresponding C++ API for TurboModules](https://www.internalfb.com/code/fbsource/[929870c905c8fe68cb330ce96bda7eb703bb6ae6]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModule.h?lines=90), this adds a helper method `ReactContext.emitDeviceEvent`, which allows to send device events to JS (`RCTDeviceEventEmitter.emit`).

This also allows for less boilerplate code and better discoverability.

See the next diff in stack for the application.

## Changelog

[Android][Added] ReactContext now has a method emitDeviceEvent, which can be used to send device events to RCTDeviceEventEmitter on the JavaScript side

Reviewed By: NickGerleman

Differential Revision: D43534174

fbshipit-source-id: 6b0c5b922f91f1e34e85e38f9b4263e15434b5b7
@facebook-github-bot
Copy link
Copy Markdown
Contributor

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

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Feb 27, 2023
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request has been merged in a8f0a4d.

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