2016-03-25 06:40:52 +08:00
|
|
|
/**
|
|
|
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
|
|
|
*
|
2017-09-25 04:48:13 +08:00
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
2016-03-25 06:40:52 +08:00
|
|
|
*
|
|
|
|
|
* @flow
|
|
|
|
|
*/
|
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 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.
|
2016-05-03 23:46:51 +08:00
|
|
|
* TODO: require this in packager, not in React #10932517
|
2016-03-25 06:40:52 +08:00
|
|
|
*/
|
2017-10-25 07:55:00 +08:00
|
|
|
// Module provided by RN:
|
2016-12-13 03:23:25 +08:00
|
|
|
require('InitializeCore');
|
2016-03-25 06:40:52 +08:00
|
|
|
|
2017-10-25 07:55:00 +08:00
|
|
|
var EventPluginHub = require('events/EventPluginHub');
|
|
|
|
|
var EventPluginUtils = require('events/EventPluginUtils');
|
2017-10-26 02:07:54 +08:00
|
|
|
var ResponderEventPlugin = require('events/ResponderEventPlugin');
|
2017-10-25 07:55:00 +08:00
|
|
|
// Module provided by RN:
|
2016-05-03 23:46:51 +08:00
|
|
|
var RCTEventEmitter = require('RCTEventEmitter');
|
2017-10-26 02:07:54 +08:00
|
|
|
|
2017-10-25 07:55:00 +08:00
|
|
|
var ReactNativeBridgeEventPlugin = require('./ReactNativeBridgeEventPlugin');
|
|
|
|
|
var ReactNativeComponentTree = require('./ReactNativeComponentTree');
|
|
|
|
|
var ReactNativeEventEmitter = require('./ReactNativeEventEmitter');
|
|
|
|
|
var ReactNativeEventPluginOrder = require('./ReactNativeEventPluginOrder');
|
|
|
|
|
var ReactNativeGlobalResponderHandler = require('./ReactNativeGlobalResponderHandler');
|
2016-03-25 06:40:52 +08:00
|
|
|
|
2017-07-14 03:44:52 +08:00
|
|
|
/**
|
|
|
|
|
* Register the event emitter with the native bridge
|
|
|
|
|
*/
|
|
|
|
|
RCTEventEmitter.register(ReactNativeEventEmitter);
|
2016-03-25 06:40:52 +08:00
|
|
|
|
2017-07-14 03:44:52 +08:00
|
|
|
/**
|
|
|
|
|
* Inject module for resolving DOM hierarchy and plugin ordering.
|
|
|
|
|
*/
|
|
|
|
|
EventPluginHub.injection.injectEventPluginOrder(ReactNativeEventPluginOrder);
|
|
|
|
|
EventPluginUtils.injection.injectComponentTree(ReactNativeComponentTree);
|
2016-03-25 06:40:52 +08:00
|
|
|
|
2017-07-14 03:44:52 +08:00
|
|
|
ResponderEventPlugin.injection.injectGlobalResponderHandler(
|
|
|
|
|
ReactNativeGlobalResponderHandler,
|
|
|
|
|
);
|
2016-03-25 06:40:52 +08:00
|
|
|
|
2017-07-14 03:44:52 +08:00
|
|
|
/**
|
|
|
|
|
* Some important event plugins included by default (without having to require
|
|
|
|
|
* them).
|
|
|
|
|
*/
|
|
|
|
|
EventPluginHub.injection.injectEventPluginsByName({
|
|
|
|
|
ResponderEventPlugin: ResponderEventPlugin,
|
|
|
|
|
ReactNativeBridgeEventPlugin: ReactNativeBridgeEventPlugin,
|
|
|
|
|
});
|