-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More consistent platform for out-of-tree platform extensions
Summary: This change consolidates the pattern for setting up out-of-tree platform options for core classes like ViewProps and ViewEventEmitter. A similar pattern was used for Touch.h. As we move towards documenting how to build an out-of-tree platform, it would be nice to specify a set of HostPlatformX classes that need to be implemented and made resolvable from specific header paths. At this point, there is: - HostPlatformViewProps - HostPlatformViewEventEmitter - HostPlatformTouch - HostPlatformColor The other benefit of this pattern is to DRY helper aliases like SharedViewEventEmitter and SharedViewProps. ## Changelog: [General] [Added] - Use more consistent pattern for out-of-tree platform Fabric C++ class extensions Differential Revision: D47917598 fbshipit-source-id: 0281a859d2758a0ad4a554016dfcb717108d3dc8
- Loading branch information
1 parent
87c5963
commit 6092ce1
Showing
7 changed files
with
45 additions
and
21 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
packages/react-native/ReactCommon/react/renderer/components/view/ViewEventEmitter.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <react/renderer/components/view/HostPlatformViewEventEmitter.h> | ||
|
||
namespace facebook::react { | ||
using ViewEventEmitter = HostPlatformViewEventEmitter; | ||
using SharedViewEventEmitter = std::shared_ptr<const ViewEventEmitter>; | ||
} // namespace facebook::react |
15 changes: 15 additions & 0 deletions
15
packages/react-native/ReactCommon/react/renderer/components/view/ViewProps.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <react/renderer/components/view/HostPlatformViewProps.h> | ||
|
||
namespace facebook::react { | ||
using ViewProps = HostPlatformViewProps; | ||
using SharedViewProps = std::shared_ptr<ViewProps const>; | ||
} // namespace facebook::react |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters