Clean up App duplication
Summary: fb/App didn't really have a difference with fb-stubs/App, except that one checks for employee presence. However, since that is already controlled by config.checkFbEmployee, de-duped this to a single `<AppWrapper>` component, making the code a bit more easy to follow Reviewed By: priteshrnandgaonkar Differential Revision: D25824521 fbshipit-source-id: 8e16f0b29ec5d12475eaf14acd9dbc7df91191a2
This commit is contained in:
committed by
Facebook GitHub Bot
parent
bf6655a640
commit
7a1717fa87
@@ -14,7 +14,7 @@ import {
|
||||
FlipperDevicePlugin,
|
||||
} from './plugin';
|
||||
import BaseDevice, {OS} from './devices/BaseDevice';
|
||||
import {App} from './App';
|
||||
import {LegacyApp} from './chrome/LegacyApp';
|
||||
import {Logger} from './fb-interfaces/Logger';
|
||||
import {Store} from './reducers/index';
|
||||
import {setPluginState} from './reducers/pluginStates';
|
||||
@@ -124,7 +124,7 @@ export interface FlipperClientConnection<D, M> {
|
||||
}
|
||||
|
||||
export default class Client extends EventEmitter {
|
||||
app: App | undefined;
|
||||
app: LegacyApp | undefined;
|
||||
connected: boolean;
|
||||
id: string;
|
||||
query: ClientQuery;
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
import React from 'react';
|
||||
import {useState, useEffect} from 'react';
|
||||
import FlipperApp from '../App';
|
||||
import WarningEmployee from '../chrome/WarningEmployee';
|
||||
import LegacyApp from './LegacyApp';
|
||||
import WarningEmployee from './WarningEmployee';
|
||||
import fbConfig from '../fb-stubs/config';
|
||||
import {isFBEmployee} from '../utils/fbEmployee';
|
||||
import {Logger} from '../fb-interfaces/Logger';
|
||||
@@ -37,6 +37,6 @@ export default function App(props: Props) {
|
||||
) : isSandyEnabled() ? (
|
||||
<SandyApp />
|
||||
) : (
|
||||
<FlipperApp logger={props.logger} />
|
||||
<LegacyApp logger={props.logger} />
|
||||
);
|
||||
}
|
||||
@@ -8,24 +8,24 @@
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import {FlexRow, styled, Layout} from './ui';
|
||||
import {FlexRow, styled, Layout} from '../ui';
|
||||
import {connect} from 'react-redux';
|
||||
import TitleBar from './chrome/TitleBar';
|
||||
import MainSidebar2 from './chrome/mainsidebar/MainSidebar2';
|
||||
import DoctorBar from './chrome/DoctorBar';
|
||||
import PluginContainer from './PluginContainer';
|
||||
import TitleBar from './TitleBar';
|
||||
import MainSidebar2 from './mainsidebar/MainSidebar2';
|
||||
import DoctorBar from './DoctorBar';
|
||||
import PluginContainer from '../PluginContainer';
|
||||
import {ipcRenderer, remote} from 'electron';
|
||||
import {
|
||||
ACTIVE_SHEET_CHANGELOG_RECENT_ONLY,
|
||||
setActiveSheet,
|
||||
} from './reducers/application';
|
||||
import {Logger} from './fb-interfaces/Logger';
|
||||
import {State as Store} from './reducers/index';
|
||||
import {StaticView} from './reducers/connections';
|
||||
import StatusBar from './chrome/StatusBar';
|
||||
import {hasNewChangesToShow} from './chrome/ChangelogSheet';
|
||||
import QPL, {QuickLogActionType, FLIPPER_QPL_EVENTS} from './fb-stubs/QPL';
|
||||
import {SheetRenderer} from './chrome/SheetRenderer';
|
||||
} from '../reducers/application';
|
||||
import {Logger} from '../fb-interfaces/Logger';
|
||||
import {State as Store} from '../reducers/index';
|
||||
import {StaticView} from '../reducers/connections';
|
||||
import StatusBar from './StatusBar';
|
||||
import {hasNewChangesToShow} from './ChangelogSheet';
|
||||
import QPL, {QuickLogActionType, FLIPPER_QPL_EVENTS} from '../fb-stubs/QPL';
|
||||
import {SheetRenderer} from './SheetRenderer';
|
||||
|
||||
const version = remote.app.getVersion();
|
||||
|
||||
@@ -74,7 +74,7 @@ export function registerStartupTime(logger: Logger) {
|
||||
ipcRenderer.send('componentDidMount');
|
||||
}
|
||||
|
||||
export class App extends React.Component<Props> {
|
||||
export class LegacyApp extends React.Component<Props> {
|
||||
componentDidMount() {
|
||||
registerStartupTime(this.props.logger);
|
||||
if (hasNewChangesToShow(window.localStorage)) {
|
||||
@@ -135,4 +135,4 @@ export default connect<StateFromProps, DispatchProps, OwnProps, Store>(
|
||||
{
|
||||
setActiveSheet,
|
||||
},
|
||||
)(App);
|
||||
)(LegacyApp);
|
||||
@@ -13,7 +13,7 @@ import ReactDOM from 'react-dom';
|
||||
import ContextMenuProvider from './ui/components/ContextMenuProvider';
|
||||
import GK from './fb-stubs/GK';
|
||||
import {init as initLogger} from './fb-stubs/Logger';
|
||||
import App from './fb-stubs/App';
|
||||
import App from './chrome/AppWrapper';
|
||||
import setupPrefetcher from './fb-stubs/Prefetcher';
|
||||
import {persistStore} from 'redux-persist';
|
||||
import {Store} from './reducers/index';
|
||||
|
||||
@@ -14,7 +14,7 @@ import {Layout, Sidebar} from '../ui';
|
||||
import {theme} from 'flipper-plugin';
|
||||
|
||||
import {LeftRail} from './LeftRail';
|
||||
import {registerStartupTime} from '../App';
|
||||
import {registerStartupTime} from '../chrome/LegacyApp';
|
||||
import {useStore, useDispatch} from '../utils/useStore';
|
||||
import {SandyContext} from './SandyContext';
|
||||
import {ConsoleLogs} from '../chrome/ConsoleLogs';
|
||||
|
||||
Reference in New Issue
Block a user