forked from facebook/react
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fabric] Forked ReactNativeInjection for Fabric and avoid RCTEventEmi…
…tter setup in Fabric (facebook#12265)
- Loading branch information
Showing
4 changed files
with
72 additions
and
37 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
23 changes: 23 additions & 0 deletions
23
packages/react-native-renderer/src/ReactFabricInjection.js
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,23 @@ | ||
/** | ||
* Copyright (c) 2015-present, Facebook, Inc. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @flow | ||
*/ | ||
|
||
import './ReactNativeInjectionShared'; | ||
|
||
// TODO: The event emitter registration is interfering with the existing | ||
// ReactNative renderer. So disable it for Fabric for now. | ||
|
||
// import * as ReactNativeEventEmitter from './ReactNativeEventEmitter'; | ||
|
||
// Module provided by RN: | ||
// import RCTEventEmitter from 'RCTEventEmitter'; | ||
|
||
/** | ||
* Register the event emitter with the native bridge | ||
*/ | ||
// RCTEventEmitter.register(ReactNativeEventEmitter); |
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
45 changes: 45 additions & 0 deletions
45
packages/react-native-renderer/src/ReactNativeInjectionShared.js
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,45 @@ | ||
/** | ||
* Copyright (c) 2015-present, Facebook, Inc. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @flow | ||
*/ | ||
|
||
/** | ||
* Make sure essential globals are available and are patched correctly. Please don't remove this | ||
* line. Bundles created by react-packager `require` it before executing any application code. This | ||
* ensures it exists in the dependency graph and can be `require`d. | ||
* TODO: require this in packager, not in React #10932517 | ||
*/ | ||
// Module provided by RN: | ||
import 'InitializeCore'; | ||
|
||
import * as EventPluginHub from 'events/EventPluginHub'; | ||
import * as EventPluginUtils from 'events/EventPluginUtils'; | ||
import ResponderEventPlugin from 'events/ResponderEventPlugin'; | ||
|
||
import ReactNativeBridgeEventPlugin from './ReactNativeBridgeEventPlugin'; | ||
import * as ReactNativeComponentTree from './ReactNativeComponentTree'; | ||
import ReactNativeEventPluginOrder from './ReactNativeEventPluginOrder'; | ||
import ReactNativeGlobalResponderHandler from './ReactNativeGlobalResponderHandler'; | ||
|
||
/** | ||
* Inject module for resolving DOM hierarchy and plugin ordering. | ||
*/ | ||
EventPluginHub.injection.injectEventPluginOrder(ReactNativeEventPluginOrder); | ||
EventPluginUtils.injection.injectComponentTree(ReactNativeComponentTree); | ||
|
||
ResponderEventPlugin.injection.injectGlobalResponderHandler( | ||
ReactNativeGlobalResponderHandler, | ||
); | ||
|
||
/** | ||
* Some important event plugins included by default (without having to require | ||
* them). | ||
*/ | ||
EventPluginHub.injection.injectEventPluginsByName({ | ||
ResponderEventPlugin: ResponderEventPlugin, | ||
ReactNativeBridgeEventPlugin: ReactNativeBridgeEventPlugin, | ||
}); |