Support Installation for physical device

Summary: This diff enables the installation for iOS simulators. This also fixes the error view created when there is an error. Right now there is a bug on my machine where idb doesn't detect my physical device. But once it is detected, it will work.

Reviewed By: mweststrate

Differential Revision: D22137831

fbshipit-source-id: b6d6f77318c6baef78c35af73db3969b7dd1b907
This commit is contained in:
Pritesh Nandgaonkar
2020-06-22 15:56:40 -07:00
committed by Facebook GitHub Bot
parent 2d9d2d4b1a
commit d4680eead9
4 changed files with 10 additions and 3 deletions

View File

@@ -37,6 +37,7 @@ import {
import React, {PureComponent} from 'react';
import {connect, ReactReduxContext} from 'react-redux';
import {setPluginState} from './reducers/pluginStates';
import {Settings} from './reducers/settings';
import {selectPlugin} from './reducers/connections';
import {State as Store, MiddlewareAPI} from './reducers/index';
import {activateMenuItems} from './MenuBar';
@@ -44,7 +45,6 @@ import {Message} from './reducers/pluginMessageQueue';
import {Idler} from './utils/Idler';
import {processMessageQueue} from './utils/messageQueue';
import {ToggleButton, SmallText} from './ui';
import debounceRender from 'react-debounce-render';
const Container = styled(FlexColumn)({
width: 0,
@@ -103,6 +103,7 @@ type StateFromProps = {
isArchivedDevice: boolean;
pendingMessages: Message[] | undefined;
pluginIsEnabled: boolean;
settingsState: Settings;
};
type DispatchFromProps = {
@@ -321,6 +322,7 @@ class PluginContainer extends PureComponent<Props, State> {
target,
isArchivedDevice,
selectedApp,
settingsState,
} = this.props;
if (!activePlugin || !target || !pluginKey) {
console.warn(`No selected plugin. Rendering empty!`);
@@ -339,6 +341,7 @@ class PluginContainer extends PureComponent<Props, State> {
key: pluginKey,
logger: this.props.logger,
selectedApp,
settingsState,
persistedState: activePlugin.defaultPersistedState
? {
...activePlugin.defaultPersistedState,
@@ -397,6 +400,7 @@ export default connect<StateFromProps, DispatchFromProps, OwnProps, Store>(
pluginStates,
plugins: {devicePlugins, clientPlugins},
pluginMessageQueue,
settingsState,
}) => {
let pluginKey = null;
let target = null;
@@ -447,6 +451,7 @@ export default connect<StateFromProps, DispatchFromProps, OwnProps, Store>(
selectedApp: selectedApp || null,
pendingMessages,
pluginIsEnabled,
settingsState,
};
return s;
},

View File

@@ -192,6 +192,6 @@ export {Logger} from './fb-interfaces/Logger';
export {getInstance as getLogger} from './fb-stubs/Logger';
export {callVSCode, getVSCodeUrl} from './utils/vscodeUtils';
export {useLocalStorage} from './utils/useLocalStorage';
export {checkIdbIsInstalled} from './utils/iOSContainerUtility';
// Sidebar extensions should be last so they can import anything from here.
export {default as SidebarExtensions} from './fb-stubs/LayoutInspectorSidebarExtensions';

View File

@@ -21,6 +21,7 @@ import {StaticView} from './reducers/connections';
import {State as ReduxState} from './reducers';
import {DEFAULT_MAX_QUEUE_SIZE} from './reducers/pluginMessageQueue';
import {PluginDetails} from 'flipper-plugin-lib';
import {Settings} from './reducers/settings';
type Parameters = {[key: string]: any};
// This function is intended to be called from outside of the plugin.
@@ -74,6 +75,7 @@ export type Props<T> = {
isArchivedDevice: boolean;
selectedApp: string | null;
setStaticView: (payload: StaticView) => void;
settingsState: Settings;
};
export type BaseAction = {

View File

@@ -107,7 +107,7 @@ async function pull(
);
}
async function checkIdbIsInstalled(idbPath: string): Promise<void> {
export async function checkIdbIsInstalled(idbPath: string): Promise<void> {
const isInstalled = await isAvailable(idbPath);
if (!isInstalled) {
throw new Error(