mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Move setUpReactDevTools to InitializeCore (#48871)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/48871 # Changelog: [Internal] Forward-fixing D68380665. Requirements: - `setUpReactDevTools` should be called before `setUpErrorHandling` to avoid React DevTools mutating `console.error` call arguments. - `setUpReactDevTools` should be called after `setUpTimers`, because it is using `queueMicrotask`, see https://fb.workplace.com/groups/rn.panelapps/permalink/1120810879540337/. - `setUpTimers` should be called after `polyfillPromise`, because it uses on `global.Promise`. I went over bundles, which are not using `InitializeCore` and using either `setUpErrorHandling` or `setUpDeveloperTools` and updated their order of initialization accordingly. Reviewed By: javache Differential Revision: D68510100 fbshipit-source-id: 4331dcc7a7cb1dc438ca2ed5ccae49e736c41b2a
This commit is contained in:
committed by
Facebook GitHub Bot
parent
c5af75294a
commit
8a586f2fa1
+5
-2
@@ -31,10 +31,13 @@ const start = Date.now();
|
||||
require('./setUpGlobals');
|
||||
require('../../src/private/setup/setUpDOM').default();
|
||||
require('./setUpPerformance');
|
||||
require('./setUpErrorHandling');
|
||||
require('./polyfillPromise');
|
||||
require('./setUpRegeneratorRuntime');
|
||||
require('./setUpTimers');
|
||||
if (__DEV__) {
|
||||
require('./setUpReactDevTools');
|
||||
}
|
||||
require('./setUpErrorHandling');
|
||||
require('./setUpRegeneratorRuntime');
|
||||
require('./setUpXHR');
|
||||
require('./setUpAlert');
|
||||
require('./setUpNavigator');
|
||||
|
||||
@@ -10,11 +10,6 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
if (__DEV__) {
|
||||
// React DevTools need to be set up before the console.error patch.
|
||||
require('./setUpReactDevTools');
|
||||
}
|
||||
|
||||
if (global.RN$useAlwaysAvailableJSErrorHandling !== true) {
|
||||
/**
|
||||
* Sets up the console and exception handling (redbox) for React Native.
|
||||
|
||||
@@ -13,6 +13,22 @@
|
||||
import type {Domain} from '../../src/private/debugging/setUpFuseboxReactDevToolsDispatcher';
|
||||
import type {Spec as NativeReactDevToolsRuntimeSettingsModuleSpec} from '../../src/private/fusebox/specs/NativeReactDevToolsRuntimeSettingsModule';
|
||||
|
||||
if (__DEV__) {
|
||||
if (typeof global.queueMicrotask !== 'function') {
|
||||
console.error(
|
||||
'queueMicrotask should exist before setting up React DevTools.',
|
||||
);
|
||||
}
|
||||
|
||||
// Keep in sync with ExceptionsManager/installConsoleErrorReporter
|
||||
// $FlowExpectedError[prop-missing]
|
||||
if (console._errorOriginal != null) {
|
||||
console.error(
|
||||
'ExceptionsManager should be set up after React DevTools to avoid console.error arguments mutation',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (__DEV__) {
|
||||
// Register dispatcher on global, which can be used later by Chrome DevTools frontend
|
||||
require('../../src/private/debugging/setUpFuseboxReactDevToolsDispatcher');
|
||||
|
||||
Reference in New Issue
Block a user