2015-02-20 07:10:52 +03:00
|
|
|
/**
|
2018-09-12 01:27:47 +03:00
|
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
2015-03-23 23:35:08 +03:00
|
|
|
*
|
2018-02-17 05:24:55 +03:00
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
2015-02-20 07:10:52 +03:00
|
|
|
*
|
2018-05-11 05:06:46 +03:00
|
|
|
* @format
|
2016-11-21 04:49:21 +03:00
|
|
|
* @flow
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* globals window: true */
|
|
|
|
|
|
|
|
/**
|
2015-02-20 07:10:52 +03:00
|
|
|
* Sets up global variables typical in most JavaScript environments.
|
|
|
|
*
|
2016-11-21 04:49:21 +03:00
|
|
|
* 1. Global timers (via `setTimeout` etc).
|
|
|
|
* 2. Global console object.
|
|
|
|
* 3. Hooks for printing stack traces with source maps.
|
2015-02-20 07:10:52 +03:00
|
|
|
*
|
|
|
|
* Leaves enough room in the environment for implementing your own:
|
|
|
|
*
|
2016-11-21 04:49:21 +03:00
|
|
|
* 1. Require system.
|
|
|
|
* 2. Bridged modules.
|
|
|
|
*
|
2015-02-20 07:10:52 +03:00
|
|
|
*/
|
2019-10-16 20:03:47 +03:00
|
|
|
|
2016-11-22 18:15:10 +03:00
|
|
|
'use strict';
|
2015-02-20 07:10:52 +03:00
|
|
|
|
2018-11-10 01:10:12 +03:00
|
|
|
const start = Date.now();
|
2018-10-23 02:08:28 +03:00
|
|
|
|
2019-05-08 18:44:25 +03:00
|
|
|
require('./setUpGlobals');
|
|
|
|
require('./setUpSystrace');
|
|
|
|
require('./setUpErrorHandling');
|
|
|
|
require('./polyfillPromise');
|
|
|
|
require('./setUpRegeneratorRuntime');
|
|
|
|
require('./setUpTimers');
|
|
|
|
require('./setUpXHR');
|
|
|
|
require('./setUpAlert');
|
|
|
|
require('./setUpNavigator');
|
|
|
|
require('./setUpBatchedBridge');
|
|
|
|
require('./setUpSegmentFetcher');
|
2016-10-11 16:51:48 +03:00
|
|
|
if (__DEV__) {
|
2019-05-15 03:42:34 +03:00
|
|
|
require('./checkNativeVersion');
|
2019-05-08 18:44:25 +03:00
|
|
|
require('./setUpDeveloperTools');
|
2016-11-02 22:18:17 +03:00
|
|
|
}
|
2018-10-23 02:08:28 +03:00
|
|
|
|
2019-05-08 18:44:25 +03:00
|
|
|
const GlobalPerformanceLogger = require('../Utilities/GlobalPerformanceLogger');
|
2019-03-14 16:45:24 +03:00
|
|
|
// We could just call GlobalPerformanceLogger.markPoint at the top of the file,
|
|
|
|
// but then we'd be excluding the time it took to require the logger.
|
2018-11-10 01:10:12 +03:00
|
|
|
// Instead, we just use Date.now and backdate the timestamp.
|
2019-03-14 16:45:24 +03:00
|
|
|
GlobalPerformanceLogger.markPoint(
|
2018-11-10 01:10:12 +03:00
|
|
|
'initializeCore_start',
|
2019-03-14 16:45:24 +03:00
|
|
|
GlobalPerformanceLogger.currentTimestamp() - (Date.now() - start),
|
2018-11-10 01:10:12 +03:00
|
|
|
);
|
2019-03-14 16:45:24 +03:00
|
|
|
GlobalPerformanceLogger.markPoint('initializeCore_end');
|