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

Add asDynamic to EventPayload #49988

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

rozele
Copy link
Contributor

@rozele rozele commented Mar 12, 2025

Summary:
NativeAnimated currently depends on folly::dynamic event payloads for event-driven animations. While some events (e.g., ScrollEvent.h) have an asDynamic implementation, not all events do. Having the ability to convert an EventPayload to a folly::dynamic defined on the EventPayload implementations precludes generalized event handling in NativeAnimated.

This change moves the asDynamic method from ScrollEvent to the base EventPayload interface, defaulting the implemention to returning a null value.

Changelog

[Internal]

Differential Revision: D71046682

@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 12, 2025
@facebook-github-bot
Copy link
Contributor

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

rozele added a commit to rozele/react-native-macos that referenced this pull request Mar 12, 2025
Summary:

NativeAnimated currently depends on folly::dynamic event payloads for event-driven animations. While some events (e.g., ScrollEvent.h) have an `asDynamic` implementation, not all events do. Having the ability to convert an EventPayload to a folly::dynamic defined on the EventPayload implementations precludes generalized event handling in NativeAnimated.

This change moves the `asDynamic` method from `ScrollEvent` to the base `EventPayload` interface, defaulting the implemention to returning a null value.

## Changelog

[Internal]

Differential Revision: D71046682
@rozele rozele force-pushed the export-D71046682 branch from fc3fa83 to 5166d0a Compare March 12, 2025 17:35
@facebook-github-bot
Copy link
Contributor

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

rozele added a commit to rozele/react-native-macos that referenced this pull request Mar 12, 2025
Summary:
Pull Request resolved: facebook#49988

NativeAnimated currently depends on folly::dynamic event payloads for event-driven animations. While some events (e.g., ScrollEvent.h) have an `asDynamic` implementation, not all events do. Having the ability to convert an EventPayload to a folly::dynamic defined on the EventPayload implementations precludes generalized event handling in NativeAnimated.

This change moves the `asDynamic` method from `ScrollEvent` to the base `EventPayload` interface, defaulting the implemention to returning a null value.

## Changelog

[Internal]

Differential Revision: D71046682
@rozele rozele force-pushed the export-D71046682 branch from 5166d0a to c98edd2 Compare March 12, 2025 17:43
rozele added a commit to rozele/react-native-macos that referenced this pull request Mar 12, 2025
Summary:

NativeAnimated currently depends on folly::dynamic event payloads for event-driven animations. While some events (e.g., ScrollEvent.h) have an `asDynamic` implementation, not all events do. Having the ability to convert an EventPayload to a folly::dynamic defined on the EventPayload implementations precludes generalized event handling in NativeAnimated.

This change moves the `asDynamic` method from `ScrollEvent` to the base `EventPayload` interface, defaulting the implemention to returning a null value.

## Changelog

[Internal]

Differential Revision: D71046682
@rozele rozele force-pushed the export-D71046682 branch from c98edd2 to f6ad12a Compare March 12, 2025 19:25
Summary:
Pull Request resolved: facebook#49988

NativeAnimated currently depends on folly::dynamic event payloads for event-driven animations. While some events (e.g., ScrollEvent.h) have an `asDynamic` implementation, not all events do. Having the ability to convert an EventPayload to a folly::dynamic defined on the EventPayload implementations precludes generalized event handling in NativeAnimated.

This change moves the `asDynamic` method from `ScrollEvent` to the base `EventPayload` interface, defaulting the implemention to returning a null value.

## Changelog

[Internal]

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

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

@rozele rozele force-pushed the export-D71046682 branch from f6ad12a to 22bb968 Compare March 12, 2025 19:29
rozele added a commit to rozele/react-native-macos that referenced this pull request Mar 12, 2025
Summary:

NativeAnimated currently depends on folly::dynamic event payloads for event-driven animations. While some events (e.g., ScrollEvent.h) have an `asDynamic` implementation, not all events do. Having the ability to convert an EventPayload to a folly::dynamic defined on the EventPayload implementations precludes generalized event handling in NativeAnimated.

This change moves the `asDynamic` method from `ScrollEvent` to the base `EventPayload` interface, defaulting the implemention to returning a null value.

## Changelog

[Internal]

Reviewed By: zeyap

Differential Revision: D71046682
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 p: Facebook Partner: Facebook Partner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants