Fixed circular dependency warnings
Summary: Nobody moves the hackathon! Fixed some circular deps warnings while waiting for another Diff to land Reviewed By: priteshrnandgaonkar Differential Revision: D18749645 fbshipit-source-id: 225fbea428dca02f0f4c920ee47b4ece3c3e370b
This commit is contained in:
committed by
Facebook Github Bot
parent
749228674f
commit
2bee9ec9e7
@@ -23,7 +23,7 @@ import {
|
||||
} from 'flipper';
|
||||
import {FlipperDevicePlugin, BaseAction} from './plugin';
|
||||
import {connect, ReactReduxContext} from 'react-redux';
|
||||
import {store} from './init';
|
||||
import {store} from './store';
|
||||
import React, {Component, Fragment} from 'react';
|
||||
import {clipboard} from 'electron';
|
||||
import {
|
||||
|
||||
@@ -17,9 +17,8 @@ import {
|
||||
Checkbox,
|
||||
colors,
|
||||
View,
|
||||
} from 'flipper';
|
||||
} from '../ui';
|
||||
import React, {Component} from 'react';
|
||||
import {ReactReduxContext} from 'react-redux';
|
||||
|
||||
export type SelectionType = 'multiple' | 'single';
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
import React, {PureComponent} from 'react';
|
||||
import {FlexColumn, Text, styled} from 'flipper';
|
||||
import {FlexColumn, Text, styled} from '../ui';
|
||||
|
||||
type Props = {
|
||||
errors: Array<Error>;
|
||||
|
||||
@@ -22,7 +22,7 @@ import {
|
||||
import ShareSheetErrorList from './ShareSheetErrorList';
|
||||
import ShareSheetPendingDialog from './ShareSheetPendingDialog';
|
||||
import {ReactReduxContext} from 'react-redux';
|
||||
import {store} from '../init';
|
||||
import {store} from '../store';
|
||||
|
||||
const Container = styled(FlexColumn)({
|
||||
padding: 20,
|
||||
|
||||
@@ -18,7 +18,7 @@ import {
|
||||
} from 'flipper';
|
||||
import React, {Component} from 'react';
|
||||
import {ReactReduxContext} from 'react-redux';
|
||||
import {store} from '../init';
|
||||
import {store} from '../store';
|
||||
import {
|
||||
setExportStatusComponent,
|
||||
unsetShare,
|
||||
|
||||
@@ -16,7 +16,7 @@ import {
|
||||
FlexRow,
|
||||
Text,
|
||||
LoadingIndicator,
|
||||
} from 'flipper';
|
||||
} from '../ui';
|
||||
import React from 'react';
|
||||
|
||||
const Container = styled(FlexColumn)({
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
import React, {Component} from 'react';
|
||||
import BaseDevice from '../devices/BaseDevice';
|
||||
import {Button, Glyph, colors} from 'flipper';
|
||||
import {Button, Glyph, colors} from '../ui';
|
||||
import path from 'path';
|
||||
import os from 'os';
|
||||
|
||||
|
||||
15
src/init.tsx
15
src/init.tsx
@@ -16,13 +16,11 @@ import {init as initLogger} from './fb-stubs/Logger';
|
||||
import App from './App';
|
||||
import BugReporter from './fb-stubs/BugReporter';
|
||||
import setupPrefetcher from './fb-stubs/Prefetcher';
|
||||
import {createStore} from 'redux';
|
||||
import {persistStore} from 'redux-persist';
|
||||
import reducers, {Store, Actions, State as StoreState} from './reducers/index';
|
||||
import {Store} from './reducers/index';
|
||||
import dispatcher from './dispatcher/index';
|
||||
import TooltipProvider from './ui/components/TooltipProvider';
|
||||
import config from './utils/processConfig';
|
||||
import {stateSanitizer} from './utils/reduxDevToolsConfig';
|
||||
import {initLauncherHooks} from './utils/launcher';
|
||||
import initCrashReporter from './utils/electronCrashReporter';
|
||||
import fbConfig from './fb-stubs/config';
|
||||
@@ -31,16 +29,7 @@ import WarningEmployee from './chrome/WarningEmployee';
|
||||
import {setPersistor} from './utils/persistor';
|
||||
import React from 'react';
|
||||
import path from 'path';
|
||||
|
||||
export const store = createStore<StoreState, Actions, any, any>(
|
||||
reducers,
|
||||
window.__REDUX_DEVTOOLS_EXTENSION__
|
||||
? window.__REDUX_DEVTOOLS_EXTENSION__({
|
||||
// @ts-ignore: stateSanitizer is not part of type definition.
|
||||
stateSanitizer,
|
||||
})
|
||||
: undefined,
|
||||
);
|
||||
import {store} from './store';
|
||||
|
||||
const logger = initLogger(store);
|
||||
const bugReporter = new BugReporter(logger, store);
|
||||
|
||||
22
src/store.tsx
Normal file
22
src/store.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
import {createStore} from 'redux';
|
||||
import reducers, {Actions, State as StoreState} from './reducers/index';
|
||||
import {stateSanitizer} from './utils/reduxDevToolsConfig';
|
||||
|
||||
export const store = createStore<StoreState, Actions, any, any>(
|
||||
reducers,
|
||||
window.__REDUX_DEVTOOLS_EXTENSION__
|
||||
? window.__REDUX_DEVTOOLS_EXTENSION__({
|
||||
// @ts-ignore: stateSanitizer is not part of type definition.
|
||||
stateSanitizer,
|
||||
})
|
||||
: undefined,
|
||||
);
|
||||
@@ -7,7 +7,9 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
import {colors, styled} from 'flipper';
|
||||
import styled from 'react-emotion';
|
||||
import {colors} from './colors';
|
||||
|
||||
import {BackgroundColorProperty, HeightProperty} from 'csstype';
|
||||
|
||||
type Props = {
|
||||
|
||||
@@ -15,7 +15,7 @@ import Tooltip from '../Tooltip';
|
||||
import styled from 'react-emotion';
|
||||
import createPaste from '../../../fb-stubs/createPaste';
|
||||
import {reportInteraction} from '../../../utils/InteractionTracker';
|
||||
import DataPreview from './DataPreview';
|
||||
import DataPreview, {DataValueExtractor, InspectorName} from './DataPreview';
|
||||
import {getSortedKeys} from './utils';
|
||||
import {colors} from '../colors';
|
||||
import {clipboard} from 'electron';
|
||||
@@ -23,6 +23,8 @@ import deepEqual from 'deep-equal';
|
||||
import React from 'react';
|
||||
import {TooltipOptions} from '../TooltipProvider.js';
|
||||
|
||||
export {DataValueExtractor} from './DataPreview';
|
||||
|
||||
const BaseContainer = styled('div')(
|
||||
(props: {depth?: number; disabled?: boolean}) => ({
|
||||
fontFamily: 'Menlo, monospace',
|
||||
@@ -60,28 +62,11 @@ const ExpandControl = styled('span')({
|
||||
});
|
||||
ExpandControl.displayName = 'DataInspector:ExpandControl';
|
||||
|
||||
export const InspectorName = styled('span')({
|
||||
color: colors.grapeDark1,
|
||||
});
|
||||
InspectorName.displayName = 'DataInspector:InspectorName';
|
||||
|
||||
const nameTooltipOptions: TooltipOptions = {
|
||||
position: 'toLeft',
|
||||
showTail: true,
|
||||
};
|
||||
|
||||
export type DataValueExtractor = (
|
||||
value: any,
|
||||
depth: number,
|
||||
) =>
|
||||
| {
|
||||
mutable: boolean;
|
||||
type: string;
|
||||
value: any;
|
||||
}
|
||||
| undefined
|
||||
| null;
|
||||
|
||||
export type DataInspectorSetValue = (path: Array<string>, val: any) => void;
|
||||
|
||||
export type DataInspectorExpanded = {
|
||||
|
||||
@@ -7,12 +7,29 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
import {DataValueExtractor, InspectorName} from './DataInspector';
|
||||
import DataDescription from './DataDescription';
|
||||
import styled from 'react-emotion';
|
||||
import {getSortedKeys} from './utils';
|
||||
import {PureComponent} from 'react';
|
||||
import React from 'react';
|
||||
import {colors} from '../colors';
|
||||
|
||||
export type DataValueExtractor = (
|
||||
value: any,
|
||||
depth: number,
|
||||
) =>
|
||||
| {
|
||||
mutable: boolean;
|
||||
type: string;
|
||||
value: any;
|
||||
}
|
||||
| undefined
|
||||
| null;
|
||||
|
||||
export const InspectorName = styled('span')({
|
||||
color: colors.grapeDark1,
|
||||
});
|
||||
InspectorName.displayName = 'DataInspector:InspectorName';
|
||||
|
||||
const PreviewContainer = styled('span')({
|
||||
fontStyle: 'italic',
|
||||
|
||||
@@ -7,10 +7,11 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
import {DataValueExtractor, DataInspectorExpanded} from './DataInspector';
|
||||
import {DataInspectorExpanded} from './DataInspector';
|
||||
import {PureComponent} from 'react';
|
||||
import DataInspector from './DataInspector';
|
||||
import React from 'react';
|
||||
import {DataValueExtractor} from './DataPreview';
|
||||
|
||||
type ManagedDataInspectorProps = {
|
||||
/**
|
||||
|
||||
@@ -44,6 +44,7 @@ const ICONS = {
|
||||
'mobile-engagement': [16],
|
||||
network: [12],
|
||||
'news-feed': [12],
|
||||
'question-circle': [12],
|
||||
'question-circle-outline': [16],
|
||||
'star-outline': [12, 16, 24],
|
||||
trending: [12],
|
||||
|
||||
Reference in New Issue
Block a user