Move BatchedBridge module configuration to InitializeCore

Reviewed By: davidaurelio

Differential Revision: D4599060

fbshipit-source-id: bd0f1f6910f4fd9b68d6a9678fd5e97cdf6be553
This commit is contained in:
Pieter De Baets 2017-02-22 14:54:09 -08:00 committed by Facebook Github Bot
parent a6adc501e8
commit 68135d90a4
2 changed files with 11 additions and 10 deletions

View File

@ -14,16 +14,6 @@
const MessageQueue = require('MessageQueue');
const BatchedBridge = new MessageQueue();
// TODO: Move these around to solve the cycle in a cleaner way.
BatchedBridge.registerCallableModule('Systrace', require('Systrace'));
BatchedBridge.registerCallableModule('JSTimersExecution', require('JSTimersExecution'));
BatchedBridge.registerCallableModule('HeapCapture', require('HeapCapture'));
BatchedBridge.registerCallableModule('SamplingProfiler', require('SamplingProfiler'));
if (__DEV__) {
BatchedBridge.registerCallableModule('HMRClient', require('HMRClient'));
}
// Wire up the batched bridge on the global object so that we can call into it.
// Ideally, this would be the inverse relationship. I.e. the native environment
// provides this global directly with its script embedded. Then this module

View File

@ -104,6 +104,17 @@ Systrace.setEnabled(global.__RCTProfileIsProfiling || false);
const ExceptionsManager = require('ExceptionsManager');
ExceptionsManager.installConsoleErrorReporter();
// TODO: Move these around to solve the cycle in a cleaner way
const BatchedBridge = require('BatchedBridge');
BatchedBridge.registerCallableModule('Systrace', require('Systrace'));
BatchedBridge.registerCallableModule('JSTimersExecution', require('JSTimersExecution'));
BatchedBridge.registerCallableModule('HeapCapture', require('HeapCapture'));
BatchedBridge.registerCallableModule('SamplingProfiler', require('SamplingProfiler'));
if (__DEV__) {
BatchedBridge.registerCallableModule('HMRClient', require('HMRClient'));
}
// RCTLog needs to register with BatchedBridge
require('RCTLog');