-
Notifications
You must be signed in to change notification settings - Fork 24.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ReactPrivate, an explicit interface between the renderer and RN (#24782)
Summary: This introduces a new library named "ReactPrivate" that defines an explicit interface between the React renderers generated by the React repo and the code within RN. Previously, the React renderers would reach into RN internals via Haste wormholes. With this commit, there is now an explicit module (`ReactNativePrivateInterface`) that the renderers use to access RN internals. Motivation: The main goal is to move one step closer to turning off Haste for RN (#24316). Since the generated renderers currently use Haste, this commit sets the foundation for giving them a path-based interface to access RN internals. Additionally, this approach inverts abstraction control since RN needs to intentionally export its internals via the private interface instead of React reaching in via Haste. There will also need to be a corresponding commit to the React repo to make the renderers use this new interface. This RN commit needs to land before the React commit. ## Changelog [General] [Changed] - Add a private interface (do not use) between the renderer and RN Pull Request resolved: #24782 Differential Revision: D15413477 Pulled By: cpojer fbshipit-source-id: 3766ad4cf129fad0c82f0ddc7a485a4ba313b2c4
- Loading branch information
1 parent
3ccfbd6
commit 9cd8825
Showing
12 changed files
with
45 additions
and
127 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,3 +1,2 @@ | ||
/lib/ | ||
/dist/ | ||
/node_modules/ |
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 |
---|---|---|
@@ -1 +1 @@ | ||
JS modules in this folder are forwarding modules to allow React to require React Native internals as node dependencies. | ||
JS modules in this folder are forwarding modules to allow React to require React Native internals. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @format | ||
* @flow strict-local | ||
*/ | ||
|
||
// flowlint unsafe-getters-setters:off | ||
module.exports = { | ||
get BatchedBridge() { | ||
return require('../BatchedBridge/BatchedBridge.js'); | ||
}, | ||
get ExceptionsManager() { | ||
return require('../Core/ExceptionsManager'); | ||
}, | ||
get Platform() { | ||
return require('../Utilities/Platform'); | ||
}, | ||
get RCTEventEmitter() { | ||
return require('../EventEmitter/RCTEventEmitter'); | ||
}, | ||
get ReactNativeViewConfigRegistry() { | ||
return require('../Renderer/shims/ReactNativeViewConfigRegistry'); | ||
}, | ||
get TextInputState() { | ||
return require('../Components/TextInput/TextInputState'); | ||
}, | ||
get UIManager() { | ||
return require('../ReactNative/UIManager'); | ||
}, | ||
get deepDiffer() { | ||
return require('../Utilities/differ/deepDiffer'); | ||
}, | ||
get deepFreezeAndThrowOnMutationInDev() { | ||
return require('../Utilities/deepFreezeAndThrowOnMutationInDev'); | ||
}, | ||
get flattenStyle() { | ||
return require('../StyleSheet/flattenStyle'); | ||
}, | ||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.