2015-02-19 20:10:52 -08:00
|
|
|
/**
|
2018-09-11 15:27:47 -07:00
|
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
2015-03-23 13:35:08 -07:00
|
|
|
*
|
2018-02-16 18:24:55 -08: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-19 20:10:52 -08:00
|
|
|
*
|
2018-05-10 19:06:46 -07:00
|
|
|
* @format
|
2016-11-20 17:49:21 -08:00
|
|
|
* @flow
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* globals window: true */
|
|
|
|
|
|
|
|
/**
|
2015-02-19 20:10:52 -08:00
|
|
|
* Sets up global variables typical in most JavaScript environments.
|
|
|
|
*
|
2016-11-20 17:49:21 -08:00
|
|
|
* 1. Global timers (via `setTimeout` etc).
|
|
|
|
* 2. Global console object.
|
|
|
|
* 3. Hooks for printing stack traces with source maps.
|
2015-02-19 20:10:52 -08:00
|
|
|
*
|
|
|
|
* Leaves enough room in the environment for implementing your own:
|
|
|
|
*
|
2016-11-20 17:49:21 -08:00
|
|
|
* 1. Require system.
|
|
|
|
* 2. Bridged modules.
|
|
|
|
*
|
2015-02-19 20:10:52 -08:00
|
|
|
*/
|
2016-11-22 07:15:10 -08:00
|
|
|
'use strict';
|
2015-02-19 20:10:52 -08:00
|
|
|
|
2018-11-09 14:10:12 -08:00
|
|
|
const start = Date.now();
|
2018-10-22 16:08:28 -07:00
|
|
|
|
2018-10-28 15:43:29 -07:00
|
|
|
require('setUpGlobals');
|
|
|
|
require('polyfillES6Collections');
|
|
|
|
require('setUpSystrace');
|
|
|
|
require('setUpErrorHandling');
|
|
|
|
require('checkNativeVersion');
|
|
|
|
require('polyfillPromise');
|
|
|
|
require('setUpRegeneratorRuntime');
|
|
|
|
require('setUpTimers');
|
|
|
|
require('setUpXHR');
|
|
|
|
require('setUpAlert');
|
|
|
|
require('setUpGeolocation');
|
|
|
|
require('setUpBatchedBridge');
|
|
|
|
require('setUpSegmentFetcher');
|
2016-10-11 06:51:48 -07:00
|
|
|
if (__DEV__) {
|
2018-10-28 15:43:29 -07:00
|
|
|
require('setUpDeveloperTools');
|
2016-11-02 12:18:17 -07:00
|
|
|
}
|
2018-10-22 16:08:28 -07:00
|
|
|
|
2018-11-09 14:10:12 -08:00
|
|
|
const PerformanceLogger = require('PerformanceLogger');
|
|
|
|
// We could just call PerformanceLogger.markPoint at the top of the file,
|
|
|
|
// but then we'd be excluding the time it took to require PerformanceLogger.
|
|
|
|
// Instead, we just use Date.now and backdate the timestamp.
|
|
|
|
PerformanceLogger.markPoint(
|
|
|
|
'initializeCore_start',
|
|
|
|
PerformanceLogger.currentTimestamp() - (Date.now() - start),
|
|
|
|
);
|
|
|
|
PerformanceLogger.markPoint('initializeCore_end');
|