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

Create option for out-of-tree platforms to customize View traits #38580

Closed
wants to merge 2 commits into from

Conversation

rozele
Copy link
Contributor

@rozele rozele commented Jul 24, 2023

Summary:
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.

Differential Revision: D47721377

@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 24, 2023
@rozele rozele force-pushed the export-D47721377 branch from 7481dcc to a96b92f Compare July 24, 2023 16:25
@facebook-github-bot
Copy link
Contributor

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

rozele added a commit to rozele/react-native-macos that referenced this pull request Jul 25, 2023
…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

Reviewed By: christophpurrer

Differential Revision: D47721377

fbshipit-source-id: 9651860fc3fa2fcbaa508e28836c68f5f6636460
@rozele rozele force-pushed the export-D47721377 branch from a96b92f to 8f8678e Compare July 25, 2023 13:56
@facebook-github-bot
Copy link
Contributor

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

rozele added a commit to rozele/react-native-macos that referenced this pull request Jul 25, 2023
…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

Reviewed By: christophpurrer

Differential Revision: D47721377

fbshipit-source-id: ba6696773a5a6e63df8cd549505a9ae7b8925319
@rozele rozele force-pushed the export-D47721377 branch from 8f8678e to e0e8a34 Compare July 25, 2023 14:01
@facebook-github-bot
Copy link
Contributor

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

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

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

rozele added a commit to rozele/react-native-macos that referenced this pull request Jul 25, 2023
…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

Reviewed By: christophpurrer

Differential Revision: D47721377

fbshipit-source-id: fbdc04b9d012a313dcb3ae23f1a0af5b8c1cdbce
@rozele rozele force-pushed the export-D47721377 branch from e0e8a34 to cf9a2d8 Compare July 25, 2023 14:49
rozele added a commit to rozele/react-native-macos that referenced this pull request Jul 25, 2023
…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

Reviewed By: christophpurrer

Differential Revision: D47721377

fbshipit-source-id: c1727596977743603b9422c68018397af3e24279
@rozele rozele force-pushed the export-D47721377 branch from cf9a2d8 to 6349266 Compare July 25, 2023 15:02
@facebook-github-bot
Copy link
Contributor

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

rozele added a commit to rozele/react-native-macos that referenced this pull request Jul 26, 2023
…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

Reviewed By: christophpurrer

Differential Revision: D47721377

fbshipit-source-id: d00717ad30db1aaef37f55df2b4bcea019980d25
@rozele rozele force-pushed the export-D47721377 branch from 6349266 to 80604d6 Compare July 26, 2023 15:43
@facebook-github-bot
Copy link
Contributor

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

rozele added a commit to rozele/react-native-macos that referenced this pull request Jul 26, 2023
…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

Reviewed By: christophpurrer

Differential Revision: D47721377

fbshipit-source-id: 1eeab5f847fb1813172d0ff0fad4182fcdd2cf21
@rozele rozele force-pushed the export-D47721377 branch from 80604d6 to d694e71 Compare July 26, 2023 15:50
@facebook-github-bot
Copy link
Contributor

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

rozele added a commit to rozele/react-native-macos that referenced this pull request Jul 26, 2023
…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

Reviewed By: christophpurrer

Differential Revision: D47721377

fbshipit-source-id: 258207d9067ab01e11a9143ae76d7e42b262cd26
@rozele rozele force-pushed the export-D47721377 branch from d694e71 to c93b4da Compare July 26, 2023 21:44
@facebook-github-bot
Copy link
Contributor

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

rozele added a commit to rozele/react-native-macos that referenced this pull request Jul 26, 2023
…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

Reviewed By: christophpurrer

Differential Revision: D47721377

fbshipit-source-id: f77fcd3bb2da69444c2167834c4f4f345b53bf91
@rozele rozele force-pushed the export-D47721377 branch from c93b4da to 8bae606 Compare July 26, 2023 21:51
@facebook-github-bot
Copy link
Contributor

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

rozele added a commit to rozele/react-native-macos that referenced this pull request Jul 29, 2023
…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: 29166d917e36472fb527e3e5bad07d9b974e0b95
rozele added a commit to rozele/react-native-macos that referenced this pull request Jul 31, 2023
…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: f6a34517a13e2050bdc38f8552230747c6ceb792
@facebook-github-bot
Copy link
Contributor

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

rozele added a commit to rozele/react-native-macos that referenced this pull request Jul 31, 2023
…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

Reviewed By: christophpurrer

Differential Revision: D47721377

fbshipit-source-id: 60d8c09229c8643210b651012d9dd76fceaa09c0
@rozele rozele force-pushed the export-D47721377 branch from eaac908 to 19dede4 Compare July 31, 2023 15:01
rozele added a commit to rozele/react-native-macos that referenced this pull request Jul 31, 2023
…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: 79689f6760e667eece729a093b3e651aa19790bd
rozele added a commit to rozele/react-native-macos that referenced this pull request Jul 31, 2023
…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: b150be094d33f0c1a89e9252b6e2e887fdf92eed
rozele added a commit to rozele/react-native-macos that referenced this pull request Jul 31, 2023
…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: f3317ed323a93be3e3346109b86a340d4d07753b
rozele added a commit to rozele/react-native-macos that referenced this pull request Jul 31, 2023
…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: 868a1a38d9d32196314a39096342affb5ae4ef85
rozele added a commit to rozele/react-native-macos that referenced this pull request Jul 31, 2023
…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: 4817e07a076f11969f5007149108424e530cf6c0
rozele added a commit to rozele/react-native-macos that referenced this pull request Jul 31, 2023
…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: 7ba77a294e80a50e701e81ec0f971141011975b1
rozele added a commit to rozele/react-native-macos that referenced this pull request Jul 31, 2023
…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: b2025ff01090bb2587f3383189b952c9c34b1bb4
rozele added a commit to rozele/react-native-macos that referenced this pull request Jul 31, 2023
…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: 7d37a16aa7744e5068dbfba4bb0b61af0495149e
rozele added a commit to rozele/react-native-macos that referenced this pull request Jul 31, 2023
…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: 9fde734e019698ed30c3e594dd82e2864c66fdb7
rozele added a commit to rozele/react-native-macos that referenced this pull request Jul 31, 2023
…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: c64d5623c972186a90be3246249fb20b1892410f
rozele added a commit to rozele/react-native-macos that referenced this pull request Jul 31, 2023
…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

Reviewed By: christophpurrer

Differential Revision: D47721377

fbshipit-source-id: 7a389a007d57ebe277227fbfc1d443879edfb2fc
@rozele rozele force-pushed the export-D47721377 branch from 19dede4 to 8806e12 Compare July 31, 2023 17:31
@facebook-github-bot
Copy link
Contributor

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

rozele and others added 2 commits July 31, 2023 11:31
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: 7240d257344a3eb62b7be55ff916a67a8256c796
…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

Reviewed By: christophpurrer

Differential Revision: D47721377

fbshipit-source-id: 5efe5eb4d194f6d229ac77a0478330ddf539f7f8
rozele added a commit to rozele/react-native-macos that referenced this pull request Jul 31, 2023
…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: 02abc51bca3211426b6ad03827ab4b8fc97729b0
rozele added a commit to rozele/react-native-macos that referenced this pull request Jul 31, 2023
…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: 39dab5c7d66617ad5fc922b7f8504dced18ebe4a
rozele added a commit to rozele/react-native-macos that referenced this pull request Jul 31, 2023
…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
rozele added a commit to rozele/react-native-macos that referenced this pull request Jul 31, 2023
…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: 87c7ce5fcfc7dbe3440868c8ed19bffd47c7ebb7
@rozele rozele force-pushed the export-D47721377 branch from 8806e12 to 0561ebe Compare July 31, 2023 18:34
@facebook-github-bot
Copy link
Contributor

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

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

This pull request has been merged in 646c759.

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