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
|
|
|
*/
|
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
|
|
|
|
2018-10-29 01:43:29 +03: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 16:51:48 +03:00
|
|
|
if (__DEV__) {
|
2018-10-29 01:43:29 +03:00
|
|
|
require('setUpDeveloperTools');
|
2016-11-02 22:18:17 +03:00
|
|
|
}
|
2018-10-23 02:08:28 +03:00
|
|
|
|
2018-11-10 01:10:12 +03: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');
|