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

Allow out-of-tree platforms to extend Touch fields #38681

Closed
wants to merge 5 commits into from

Conversation

rozele
Copy link
Contributor

@rozele rozele commented Jul 29, 2023

Summary:
Desktop platforms send additional information with onTouch(Start|Move|End|Cancel) events, including modifier keys and mouse button information.

This information has not historically been available for mobile platforms, so rather than blindly adding the fields, this change adds a hook for out-of-tree platforms to extend the data in nativeEvent payload for Fabric Touch events.

Changelog:

[General] [Added] - Support customization of underlying Touch event representation in out-of-tree platforms

Differential Revision: D47896016

@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 Jul 29, 2023
@facebook-github-bot
Copy link
Contributor

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

1 similar comment
@facebook-github-bot
Copy link
Contributor

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

rozele added a commit to rozele/react-native-macos that referenced this pull request Jul 29, 2023
Summary:
Pull Request resolved: facebook#38681

Desktop platforms send additional information with onTouch(Start|Move|End|Cancel) events, including modifier keys and mouse button information.

This information has not historically been available for mobile platforms, so rather than blindly adding the fields, this change adds a hook for out-of-tree platforms to extend the data in nativeEvent payload for Fabric Touch events.

## Changelog:
[General] [Added] - Support customization of underlying Touch event representation in out-of-tree platforms

Differential Revision: D47896016

fbshipit-source-id: d282b739817f9477d0997a6865bea692e1713687
@rozele rozele force-pushed the export-D47896016 branch from 2ac2a6f to 4ec6a04 Compare July 29, 2023 12:35
@analysis-bot
Copy link

analysis-bot commented Jul 29, 2023

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 8,889,900 +4,449
android hermes armeabi-v7a 7,937,919 +2,119
android hermes x86 9,287,524 +5,555
android hermes x86_64 9,189,192 +3,733
android jsc arm64-v8a 9,477,902 +4,449
android jsc armeabi-v7a 8,418,925 +2,116
android jsc x86 9,461,759 +5,563
android jsc x86_64 9,776,146 +3,737

Base commit: 8bcfc49
Branch: main

rozele added a commit to rozele/react-native-macos that referenced this pull request Jul 31, 2023
Summary:
Pull Request resolved: facebook#38681

Desktop platforms send additional information with onTouch(Start|Move|End|Cancel) events, including modifier keys and mouse button information.

This information has not historically been available for mobile platforms, so rather than blindly adding the fields, this change adds a hook for out-of-tree platforms to extend the data in nativeEvent payload for Fabric Touch events.

## Changelog:
[General] [Added] - Support customization of underlying Touch event representation in out-of-tree platforms

Differential Revision: https://internalfb.com/D47896016

fbshipit-source-id: 536c3447715b987f95d377140977c0e4fa81b32c
@rozele rozele force-pushed the export-D47896016 branch from 4ec6a04 to d469a0f Compare July 31, 2023 15:02
rozele added a commit to rozele/react-native-macos that referenced this pull request Jul 31, 2023
Summary:
Pull Request resolved: facebook#38681

Desktop platforms send additional information with onTouch(Start|Move|End|Cancel) events, including modifier keys and mouse button information.

This information has not historically been available for mobile platforms, so rather than blindly adding the fields, this change adds a hook for out-of-tree platforms to extend the data in nativeEvent payload for Fabric Touch events.

## Changelog:
[General] [Added] - Support customization of underlying Touch event representation in out-of-tree platforms

Reviewed By: christophpurrer

Differential Revision: D47896016

fbshipit-source-id: 1e40f1f633387d368c5f642290b192174d53551a
@facebook-github-bot
Copy link
Contributor

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

rozele added a commit to rozele/react-native-macos that referenced this pull request Jul 31, 2023
Summary:
Pull Request resolved: facebook#38681

Desktop platforms send additional information with onTouch(Start|Move|End|Cancel) events, including modifier keys and mouse button information.

This information has not historically been available for mobile platforms, so rather than blindly adding the fields, this change adds a hook for out-of-tree platforms to extend the data in nativeEvent payload for Fabric Touch events.

## Changelog:
[General] [Added] - Support customization of underlying Touch event representation in out-of-tree platforms

Differential Revision: https://internalfb.com/D47896016

fbshipit-source-id: 8dff33a5c3dfb7fada432853ac00462cdbd29e5a
rozele added a commit to rozele/react-native-macos that referenced this pull request Jul 31, 2023
Summary:
Pull Request resolved: facebook#38681

Desktop platforms send additional information with onTouch(Start|Move|End|Cancel) events, including modifier keys and mouse button information.

This information has not historically been available for mobile platforms, so rather than blindly adding the fields, this change adds a hook for out-of-tree platforms to extend the data in nativeEvent payload for Fabric Touch events.

## Changelog:
[General] [Added] - Support customization of underlying Touch event representation in out-of-tree platforms

Differential Revision: https://internalfb.com/D47896016

fbshipit-source-id: 3cb0dcbbe033a7ebbe8e7598e4398de2f57f1e04
@facebook-github-bot
Copy link
Contributor

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

rozele added a commit to rozele/react-native-macos that referenced this pull request Jul 31, 2023
Summary:
Pull Request resolved: facebook#38681

Desktop platforms send additional information with onTouch(Start|Move|End|Cancel) events, including modifier keys and mouse button information.

This information has not historically been available for mobile platforms, so rather than blindly adding the fields, this change adds a hook for out-of-tree platforms to extend the data in nativeEvent payload for Fabric Touch events.

## Changelog:
[General] [Added] - Support customization of underlying Touch event representation in out-of-tree platforms

Reviewed By: christophpurrer

Differential Revision: D47896016

fbshipit-source-id: 60c70c9f758ba332b230672a41dbe3731c6086d4
@rozele rozele force-pushed the export-D47896016 branch from d469a0f to 72e8c88 Compare July 31, 2023 17:16
rozele added a commit to rozele/react-native-macos that referenced this pull request Jul 31, 2023
Summary:
Pull Request resolved: facebook#38681

Desktop platforms send additional information with onTouch(Start|Move|End|Cancel) events, including modifier keys and mouse button information.

This information has not historically been available for mobile platforms, so rather than blindly adding the fields, this change adds a hook for out-of-tree platforms to extend the data in nativeEvent payload for Fabric Touch events.

## Changelog:
[General] [Added] - Support customization of underlying Touch event representation in out-of-tree platforms

Differential Revision: https://internalfb.com/D47896016

fbshipit-source-id: 5d7248d683c68420438b2a7584cd688559ec6f6a
rozele and others added 5 commits July 31, 2023 11:30
Summary:
Pull Request resolved: facebook#38549

Out of tree platforms may need different implementations of ViewProps. In fact, Android does already with props like `needsOffscreenAlphaCompositing` and `focusable`. This diff is not opinionated on whether these props should actually be shared on all platforms. Props like `focusable` may be a good candidate for generalizing to all platforms. However, there will always be a need for one platform to experiment with a new prop while it's not available yet on another, especially when considering out of tree platforms.

This diff moves the existing ViewProps class to BaseViewProps, aliases ViewProps as BaseViewProps for iOS for now, and moves Android-specific view props to it's own header and implementation.

## Changelog:
[General] [Added] - Support additional View props in out of tree platform Fabric implementations

Differential Revision: https://internalfb.com/D47492635

fbshipit-source-id: 3ac7f51c367457388d3e6375a20617e0fde1f998
…ebook#38580)

Summary:
Pull Request resolved: facebook#38580

We already have a differential between Android and iOS View props that force view flattening (or unflattening) behaviors. Other out-of-tree platforms may have a need to customize view flattening behaviors.

This change adds a ViewTraitsInitializer header that out of tree platforms can inject to include platform-specific ViewProps fields when considering view flattening behaviors.

## Changelog:
[General] [Added] - Support customization of View traits for flattening in out of tree platform Fabric implementations

Differential Revision: https://internalfb.com/D47721377

fbshipit-source-id: 5806c9629daa2ec361dc51cf694cdabea43d7bb9
…facebook#38582)

Summary:
Pull Request resolved: facebook#38582

Some out of tree platforms may have extra events (e.g., events for different input modalities) that don't exist on other platforms.

For example, react-native-windows and react-native-macos have `onKeyUp` and `onKeyDown` that can be emitted from any native component.

This change provides a hook for out of platforms to customize which events can be emitted from all native components.

## Changelog:
[General] [Added] - Support additional View events in out of tree platform Fabric implementations

Differential Revision: https://internalfb.com/D47721603

fbshipit-source-id: 32b54722ea3c9d6ac13a8341d9bbbd1e2e24c462
Summary:
Pull Request resolved: facebook#38668

On other platforms (e.g., react-native-windows), it's possible that platform colors may not be efficiently represented as int32_t values. In the case of react-native-windows, Color can either be an ARGB value or a list of fallback strings for platform colors.

This change should decouple how platforms represent color values, allowing them to manage how they are used at the point they are used.

## Changelog:
[General] [Added] - Support customization of underlying Color representation in out-of-tree platforms

Differential Revision: https://internalfb.com/D47873465

fbshipit-source-id: 817e43df1042db5fcf84e9f30965972b7f250d8a
Summary:
Pull Request resolved: facebook#38681

Desktop platforms send additional information with onTouch(Start|Move|End|Cancel) events, including modifier keys and mouse button information.

This information has not historically been available for mobile platforms, so rather than blindly adding the fields, this change adds a hook for out-of-tree platforms to extend the data in nativeEvent payload for Fabric Touch events.

## Changelog:
[General] [Added] - Support customization of underlying Touch event representation in out-of-tree platforms

Reviewed By: christophpurrer

Differential Revision: D47896016

fbshipit-source-id: 86ed93f90160392dc45865b4224b4179b31a3618
@rozele rozele force-pushed the export-D47896016 branch from 72e8c88 to 6e4c527 Compare July 31, 2023 18:34
@facebook-github-bot
Copy link
Contributor

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

rozele added a commit to rozele/react-native-macos that referenced this pull request Jul 31, 2023
Summary:
Pull Request resolved: facebook#38681

Desktop platforms send additional information with onTouch(Start|Move|End|Cancel) events, including modifier keys and mouse button information.

This information has not historically been available for mobile platforms, so rather than blindly adding the fields, this change adds a hook for out-of-tree platforms to extend the data in nativeEvent payload for Fabric Touch events.

## Changelog:
[General] [Added] - Support customization of underlying Touch event representation in out-of-tree platforms

Differential Revision: https://internalfb.com/D47896016

fbshipit-source-id: 263f49548927b37307f822950ac01591ef96418a
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 4884322.

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Jul 31, 2023
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