Updated event subscriptions and getters to use new ProfilerStore
Brian Vaughn committed
May 22, 2019 at 07:40 UTC
99b6a44beb5b10a517c4af93e2e5b5ea07ed86e9
17 files changed
+91
-156
src/__tests__/profilerStore-test.js
+2
-2
@@ -34,14 +34,14 @@ describe('ProfilerStore', () => {
34
ReactDOM.render(<Parent key="B" count={2} />, containerB);
35
});
36
37
- utils.act(() => store.startProfiling());
37
+ utils.act(() => store.profilerStore.startProfiling());
38
39
utils.act(() => {
40
ReactDOM.render(<Parent key="A" count={4} />, containerA);
41
ReactDOM.render(<Parent key="B" count={1} />, containerB);
42
});
43
44
- utils.act(() => store.stopProfiling());
44
+ utils.act(() => store.profilerStore.stopProfiling());
45
46
const rootA = store.roots[0];
47
const rootB = store.roots[1];
src/__tests__/profilingCache-test.js
+18
-16
@@ -51,11 +51,11 @@ describe('ProfilingCache', () => {
51
const container = document.createElement('div');
52
53
utils.act(() => ReactDOM.render(<Parent count={2} />, container));
54
- utils.act(() => store.startProfiling());
54
+ utils.act(() => store.profilerStore.startProfiling());
55
utils.act(() => ReactDOM.render(<Parent count={3} />, container));
56
utils.act(() => ReactDOM.render(<Parent count={1} />, container));
57
utils.act(() => ReactDOM.render(<Parent count={0} />, container));
58
- utils.act(() => store.stopProfiling());
58
+ utils.act(() => store.profilerStore.stopProfiling());
59
60
let profilingDataForRoot = null;
61
@@ -120,12 +120,12 @@ describe('ProfilingCache', () => {
120
121
const container = document.createElement('div');
122
123
- utils.act(() => store.startProfiling());
123
+ utils.act(() => store.profilerStore.startProfiling());
124
utils.act(() => ReactDOM.render(<Parent count={2} />, container));
125
utils.act(() => ReactDOM.render(<Parent count={3} />, container));
126
utils.act(() => ReactDOM.render(<Parent count={1} />, container));
127
utils.act(() => ReactDOM.render(<Parent count={0} />, container));
128
- utils.act(() => store.stopProfiling());
128
+ utils.act(() => store.profilerStore.stopProfiling());
129
130
const allCommitData = [];
131
@@ -200,11 +200,11 @@ describe('ProfilingCache', () => {
200
return null;
201
};
202
203
- utils.act(() => store.startProfiling());
203
+ utils.act(() => store.profilerStore.startProfiling());
204
utils.act(() =>
205
ReactDOM.render(<Grandparent />, document.createElement('div'))
206
);
207
- utils.act(() => store.stopProfiling());
207
+ utils.act(() => store.profilerStore.stopProfiling());
208
209
let commitData = null;
210
@@ -262,11 +262,11 @@ describe('ProfilingCache', () => {
262
return data;
263
};
264
265
- utils.act(() => store.startProfiling());
265
+ utils.act(() => store.profilerStore.startProfiling());
266
await utils.actAsync(() =>
267
ReactDOM.render(<Parent />, document.createElement('div'))
268
);
269
- utils.act(() => store.stopProfiling());
269
+ utils.act(() => store.profilerStore.stopProfiling());
270
271
const allCommitData = [];
272
@@ -317,16 +317,16 @@ describe('ProfilingCache', () => {
317
318
const container = document.createElement('div');
319
320
- utils.act(() => store.startProfiling());
320
+ utils.act(() => store.profilerStore.startProfiling());
321
utils.act(() => ReactDOM.render(<Parent count={1} />, container));
322
utils.act(() => ReactDOM.render(<Parent count={2} />, container));
323
utils.act(() => ReactDOM.render(<Parent count={3} />, container));
324
- utils.act(() => store.stopProfiling());
324
+ utils.act(() => store.profilerStore.stopProfiling());
325
326
const allFiberCommits = [];
327
328
function Suspender({ fiberID, previousFiberCommits, rootID }) {
329
- const fiberCommits = store.profilingCache.getFiberCommits({
329
+ const fiberCommits = store.profilerStore.profilingCache.getFiberCommits({
330
fiberID,
331
rootID,
332
});
@@ -407,7 +407,7 @@ describe('ProfilingCache', () => {
407
408
const container = document.createElement('div');
409
410
- utils.act(() => store.startProfiling());
410
+ utils.act(() => store.profilerStore.startProfiling());
411
utils.act(() =>
412
SchedulerTracing.unstable_trace(
413
'mount: one child',
@@ -422,14 +422,16 @@ describe('ProfilingCache', () => {
422
() => ReactDOM.render(<Parent count={2} />, container)
423
)
424
);
425
- utils.act(() => store.stopProfiling());
425
+ utils.act(() => store.profilerStore.stopProfiling());
426
427
let interactions = null;
428
429
function Suspender({ previousInteractions, rootID }) {
430
- interactions = store.profilingCache.getInteractionsChartData({
431
- rootID,
432
- }).interactions;
430
+ interactions = store.profilerStore.profilingCache.getInteractionsChartData(
431
+ {
432
+ rootID,
433
+ }
434
+ ).interactions;
435
if (previousInteractions != null) {
436
expect(interactions).toEqual(previousInteractions);
437
} else {
src/__tests__/profilingCharts-test.js
+27
-21
@@ -47,7 +47,7 @@ describe('profiling charts', () => {
47
48
const container = document.createElement('div');
49
50
- utils.act(() => store.startProfiling());
50
+ utils.act(() => store.profilerStore.startProfiling());
51
utils.act(() =>
52
SchedulerTracing.unstable_trace('mount', Scheduler.unstable_now(), () =>
53
ReactDOM.render(<Parent />, container)
@@ -60,20 +60,22 @@ describe('profiling charts', () => {
60
() => ReactDOM.render(<Parent />, container)
61
)
62
);
63
- utils.act(() => store.stopProfiling());
63
+ utils.act(() => store.profilerStore.stopProfiling());
64
65
let renderFinished = false;
66
67
function Suspender({ commitIndex, rootID }) {
68
- const commitTree = store.profilingCache.getCommitTree({
68
+ const commitTree = store.profilerStore.profilingCache.getCommitTree({
69
commitIndex,
70
rootID,
71
});
72
- const chartData = store.profilingCache.getFlamegraphChartData({
73
- commitIndex,
74
- commitTree,
75
- rootID,
76
- });
72
+ const chartData = store.profilerStore.profilingCache.getFlamegraphChartData(
73
+ {
74
+ commitIndex,
75
+ commitTree,
76
+ rootID,
77
+ }
78
+ );
79
expect(commitTree).toMatchSnapshot(`${commitIndex}: CommitTree`);
80
expect(chartData).toMatchSnapshot(
81
`${commitIndex}: FlamegraphChartData`
@@ -127,7 +129,7 @@ describe('profiling charts', () => {
129
130
const container = document.createElement('div');
131
130
- utils.act(() => store.startProfiling());
132
+ utils.act(() => store.profilerStore.startProfiling());
133
utils.act(() =>
134
SchedulerTracing.unstable_trace('mount', Scheduler.unstable_now(), () =>
135
ReactDOM.render(<Parent />, container)
@@ -140,20 +142,22 @@ describe('profiling charts', () => {
142
() => ReactDOM.render(<Parent />, container)
143
)
144
);
143
- utils.act(() => store.stopProfiling());
145
+ utils.act(() => store.profilerStore.stopProfiling());
146
147
let renderFinished = false;
148
149
function Suspender({ commitIndex, rootID }) {
148
- const commitTree = store.profilingCache.getCommitTree({
150
+ const commitTree = store.profilerStore.profilingCache.getCommitTree({
151
commitIndex,
152
rootID,
153
});
152
- const chartData = store.profilingCache.getRankedChartData({
153
- commitIndex,
154
- commitTree,
155
- rootID,
156
- });
154
+ const chartData = store.profilerStore.profilingCache.getRankedChartData(
155
+ {
156
+ commitIndex,
157
+ commitTree,
158
+ rootID,
159
+ }
160
+ );
161
expect(commitTree).toMatchSnapshot(`${commitIndex}: CommitTree`);
162
expect(chartData).toMatchSnapshot(`${commitIndex}: RankedChartData`);
163
renderFinished = true;
@@ -203,7 +207,7 @@ describe('profiling charts', () => {
207
208
const container = document.createElement('div');
209
206
- utils.act(() => store.startProfiling());
210
+ utils.act(() => store.profilerStore.startProfiling());
211
utils.act(() =>
212
SchedulerTracing.unstable_trace('mount', Scheduler.unstable_now(), () =>
213
ReactDOM.render(<Parent />, container)
@@ -216,14 +220,16 @@ describe('profiling charts', () => {
220
() => ReactDOM.render(<Parent />, container)
221
)
222
);
219
- utils.act(() => store.stopProfiling());
223
+ utils.act(() => store.profilerStore.stopProfiling());
224
225
let renderFinished = false;
226
227
function Suspender({ commitIndex, rootID }) {
224
- const chartData = store.profilingCache.getInteractionsChartData({
225
- rootID,
226
- });
228
+ const chartData = store.profilerStore.profilingCache.getInteractionsChartData(
229
+ {
230
+ rootID,
231
+ }
232
+ );
233
expect(chartData).toMatchSnapshot('Interactions');
234
renderFinished = true;
235
return null;
src/__tests__/profilingCommitTreeBuilder-test.js
+3
-3
@@ -38,17 +38,17 @@ describe('commit tree', () => {
38
39
const container = document.createElement('div');
40
41
- utils.act(() => store.startProfiling());
41
+ utils.act(() => store.profilerStore.startProfiling());
42
utils.act(() => ReactDOM.render(<Parent count={1} />, container));
43
utils.act(() => ReactDOM.render(<Parent count={3} />, container));
44
utils.act(() => ReactDOM.render(<Parent count={2} />, container));
45
utils.act(() => ReactDOM.render(<Parent count={0} />, container));
46
- utils.act(() => store.stopProfiling());
46
+ utils.act(() => store.profilerStore.stopProfiling());
47
48
let renderFinished = false;
49
50
function Suspender({ commitIndex, rootID }) {
51
- const commitTree = store.profilingCache.getCommitTree({
51
+ const commitTree = store.profilerStore.profilingCache.getCommitTree({
52
commitIndex,
53
rootID,
54
});
src/__tests__/storeComponentFilters-test.js
+4
-2
@@ -1,11 +1,13 @@
1
// @flow
2
3
+import type Store from 'src/devtools/store';
4
+
5
describe('Store component filters', () => {
6
let React;
7
let ReactDOM;
8
let TestUtils;
9
let Types;
8
- let store;
10
+ let store: Store;
11
let utils;
12
13
const act = (callback: Function) => {
@@ -28,7 +30,7 @@ describe('Store component filters', () => {
30
});
31
32
it('should throw if filters are updated while profiling', () => {
31
- act(() => store.startProfiling());
33
+ act(() => store.profilerStore.startProfiling());
34
expect(() => (store.componentFilters = [])).toThrow(
35
'Cannot modify filter preferences while profiling'
36
);
src/devtools/ProfilerStore.js
+4
-29
@@ -114,10 +114,6 @@ export default class ProfilerStore extends EventEmitter {
114
throw Error(`Could not find commit data for root "${rootID}"`);
115
}
116
117
- get cache(): ProfilingCache {
118
- return this._cache;
119
- }
120
-
117
// Profiling data has been recorded for at least one root.
118
get hasProfilingData(): boolean {
119
return (
@@ -125,21 +121,6 @@ export default class ProfilerStore extends EventEmitter {
121
);
122
}
123
128
- // TODO (profarc) Remove this getter
129
- get initialSnapshotsByRootID(): Map<number, Map<number, SnapshotNode>> {
130
- return this._initialSnapshotsByRootID;
131
- }
132
-
133
- // TODO (profarc) Remove this getter
134
- get inProgressOperationsByRootID(): Map<number, Array<Uint32Array>> {
135
- return this._inProgressOperationsByRootID;
136
- }
137
-
138
- // TODO (profarc) Remove this getter
139
- get inProgressScreenshotsByRootID(): Map<number, Map<number, string>> {
140
- return this._inProgressScreenshotsByRootID;
141
- }
142
-
124
get isProcessingData(): boolean {
125
return this._rendererQueue.size > 0 || this._dataBackends.length > 0;
126
}
@@ -148,6 +129,10 @@ export default class ProfilerStore extends EventEmitter {
129
return this._isProfiling;
130
}
131
132
+ get profilingCache(): ProfilingCache {
133
+ return this._cache;
134
+ }
135
+
136
get profilingData(): ProfilingDataFrontend | null {
137
return this._dataFrontend;
138
}
@@ -159,8 +144,6 @@ export default class ProfilerStore extends EventEmitter {
144
this._inProgressScreenshotsByRootID.clear();
145
this._cache.invalidate();
146
162
- // TODO (profarc) Remove subscriptions to Store for this
163
- this._store.emit('profilingData');
147
this.emit('profilingData');
148
}
149
@@ -175,8 +158,6 @@ export default class ProfilerStore extends EventEmitter {
158
// Note that we clear now because any existing data is "stale".
159
this._cache.invalidate();
160
178
- // TODO (profarc) Remove subscriptions to Store for this
179
- this._store.emit('isProfiling');
161
this.emit('isProfiling');
162
}
163
@@ -282,8 +263,6 @@ export default class ProfilerStore extends EventEmitter {
263
264
this._dataBackends.splice(0);
265
285
- // TODO (profarc) Remove subscriptions to Store for this
286
- this._store.emit('isProcessingData');
266
this.emit('isProcessingData');
267
}
268
};
@@ -320,8 +299,6 @@ export default class ProfilerStore extends EventEmitter {
299
// (That would have resolved a now-stale value without any profiling data.)
300
this._cache.invalidate();
301
323
- // TODO (profarc) Remove subscriptions to Store for this
324
- this._store.emit('isProfiling');
302
this.emit('isProfiling');
303
304
// If we've just finished a profiling session, we need to fetch data stored in each renderer interface
@@ -339,8 +316,6 @@ export default class ProfilerStore extends EventEmitter {
316
}
317
}
318
342
- // TODO (profarc) Remove subscriptions to Store for this
343
- this._store.emit('isProcessingData');
319
this.emit('isProcessingData');
320
}
321
}
src/devtools/store.js
-63
@@ -15,15 +15,10 @@ import {
15
utfDecodeString,
16
} from '../utils';
17
import { __DEBUG__ } from '../constants';
18
-import ProfilingCache from './ProfilingCache';
18
import { printStore } from 'src/__tests__/storeSerializer';
19
import ProfilerStore from './ProfilerStore';
20
21
import type { Element } from './views/Components/types';
23
-import type {
24
- ProfilingDataFrontend,
25
- SnapshotNode,
26
-} from './views/Profiler/types';
22
import type { Bridge, ComponentFilter, ElementType } from '../types';
23
24
const debug = (methodName, ...args) => {
@@ -236,53 +231,10 @@ export default class Store extends EventEmitter {
231
return this._hasOwnerMetadata;
232
}
233
239
- // TODO (profarc) Update views to use ProfilerStore directly to access this value.
240
- get hasProfilingData(): boolean {
241
- return this._profilerStore.hasProfilingData;
242
- }
243
-
244
- // TODO (profarc) Update views to use ProfilerStore directly to access this value.
245
- get isProcessingProfilingData(): boolean {
246
- return this._profilerStore.isProcessingData;
247
- }
248
-
249
- // TODO (profarc) Update views to use ProfilerStore directly to access this value.
250
- get isProfiling(): boolean {
251
- return this._profilerStore.isProfiling;
252
- }
253
-
234
get numElements(): number {
235
return this._weightAcrossRoots;
236
}
237
258
- // TODO (profarc) Update views to use ProfilerStore directly to access this value.
259
- get profilingCache(): ProfilingCache {
260
- return this._profilerStore.cache;
261
- }
262
-
263
- // TODO (profarc) Update views to use ProfilerStore directly to access this value.
264
- get profilingData(): ProfilingDataFrontend | null {
265
- return this._profilerStore.profilingData;
266
- }
267
- set profilingData(value: ProfilingDataFrontend | null): void {
268
- this._profilerStore.profilingData = value;
269
- }
270
-
271
- // TODO (profarc) Update views to use ProfilerStore directly to access this value.
272
- get profilingOperationsByRootID(): Map<number, Array<Uint32Array>> {
273
- return this._profilerStore.inProgressOperationsByRootID;
274
- }
275
-
276
- // TODO (profarc) Update views to use ProfilerStore directly to access this value.
277
- get profilingScreenshotsByRootID(): Map<number, Map<number, string>> {
278
- return this._profilerStore.inProgressScreenshotsByRootID;
279
- }
280
-
281
- // TODO (profarc) Update views to use ProfilerStore directly to access this value.
282
- get profilingSnapshotsByRootID(): Map<number, Map<number, SnapshotNode>> {
283
- return this._profilerStore.initialSnapshotsByRootID;
284
- }
285
-
238
get profilerStore(): ProfilerStore {
239
return this._profilerStore;
240
}
@@ -311,11 +263,6 @@ export default class Store extends EventEmitter {
263
return this._supportsReloadAndProfile;
264
}
265
314
- // TODO (profarc) Update views to use ProfilerStore directly to access this method.
315
- clearProfilingData(): void {
316
- this._profilerStore.clear();
317
- }
318
-
266
containsElement(id: number): boolean {
267
return this._idToElement.get(id) != null;
268
}
@@ -541,16 +488,6 @@ export default class Store extends EventEmitter {
488
return false;
489
}
490
544
- // TODO (profarc) Update views to use ProfilerStore directly to access this method.
545
- startProfiling(): void {
546
- this._profilerStore.startProfiling();
547
- }
548
-
549
- // TODO (profarc) Update views to use ProfilerStore directly to access this method.
550
- stopProfiling(): void {
551
- this._profilerStore.stopProfiling();
552
- }
553
-
491
// TODO Maybe split this into two methods: expand() and collapse()
492
toggleIsCollapsed(id: number, isCollapsed: boolean): void {
493
let didMutate = false;
src/devtools/views/Components/ComponentFiltersModal.js
+5
-4
@@ -41,6 +41,7 @@ import type {
41
42
export default function ComponentFiltersModalWrapper(_: {||}) {
43
const store = useContext(StoreContext);
44
+ const { profilerStore } = store;
45
46
const { isModalShowing, setIsModalShowing } = useContext(
47
ComponentFiltersModalContext
@@ -50,13 +51,13 @@ export default function ComponentFiltersModalWrapper(_: {||}) {
51
// If necessary, we could support this- but it doesn't seem like a necessary use case.
52
const isProfilingSubscription = useMemo(
53
() => ({
53
- getCurrentValue: () => store.isProfiling,
54
+ getCurrentValue: () => profilerStore.isProfiling,
55
subscribe: (callback: Function) => {
55
- store.addListener('isProfiling', callback);
56
- return () => store.removeListener('isProfiling', callback);
56
+ profilerStore.addListener('isProfiling', callback);
57
+ return () => profilerStore.removeListener('isProfiling', callback);
58
},
59
}),
59
- [store]
60
+ [profilerStore]
61
);
62
const isProfiling = useSubscription<boolean, Store>(isProfilingSubscription);
63
if (isProfiling && isModalShowing) {
src/devtools/views/Components/ToggleComponentFiltersModalButton.js
+5
-4
@@ -14,6 +14,7 @@ import type { ComponentFilter } from 'src/types';
14
15
export default function ToggleComponentFiltersModalButton() {
16
const store = useContext(StoreContext);
17
+ const { profilerStore } = store;
18
19
const { isModalShowing, setIsModalShowing } = useContext(
20
ComponentFiltersModalContext
@@ -23,13 +24,13 @@ export default function ToggleComponentFiltersModalButton() {
24
// If necessary, we could support this- but it doesn't seem like a necessary use case.
25
const isProfilingSubscription = useMemo(
26
() => ({
26
- getCurrentValue: () => store.isProfiling,
27
+ getCurrentValue: () => profilerStore.isProfiling,
28
subscribe: (callback: Function) => {
28
- store.addListener('isProfiling', callback);
29
- return () => store.removeListener('isProfiling', callback);
29
+ profilerStore.addListener('isProfiling', callback);
30
+ return () => profilerStore.removeListener('isProfiling', callback);
31
},
32
}),
32
- [store]
33
+ [profilerStore]
34
);
35
const isProfiling = useSubscription<boolean, Store>(isProfilingSubscription);
36
src/devtools/views/Profiler/ClearProfilingDataButton.js
+4
-3
@@ -8,13 +8,14 @@ import { StoreContext } from '../context';
8
9
export default function ClearProfilingDataButton() {
10
const store = useContext(StoreContext);
11
- const { isProfiling } = useContext(ProfilerContext);
11
+ const { hasProfilingData, isProfiling } = useContext(ProfilerContext);
12
+ const { profilerStore } = store;
13
13
- const clear = useCallback(() => store.clearProfilingData(), [store]);
14
+ const clear = useCallback(() => profilerStore.clear(), [profilerStore]);
15
16
return (
17
<Button
17
- disabled={isProfiling || !store.hasProfilingData}
18
+ disabled={isProfiling || !hasProfilingData}
19
onClick={clear}
20
title="Clear profiling data"
21
>
src/devtools/views/Profiler/CommitFlamegraph.js
+2
-1
@@ -25,10 +25,11 @@ export type ItemData = {|
25
|};
26
27
export default function CommitFlamegraphAutoSizer(_: {||}) {
28
- const { profilingCache } = useContext(StoreContext);
28
+ const { profilerStore } = useContext(StoreContext);
29
const { rootID, selectedCommitIndex, selectFiber } = useContext(
30
ProfilerContext
31
);
32
+ const { profilingCache } = profilerStore;
33
34
const deselectCurrentFiber = useCallback(
35
event => {
src/devtools/views/Profiler/CommitRanked.js
+2
-1
@@ -25,10 +25,11 @@ export type ItemData = {|
25
|};
26
27
export default function CommitRankedAutoSizer(_: {||}) {
28
- const { profilingCache } = useContext(StoreContext);
28
+ const { profilerStore } = useContext(StoreContext);
29
const { rootID, selectedCommitIndex, selectFiber } = useContext(
30
ProfilerContext
31
);
32
+ const { profilingCache } = profilerStore;
33
34
const deselectCurrentFiber = useCallback(
35
event => {
src/devtools/views/Profiler/Interactions.js
+2
-1
@@ -45,10 +45,11 @@ function Interactions({ height, width }: {| height: number, width: number |}) {
45
selectTab,
46
} = useContext(ProfilerContext);
47
const { profilerStore } = useContext(StoreContext);
48
+ const { profilingCache } = profilerStore;
49
50
const dataForRoot = profilerStore.getDataForRoot(((rootID: any): number));
51
51
- const chartData = profilerStore.cache.getInteractionsChartData({
52
+ const chartData = profilingCache.getInteractionsChartData({
53
rootID: ((rootID: any): number),
54
});
55
src/devtools/views/Profiler/ProfilerContext.js
+7
-2
@@ -141,8 +141,13 @@ function ProfilerContextController({ children }: Props) {
141
}
142
}
143
144
- const startProfiling = useCallback(() => store.startProfiling(), [store]);
145
- const stopProfiling = useCallback(() => store.stopProfiling(), [store]);
144
+ const startProfiling = useCallback(
145
+ () => store.profilerStore.startProfiling(),
146
+ [store]
147
+ );
148
+ const stopProfiling = useCallback(() => store.profilerStore.stopProfiling(), [
149
+ store,
150
+ ]);
151
152
const [
153
isCommitFilterEnabled,
src/devtools/views/Profiler/ProfilingImportExportButtons.js
+2
-2
@@ -55,7 +55,7 @@ export default function ProfilingImportExportButtons() {
55
const profilingDataExport = ((JSON.parse(
56
raw
57
): any): ProfilingDataExport);
58
- store.profilingData = prepareProfilingDataFrontendFromExport(
58
+ profilerStore.profilingData = prepareProfilingDataFrontendFromExport(
59
profilingDataExport
60
);
61
} catch (error) {
@@ -76,7 +76,7 @@ export default function ProfilingImportExportButtons() {
76
// TODO (profiling) Handle fileReader errors.
77
fileReader.readAsText(input.files[0]);
78
}
79
- }, [modalDialogDispatch, store]);
79
+ }, [modalDialogDispatch, profilerStore]);
80
81
return (
82
<Fragment>
src/devtools/views/Profiler/SidebarInteractions.js
+2
-1
@@ -18,7 +18,8 @@ export default function SidebarInteractions(_: Props) {
18
selectTab,
19
} = useContext(ProfilerContext);
20
21
- const { profilingCache, profilerStore } = useContext(StoreContext);
21
+ const { profilerStore } = useContext(StoreContext);
22
+ const { profilingCache } = profilerStore;
23
24
if (selectedInteractionID === null) {
25
return <div className={styles.NothingSelected}>Nothing selected</div>;
src/devtools/views/Profiler/SidebarSelectedFiberInfo.js
+2
-1
@@ -12,7 +12,7 @@ import styles from './SidebarSelectedFiberInfo.css';
12
export type Props = {||};
13
14
export default function SidebarSelectedFiberInfo(_: Props) {
15
- const { profilingCache, profilerStore } = useContext(StoreContext);
15
+ const { profilerStore } = useContext(StoreContext);
16
const {
17
rootID,
18
selectCommitIndex,
@@ -21,6 +21,7 @@ export default function SidebarSelectedFiberInfo(_: Props) {
21
selectedFiberName,
22
selectFiber,
23
} = useContext(ProfilerContext);
24
+ const { profilingCache } = profilerStore;
25
26
const commitIndices = profilingCache.getFiberCommits({
27
fiberID: ((selectedFiberID: any): number),