|
7 | 7 | * of patent rights can be found in the PATENTS file in the same directory. |
8 | 8 | * |
9 | 9 | * @providesModule ReactPerf |
10 | | - * @flow |
11 | 10 | */ |
12 | 11 |
|
13 | 12 | 'use strict'; |
14 | 13 |
|
15 | | -const { |
16 | | - __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, |
17 | | -} = require('ReactDOM'); |
| 14 | +// There is a cyclical dependency between ReactGK and |
| 15 | +// this module. Add an indirection to delay it. |
| 16 | +// We will remove this anyway. |
18 | 17 |
|
19 | | -module.exports = __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactPerf; |
| 18 | +function getReactPerf() { |
| 19 | + const { |
| 20 | + __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, |
| 21 | + } = require('ReactDOM'); |
| 22 | + return __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactPerf; |
| 23 | +} |
| 24 | + |
| 25 | +const LazyReactPerf = { |
| 26 | + getLastMeasurements(...args) { |
| 27 | + return getReactPerf().getLastMeasurements(...args); |
| 28 | + }, |
| 29 | + getExclusive(...args) { |
| 30 | + return getReactPerf().getExclusive(...args); |
| 31 | + }, |
| 32 | + getInclusive(...args) { |
| 33 | + return getReactPerf().getInclusive(...args); |
| 34 | + }, |
| 35 | + getWasted(...args) { |
| 36 | + return getReactPerf().getWasted(...args); |
| 37 | + }, |
| 38 | + getOperations(...args) { |
| 39 | + return getReactPerf().getOperations(...args); |
| 40 | + }, |
| 41 | + printExclusive(...args) { |
| 42 | + return getReactPerf().printExclusive(...args); |
| 43 | + }, |
| 44 | + printInclusive(...args) { |
| 45 | + return getReactPerf().printInclusive(...args); |
| 46 | + }, |
| 47 | + printWasted(...args) { |
| 48 | + return getReactPerf().printWasted(...args); |
| 49 | + }, |
| 50 | + printOperations(...args) { |
| 51 | + return getReactPerf().printOperations(...args); |
| 52 | + }, |
| 53 | + start() { |
| 54 | + return getReactPerf().start(); |
| 55 | + }, |
| 56 | + stop() { |
| 57 | + return getReactPerf().stop(); |
| 58 | + }, |
| 59 | + isRunning(...args) { |
| 60 | + return getReactPerf().isRunning(...args); |
| 61 | + }, |
| 62 | + printDOM(...args) { |
| 63 | + return getReactPerf().printDOM(...args); |
| 64 | + }, |
| 65 | + getMeasurementsSummaryMap(...args) { |
| 66 | + return getReactPerf().getMeasurementsSummaryMap(...args); |
| 67 | + }, |
| 68 | +}; |
| 69 | + |
| 70 | +module.exports = LazyReactPerf; |
0 commit comments