Use getRenderHost from flipper-frontned-core in flipper-ui-core
Summary: See D37139129 Reviewed By: lblasa Differential Revision: D37236435 fbshipit-source-id: 927e9f741bfedb65165f5d24f0acfb775925cdc7
This commit is contained in:
committed by
Facebook GitHub Bot
parent
fab8849c73
commit
17ab7a86ef
@@ -1,148 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) Meta Platforms, Inc. and 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 type {NotificationEvents} from './dispatcher/notifications';
|
|
||||||
import type {PluginNotification} from './reducers/notifications';
|
|
||||||
import {FlipperLib} from 'flipper-plugin';
|
|
||||||
import {FlipperServer, FlipperServerConfig} from 'flipper-common';
|
|
||||||
import {Icon} from './utils/icons';
|
|
||||||
|
|
||||||
interface NotificationAction {
|
|
||||||
// Docs: https://electronjs.org/docs/api/structures/notification-action
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The label for the given action.
|
|
||||||
*/
|
|
||||||
text?: string;
|
|
||||||
/**
|
|
||||||
* The type of action, can be `button`.
|
|
||||||
*/
|
|
||||||
type: 'button';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Subset of electron.d.ts
|
|
||||||
interface NotificationConstructorOptions {
|
|
||||||
/**
|
|
||||||
* A title for the notification, which will be shown at the top of the notification
|
|
||||||
* window when it is shown.
|
|
||||||
*/
|
|
||||||
title: string;
|
|
||||||
/**
|
|
||||||
* The body text of the notification, which will be displayed below the title or
|
|
||||||
* subtitle.
|
|
||||||
*/
|
|
||||||
body: string;
|
|
||||||
/**
|
|
||||||
* Actions to add to the notification. Please read the available actions and
|
|
||||||
* limitations in the `NotificationAction` documentation.
|
|
||||||
*
|
|
||||||
* @platform darwin
|
|
||||||
*/
|
|
||||||
actions?: NotificationAction[];
|
|
||||||
/**
|
|
||||||
* A custom title for the close button of an alert. An empty string will cause the
|
|
||||||
* default localized text to be used.
|
|
||||||
*
|
|
||||||
* @platform darwin
|
|
||||||
*/
|
|
||||||
closeButtonText?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Events that are emitted from the main.ts ovr the IPC process bridge in Electron
|
|
||||||
type MainProcessEvents = {
|
|
||||||
'flipper-protocol-handler': [query: string];
|
|
||||||
'open-flipper-file': [url: string];
|
|
||||||
notificationEvent: [
|
|
||||||
eventName: NotificationEvents,
|
|
||||||
pluginNotification: PluginNotification,
|
|
||||||
arg: null | string | number,
|
|
||||||
];
|
|
||||||
trackUsage: any[];
|
|
||||||
getLaunchTime: [launchStartTime: number];
|
|
||||||
};
|
|
||||||
|
|
||||||
// Events that are emitted by the child process, to the main process
|
|
||||||
type ChildProcessEvents = {
|
|
||||||
setTheme: [theme: 'dark' | 'light' | 'system'];
|
|
||||||
sendNotification: [
|
|
||||||
{
|
|
||||||
payload: NotificationConstructorOptions;
|
|
||||||
pluginNotification: PluginNotification;
|
|
||||||
closeAfter?: number;
|
|
||||||
},
|
|
||||||
];
|
|
||||||
getLaunchTime: [];
|
|
||||||
componentDidMount: [];
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Utilities provided by the render host, e.g. Electron, the Browser, etc
|
|
||||||
*/
|
|
||||||
export interface RenderHost {
|
|
||||||
readTextFromClipboard(): string | undefined;
|
|
||||||
writeTextToClipboard(text: string): void;
|
|
||||||
/**
|
|
||||||
* @deprecated
|
|
||||||
* WARNING!
|
|
||||||
* It is a low-level API call that might be removed in the future.
|
|
||||||
* It is not really deprecated yet, but we'll try to make it so.
|
|
||||||
* TODO: Remove in favor of "exportFile"
|
|
||||||
*/
|
|
||||||
showSaveDialog?(options: {
|
|
||||||
defaultPath?: string;
|
|
||||||
message?: string;
|
|
||||||
title?: string;
|
|
||||||
}): Promise<string | undefined>;
|
|
||||||
/**
|
|
||||||
* @deprecated
|
|
||||||
* WARNING!
|
|
||||||
* It is a low-level API call that might be removed in the future.
|
|
||||||
* It is not really deprecated yet, but we'll try to make it so.
|
|
||||||
* TODO: Remove in favor of "importFile"
|
|
||||||
*/
|
|
||||||
showOpenDialog?(options: {
|
|
||||||
defaultPath?: string;
|
|
||||||
filter?: {
|
|
||||||
extensions: string[];
|
|
||||||
name: string;
|
|
||||||
};
|
|
||||||
}): Promise<string | undefined>;
|
|
||||||
showSelectDirectoryDialog?(defaultPath?: string): Promise<string | undefined>;
|
|
||||||
importFile: FlipperLib['importFile'];
|
|
||||||
exportFile: FlipperLib['exportFile'];
|
|
||||||
hasFocus(): boolean;
|
|
||||||
onIpcEvent<Event extends keyof MainProcessEvents>(
|
|
||||||
event: Event,
|
|
||||||
callback: (...arg: MainProcessEvents[Event]) => void,
|
|
||||||
): void;
|
|
||||||
sendIpcEvent<Event extends keyof ChildProcessEvents>(
|
|
||||||
event: Event,
|
|
||||||
...args: ChildProcessEvents[Event]
|
|
||||||
): void;
|
|
||||||
shouldUseDarkColors(): boolean;
|
|
||||||
restartFlipper(update?: boolean): void;
|
|
||||||
openLink(url: string): void;
|
|
||||||
loadDefaultPlugins(): Record<string, any>;
|
|
||||||
GK(gatekeeper: string): boolean;
|
|
||||||
flipperServer: FlipperServer;
|
|
||||||
serverConfig: FlipperServerConfig;
|
|
||||||
requirePlugin(path: string): Promise<any>;
|
|
||||||
getStaticResourceUrl(relativePath: string): string;
|
|
||||||
// given the requested icon and proposed public url of the icon, rewrite it to a local icon if needed
|
|
||||||
getLocalIconUrl?(icon: Icon, publicUrl: string): string;
|
|
||||||
unloadModule?(path: string): void;
|
|
||||||
getPercentCPUUsage?(): number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getRenderHostInstance(): RenderHost {
|
|
||||||
if (!FlipperRenderHostInstance) {
|
|
||||||
throw new Error('global FlipperRenderHostInstance was never set');
|
|
||||||
}
|
|
||||||
return FlipperRenderHostInstance;
|
|
||||||
}
|
|
||||||
@@ -8,7 +8,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import {createStore} from 'redux';
|
import {createStore} from 'redux';
|
||||||
import {BaseDevice, TestDevice} from 'flipper-frontend-core';
|
import {
|
||||||
|
BaseDevice,
|
||||||
|
TestDevice,
|
||||||
|
getRenderHostInstance,
|
||||||
|
} from 'flipper-frontend-core';
|
||||||
import {createRootReducer} from '../../reducers';
|
import {createRootReducer} from '../../reducers';
|
||||||
import {Store} from '../../reducers/index';
|
import {Store} from '../../reducers/index';
|
||||||
import Client from '../../Client';
|
import Client from '../../Client';
|
||||||
@@ -26,7 +30,6 @@ import {initializeFlipperLibImplementation} from '../../utils/flipperLibImplemen
|
|||||||
import pluginManager from '../../dispatcher/pluginManager';
|
import pluginManager from '../../dispatcher/pluginManager';
|
||||||
import {PluginDetails} from 'flipper-common';
|
import {PluginDetails} from 'flipper-common';
|
||||||
import {ClientQuery, DeviceOS} from 'flipper-common';
|
import {ClientQuery, DeviceOS} from 'flipper-common';
|
||||||
import {getRenderHostInstance} from '../../RenderHost';
|
|
||||||
|
|
||||||
export interface AppOptions {
|
export interface AppOptions {
|
||||||
plugins?: PluginDefinition[];
|
plugins?: PluginDefinition[];
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import React, {Component} from 'react';
|
|||||||
import {reportUsage} from 'flipper-common';
|
import {reportUsage} from 'flipper-common';
|
||||||
import {Modal} from 'antd';
|
import {Modal} from 'antd';
|
||||||
import {Dialog, theme} from 'flipper-plugin';
|
import {Dialog, theme} from 'flipper-plugin';
|
||||||
import {getRenderHostInstance} from '../RenderHost';
|
import {getRenderHostInstance} from 'flipper-frontend-core';
|
||||||
|
|
||||||
const changelogKey = 'FlipperChangelogStatus';
|
const changelogKey = 'FlipperChangelogStatus';
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import {isEqual} from 'lodash';
|
|||||||
import {Platform, reportUsage, Settings} from 'flipper-common';
|
import {Platform, reportUsage, Settings} from 'flipper-common';
|
||||||
import {Modal, Button} from 'antd';
|
import {Modal, Button} from 'antd';
|
||||||
import {Layout, withTrackingScope, _NuxManagerContext} from 'flipper-plugin';
|
import {Layout, withTrackingScope, _NuxManagerContext} from 'flipper-plugin';
|
||||||
import {getRenderHostInstance} from '../RenderHost';
|
import {getRenderHostInstance} from 'flipper-frontend-core';
|
||||||
|
|
||||||
const WIZARD_FINISHED_LOCAL_STORAGE_KEY = 'platformSelectWizardFinished';
|
const WIZARD_FINISHED_LOCAL_STORAGE_KEY = 'platformSelectWizardFinished';
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ import {useStore} from '../utils/useStore';
|
|||||||
import {isLoggedIn} from '../fb-stubs/user';
|
import {isLoggedIn} from '../fb-stubs/user';
|
||||||
import {useValue} from 'flipper-plugin';
|
import {useValue} from 'flipper-plugin';
|
||||||
import {reportPlatformFailures} from 'flipper-common';
|
import {reportPlatformFailures} from 'flipper-common';
|
||||||
import {getRenderHostInstance} from '../RenderHost';
|
import {getRenderHostInstance} from 'flipper-frontend-core';
|
||||||
|
|
||||||
type NextAction = 'select-rating' | 'leave-comment' | 'finished';
|
type NextAction = 'select-rating' | 'leave-comment' | 'finished';
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import React, {useState, useCallback} from 'react';
|
|||||||
import {capture, getCaptureLocation, getFileName} from '../utils/screenshot';
|
import {capture, getCaptureLocation, getFileName} from '../utils/screenshot';
|
||||||
import {CameraOutlined, VideoCameraOutlined} from '@ant-design/icons';
|
import {CameraOutlined, VideoCameraOutlined} from '@ant-design/icons';
|
||||||
import {useStore} from '../utils/useStore';
|
import {useStore} from '../utils/useStore';
|
||||||
import {getRenderHostInstance} from '../RenderHost';
|
import {getRenderHostInstance} from 'flipper-frontend-core';
|
||||||
import {path} from 'flipper-plugin';
|
import {path} from 'flipper-plugin';
|
||||||
|
|
||||||
async function openFile(path: string) {
|
async function openFile(path: string) {
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ import {
|
|||||||
_NuxManagerContext,
|
_NuxManagerContext,
|
||||||
NUX,
|
NUX,
|
||||||
} from 'flipper-plugin';
|
} from 'flipper-plugin';
|
||||||
import {getRenderHostInstance} from '../RenderHost';
|
import {getRenderHostInstance} from 'flipper-frontend-core';
|
||||||
import {loadTheme} from '../utils/loadTheme';
|
import {loadTheme} from '../utils/loadTheme';
|
||||||
|
|
||||||
type OwnProps = {
|
type OwnProps = {
|
||||||
|
|||||||
@@ -8,9 +8,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import React, {Component} from 'react';
|
import React, {Component} from 'react';
|
||||||
import {BaseDevice} from 'flipper-frontend-core';
|
import {BaseDevice, getRenderHostInstance} from 'flipper-frontend-core';
|
||||||
import {Button, Glyph, colors} from '../ui';
|
import {Button, Glyph, colors} from '../ui';
|
||||||
import {getRenderHostInstance} from '../RenderHost';
|
|
||||||
import {path} from 'flipper-plugin';
|
import {path} from 'flipper-plugin';
|
||||||
|
|
||||||
type OwnProps = {
|
type OwnProps = {
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import {Dispatch, Action} from 'redux';
|
|||||||
import PluginPackageInstaller from './PluginPackageInstaller';
|
import PluginPackageInstaller from './PluginPackageInstaller';
|
||||||
import {Toolbar} from 'flipper-plugin';
|
import {Toolbar} from 'flipper-plugin';
|
||||||
import {Alert, Button, Input, Tooltip, Typography} from 'antd';
|
import {Alert, Button, Input, Tooltip, Typography} from 'antd';
|
||||||
import {getRenderHostInstance} from '../../RenderHost';
|
import {getRenderHostInstance} from 'flipper-frontend-core';
|
||||||
import {WarningOutlined} from '@ant-design/icons';
|
import {WarningOutlined} from '@ant-design/icons';
|
||||||
|
|
||||||
const {Text, Link} = Typography;
|
const {Text, Link} = Typography;
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import {
|
|||||||
import styled from '@emotion/styled';
|
import styled from '@emotion/styled';
|
||||||
import React, {useState} from 'react';
|
import React, {useState} from 'react';
|
||||||
import {Toolbar, FileSelector} from 'flipper-plugin';
|
import {Toolbar, FileSelector} from 'flipper-plugin';
|
||||||
import {getRenderHostInstance} from '../../RenderHost';
|
import {getRenderHostInstance} from 'flipper-frontend-core';
|
||||||
|
|
||||||
const CenteredGlyph = styled(Glyph)({
|
const CenteredGlyph = styled(Glyph)({
|
||||||
margin: 'auto',
|
margin: 'auto',
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import configureStore from 'redux-mock-store';
|
|||||||
import {Provider} from 'react-redux';
|
import {Provider} from 'react-redux';
|
||||||
import type {PluginDetails, UpdatablePluginDetails} from 'flipper-common';
|
import type {PluginDetails, UpdatablePluginDetails} from 'flipper-common';
|
||||||
import {Store} from '../../../reducers';
|
import {Store} from '../../../reducers';
|
||||||
import {getRenderHostInstance} from '../../../RenderHost';
|
import {getRenderHostInstance} from 'flipper-frontend-core';
|
||||||
|
|
||||||
let getUpdatablePluginsMock: jest.Mock<any, any>;
|
let getUpdatablePluginsMock: jest.Mock<any, any>;
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import {
|
|||||||
} from '../../ui';
|
} from '../../ui';
|
||||||
import React, {useState, useEffect} from 'react';
|
import React, {useState, useEffect} from 'react';
|
||||||
import {getFlipperLib, theme} from 'flipper-plugin';
|
import {getFlipperLib, theme} from 'flipper-plugin';
|
||||||
import {getRenderHostInstance} from '../../RenderHost';
|
import {getRenderHostInstance} from 'flipper-frontend-core';
|
||||||
|
|
||||||
export const ConfigFieldContainer = styled(FlexRow)({
|
export const ConfigFieldContainer = styled(FlexRow)({
|
||||||
paddingLeft: 10,
|
paddingLeft: 10,
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import {getLogger} from 'flipper-common';
|
|||||||
import configureStore from 'redux-mock-store';
|
import configureStore from 'redux-mock-store';
|
||||||
import TestPlugin from './TestPlugin';
|
import TestPlugin from './TestPlugin';
|
||||||
import {_SandyPluginDefinition} from 'flipper-plugin';
|
import {_SandyPluginDefinition} from 'flipper-plugin';
|
||||||
import {getRenderHostInstance} from '../../RenderHost';
|
import {getRenderHostInstance} from 'flipper-frontend-core';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
|
||||||
let loadDynamicPluginsMock: jest.Mock;
|
let loadDynamicPluginsMock: jest.Mock;
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import {
|
|||||||
import {tryCatchReportPlatformFailures} from 'flipper-common';
|
import {tryCatchReportPlatformFailures} from 'flipper-common';
|
||||||
import {handleDeeplink} from '../deeplink';
|
import {handleDeeplink} from '../deeplink';
|
||||||
import {Dialog} from 'flipper-plugin';
|
import {Dialog} from 'flipper-plugin';
|
||||||
import {getRenderHostInstance} from '../RenderHost';
|
import {getRenderHostInstance} from 'flipper-frontend-core';
|
||||||
|
|
||||||
export default (store: Store, logger: Logger) => {
|
export default (store: Store, logger: Logger) => {
|
||||||
const renderHost = getRenderHostInstance();
|
const renderHost = getRenderHostInstance();
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ import {
|
|||||||
DeeplinkInteractionState,
|
DeeplinkInteractionState,
|
||||||
OpenPluginParams,
|
OpenPluginParams,
|
||||||
} from '../deeplinkTracking';
|
} from '../deeplinkTracking';
|
||||||
import {getRenderHostInstance} from '../RenderHost';
|
import {getRenderHostInstance} from 'flipper-frontend-core';
|
||||||
import {waitFor} from '../utils/waitFor';
|
import {waitFor} from '../utils/waitFor';
|
||||||
|
|
||||||
export function parseOpenPluginParams(query: string): OpenPluginParams {
|
export function parseOpenPluginParams(query: string): OpenPluginParams {
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import {textContent} from 'flipper-plugin';
|
|||||||
import {getPluginTitle} from '../utils/pluginUtils';
|
import {getPluginTitle} from '../utils/pluginUtils';
|
||||||
import {sideEffect} from '../utils/sideEffect';
|
import {sideEffect} from '../utils/sideEffect';
|
||||||
import {openNotification} from '../sandy-chrome/notification/Notification';
|
import {openNotification} from '../sandy-chrome/notification/Notification';
|
||||||
import {getRenderHostInstance} from '../RenderHost';
|
import {getRenderHostInstance} from 'flipper-frontend-core';
|
||||||
|
|
||||||
export type NotificationEvents =
|
export type NotificationEvents =
|
||||||
| 'show'
|
| 'show'
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import {loadPlugin} from '../reducers/pluginManager';
|
|||||||
import {showErrorNotification} from '../utils/notifications';
|
import {showErrorNotification} from '../utils/notifications';
|
||||||
import {pluginInstalled} from '../reducers/plugins';
|
import {pluginInstalled} from '../reducers/plugins';
|
||||||
import {getAllClients} from '../reducers/connections';
|
import {getAllClients} from '../reducers/connections';
|
||||||
import {getRenderHostInstance} from '../RenderHost';
|
import {getRenderHostInstance} from 'flipper-frontend-core';
|
||||||
|
|
||||||
export default (store: Store) => {
|
export default (store: Store) => {
|
||||||
sideEffect(
|
sideEffect(
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ import {
|
|||||||
defaultEnabledBackgroundPlugins,
|
defaultEnabledBackgroundPlugins,
|
||||||
} from '../utils/pluginUtils';
|
} from '../utils/pluginUtils';
|
||||||
import {getPluginKey} from '../utils/pluginKey';
|
import {getPluginKey} from '../utils/pluginKey';
|
||||||
import {getRenderHostInstance} from '../RenderHost';
|
import {getRenderHostInstance} from 'flipper-frontend-core';
|
||||||
|
|
||||||
async function refreshInstalledPlugins(store: Store) {
|
async function refreshInstalledPlugins(store: Store) {
|
||||||
const flipperServer = getRenderHostInstance().flipperServer;
|
const flipperServer = getRenderHostInstance().flipperServer;
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import {selectCompatibleMarketplaceVersions} from './plugins';
|
|||||||
import isPluginVersionMoreRecent from '../utils/isPluginVersionMoreRecent';
|
import isPluginVersionMoreRecent from '../utils/isPluginVersionMoreRecent';
|
||||||
import {isConnectivityOrAuthError} from 'flipper-common';
|
import {isConnectivityOrAuthError} from 'flipper-common';
|
||||||
import {isLoggedIn} from '../fb-stubs/user';
|
import {isLoggedIn} from '../fb-stubs/user';
|
||||||
import {getRenderHostInstance} from '..';
|
import {getRenderHostInstance} from 'flipper-frontend-core';
|
||||||
|
|
||||||
// TODO: provide this value from settings
|
// TODO: provide this value from settings
|
||||||
export const pollingIntervalMs = getRenderHostInstance().serverConfig.env
|
export const pollingIntervalMs = getRenderHostInstance().serverConfig.env
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ import {isDevicePluginDefinition} from '../utils/pluginUtils';
|
|||||||
import isPluginCompatible from '../utils/isPluginCompatible';
|
import isPluginCompatible from '../utils/isPluginCompatible';
|
||||||
import isPluginVersionMoreRecent from '../utils/isPluginVersionMoreRecent';
|
import isPluginVersionMoreRecent from '../utils/isPluginVersionMoreRecent';
|
||||||
import {createSandyPluginWrapper} from '../utils/createSandyPluginWrapper';
|
import {createSandyPluginWrapper} from '../utils/createSandyPluginWrapper';
|
||||||
import {getRenderHostInstance} from '../RenderHost';
|
import {getRenderHostInstance} from 'flipper-frontend-core';
|
||||||
import pMap from 'p-map';
|
import pMap from 'p-map';
|
||||||
import * as deprecatedExports from '../deprecated-exports';
|
import * as deprecatedExports from '../deprecated-exports';
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ import {deconstructClientId} from 'flipper-common';
|
|||||||
import {sideEffect} from '../utils/sideEffect';
|
import {sideEffect} from '../utils/sideEffect';
|
||||||
import {getSelectionInfo} from '../utils/info';
|
import {getSelectionInfo} from '../utils/info';
|
||||||
import type {SelectionInfo} from '../utils/info';
|
import type {SelectionInfo} from '../utils/info';
|
||||||
import {getRenderHostInstance} from '../RenderHost';
|
import {getRenderHostInstance} from 'flipper-frontend-core';
|
||||||
|
|
||||||
const TIME_SPENT_EVENT = 'time-spent';
|
const TIME_SPENT_EVENT = 'time-spent';
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import {VersionCheckResult} from '../chrome/UpdateIndicator';
|
import {VersionCheckResult} from '../chrome/UpdateIndicator';
|
||||||
import {getRenderHostInstance} from '../RenderHost';
|
import {getRenderHostInstance} from 'flipper-frontend-core';
|
||||||
|
|
||||||
const updateServer = 'https://www.facebook.com/fbflipper/public/latest.json';
|
const updateServer = 'https://www.facebook.com/fbflipper/public/latest.json';
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import {StoreEnhancerStoreCreator} from 'redux';
|
import {StoreEnhancerStoreCreator} from 'redux';
|
||||||
import {RenderHost} from './RenderHost';
|
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
interface StoreEnhancerStateSanitizer {
|
interface StoreEnhancerStateSanitizer {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
// TODO: should not be exported anymore, but still needed for 'import from 'flipper'' stuff
|
// TODO: should not be exported anymore, but still needed for 'import from 'flipper'' stuff
|
||||||
export * from './deprecated-exports';
|
export * from './deprecated-exports';
|
||||||
|
|
||||||
export {RenderHost, getRenderHostInstance} from './RenderHost';
|
export {RenderHost, getRenderHostInstance} from 'flipper-frontend-core';
|
||||||
|
|
||||||
export {startFlipperDesktop} from './startFlipperDesktop';
|
export {startFlipperDesktop} from './startFlipperDesktop';
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import {v1 as uuidv1} from 'uuid';
|
import {v1 as uuidv1} from 'uuid';
|
||||||
import {getRenderHostInstance} from '../RenderHost';
|
import {getRenderHostInstance} from 'flipper-frontend-core';
|
||||||
import {Actions} from './';
|
import {Actions} from './';
|
||||||
|
|
||||||
export type LauncherMsg = {
|
export type LauncherMsg = {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import {LauncherSettings} from 'flipper-common';
|
import {LauncherSettings} from 'flipper-common';
|
||||||
import {getRenderHostInstance} from '../RenderHost';
|
import {getRenderHostInstance} from 'flipper-frontend-core';
|
||||||
import {Actions} from './index';
|
import {Actions} from './index';
|
||||||
|
|
||||||
export type Action = {
|
export type Action = {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import {Actions} from './index';
|
import {Actions} from './index';
|
||||||
import {getRenderHostInstance} from '../RenderHost';
|
import {getRenderHostInstance} from 'flipper-frontend-core';
|
||||||
import {Settings} from 'flipper-common';
|
import {Settings} from 'flipper-common';
|
||||||
|
|
||||||
export type Action =
|
export type Action =
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
import {produce} from 'immer';
|
import {produce} from 'immer';
|
||||||
import {Actions} from './';
|
import {Actions} from './';
|
||||||
import {SelectionInfo} from '../utils/info';
|
import {SelectionInfo} from '../utils/info';
|
||||||
import {getRenderHostInstance} from '../RenderHost';
|
import {getRenderHostInstance} from 'flipper-frontend-core';
|
||||||
|
|
||||||
export type TrackingEvent =
|
export type TrackingEvent =
|
||||||
| {
|
| {
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ import {
|
|||||||
} from '../utils/exportData';
|
} from '../utils/exportData';
|
||||||
import {openDeeplinkDialog} from '../deeplink';
|
import {openDeeplinkDialog} from '../deeplink';
|
||||||
import {css} from '@emotion/css';
|
import {css} from '@emotion/css';
|
||||||
import {getRenderHostInstance} from '../RenderHost';
|
import {getRenderHostInstance} from 'flipper-frontend-core';
|
||||||
import openSupportRequestForm from '../fb-stubs/openSupportRequestForm';
|
import openSupportRequestForm from '../fb-stubs/openSupportRequestForm';
|
||||||
import {StyleGuide} from './StyleGuide';
|
import {StyleGuide} from './StyleGuide';
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ import fbConfig from '../fb-stubs/config';
|
|||||||
import {isFBEmployee} from '../utils/fbEmployee';
|
import {isFBEmployee} from '../utils/fbEmployee';
|
||||||
import {notification} from 'antd';
|
import {notification} from 'antd';
|
||||||
import isProduction from '../utils/isProduction';
|
import isProduction from '../utils/isProduction';
|
||||||
import {getRenderHostInstance} from '../RenderHost';
|
import {getRenderHostInstance} from 'flipper-frontend-core';
|
||||||
|
|
||||||
export type ToplevelNavItem =
|
export type ToplevelNavItem =
|
||||||
| 'appinspect'
|
| 'appinspect'
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ import {State} from '../../reducers';
|
|||||||
import {brandColors, brandIcons, colors} from '../../ui/components/colors';
|
import {brandColors, brandIcons, colors} from '../../ui/components/colors';
|
||||||
import {TroubleshootingGuide} from './fb-stubs/TroubleshootingGuide';
|
import {TroubleshootingGuide} from './fb-stubs/TroubleshootingGuide';
|
||||||
import {getSelectableDevices} from '../../selectors/connections';
|
import {getSelectableDevices} from '../../selectors/connections';
|
||||||
import {getRenderHostInstance} from '../../RenderHost';
|
import {getRenderHostInstance} from 'flipper-frontend-core';
|
||||||
|
|
||||||
const {Text} = Typography;
|
const {Text} = Typography;
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import {
|
|||||||
} from 'flipper-plugin';
|
} from 'flipper-plugin';
|
||||||
import {Provider} from 'react-redux';
|
import {Provider} from 'react-redux';
|
||||||
import {IOSDeviceParams} from 'flipper-common';
|
import {IOSDeviceParams} from 'flipper-common';
|
||||||
import {getRenderHostInstance} from '../../RenderHost';
|
import {getRenderHostInstance} from 'flipper-frontend-core';
|
||||||
import SettingsSheet from '../../chrome/SettingsSheet';
|
import SettingsSheet from '../../chrome/SettingsSheet';
|
||||||
import {Link} from '../../ui';
|
import {Link} from '../../ui';
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import {LaunchEmulatorDialog} from '../LaunchEmulator';
|
|||||||
|
|
||||||
import {createRootReducer} from '../../../reducers';
|
import {createRootReducer} from '../../../reducers';
|
||||||
import {sleep} from 'flipper-plugin';
|
import {sleep} from 'flipper-plugin';
|
||||||
import {getRenderHostInstance} from '../../../RenderHost';
|
import {getRenderHostInstance} from 'flipper-frontend-core';
|
||||||
|
|
||||||
test('Can render and launch android apps - no emulators', async () => {
|
test('Can render and launch android apps - no emulators', async () => {
|
||||||
const store = createStore(createRootReducer());
|
const store = createStore(createRootReducer());
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ import {CopyOutlined} from '@ant-design/icons';
|
|||||||
import {getVersionString} from './utils/versionString';
|
import {getVersionString} from './utils/versionString';
|
||||||
import {PersistGate} from 'redux-persist/integration/react';
|
import {PersistGate} from 'redux-persist/integration/react';
|
||||||
import {setLoggerInstance, FlipperServer} from 'flipper-common';
|
import {setLoggerInstance, FlipperServer} from 'flipper-common';
|
||||||
import {getRenderHostInstance} from './RenderHost';
|
import {getRenderHostInstance} from 'flipper-frontend-core';
|
||||||
import {startGlobalErrorHandling} from './utils/globalErrorHandling';
|
import {startGlobalErrorHandling} from './utils/globalErrorHandling';
|
||||||
import {loadTheme} from './utils/loadTheme';
|
import {loadTheme} from './utils/loadTheme';
|
||||||
import {connectFlipperServerToStore} from './dispatcher/flipperServer';
|
import {connectFlipperServerToStore} from './dispatcher/flipperServer';
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import {debounce} from 'lodash';
|
|||||||
import ToggleButton from '../ToggleSwitch';
|
import ToggleButton from '../ToggleSwitch';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import {Layout, theme, Toolbar} from 'flipper-plugin';
|
import {Layout, theme, Toolbar} from 'flipper-plugin';
|
||||||
import {getRenderHostInstance} from '../../../RenderHost';
|
import {getRenderHostInstance} from 'flipper-frontend-core';
|
||||||
|
|
||||||
const SearchBar = styled(Toolbar)({
|
const SearchBar = styled(Toolbar)({
|
||||||
height: 42,
|
height: 42,
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ import {debounce} from 'lodash';
|
|||||||
import {DEFAULT_ROW_HEIGHT} from './types';
|
import {DEFAULT_ROW_HEIGHT} from './types';
|
||||||
import {notNull} from '../../../utils/typeUtils';
|
import {notNull} from '../../../utils/typeUtils';
|
||||||
import {getFlipperLib, textContent} from 'flipper-plugin';
|
import {getFlipperLib, textContent} from 'flipper-plugin';
|
||||||
import {getRenderHostInstance} from '../../../RenderHost';
|
import {getRenderHostInstance} from 'flipper-frontend-core';
|
||||||
|
|
||||||
const EMPTY_OBJECT = {};
|
const EMPTY_OBJECT = {};
|
||||||
Object.freeze(EMPTY_OBJECT);
|
Object.freeze(EMPTY_OBJECT);
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ import {ClientQuery} from 'flipper-common';
|
|||||||
import ShareSheetExportUrl from '../chrome/ShareSheetExportUrl';
|
import ShareSheetExportUrl from '../chrome/ShareSheetExportUrl';
|
||||||
import ShareSheetExportFile from '../chrome/ShareSheetExportFile';
|
import ShareSheetExportFile from '../chrome/ShareSheetExportFile';
|
||||||
import ExportDataPluginSheet from '../chrome/ExportDataPluginSheet';
|
import ExportDataPluginSheet from '../chrome/ExportDataPluginSheet';
|
||||||
import {getRenderHostInstance} from '../RenderHost';
|
import {getRenderHostInstance} from 'flipper-frontend-core';
|
||||||
import {uploadFlipperMedia} from '../fb-stubs/user';
|
import {uploadFlipperMedia} from '../fb-stubs/user';
|
||||||
|
|
||||||
export const IMPORT_FLIPPER_TRACE_EVENT = 'import-flipper-trace';
|
export const IMPORT_FLIPPER_TRACE_EVENT = 'import-flipper-trace';
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
import {assertNever, DownloadFileUpdate} from 'flipper-common';
|
import {assertNever, DownloadFileUpdate} from 'flipper-common';
|
||||||
import {FlipperLib, DownloadFileResponse} from 'flipper-plugin';
|
import {FlipperLib, DownloadFileResponse} from 'flipper-plugin';
|
||||||
import {RenderHost} from '../../RenderHost';
|
import {RenderHost} from 'flipper-frontend-core';
|
||||||
|
|
||||||
export const downloadFileFactory =
|
export const downloadFileFactory =
|
||||||
(renderHost: RenderHost): FlipperLib['remoteServerContext']['downloadFile'] =>
|
(renderHost: RenderHost): FlipperLib['remoteServerContext']['downloadFile'] =>
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import constants from '../../fb-stubs/constants';
|
|||||||
import {addNotification} from '../../reducers/notifications';
|
import {addNotification} from '../../reducers/notifications';
|
||||||
import {deconstructPluginKey} from 'flipper-common';
|
import {deconstructPluginKey} from 'flipper-common';
|
||||||
import {DetailSidebarImpl} from '../../sandy-chrome/DetailSidebarImpl';
|
import {DetailSidebarImpl} from '../../sandy-chrome/DetailSidebarImpl';
|
||||||
import {RenderHost} from '../../RenderHost';
|
import {RenderHost} from 'flipper-frontend-core';
|
||||||
import {setMenuEntries} from '../../reducers/connections';
|
import {setMenuEntries} from '../../reducers/connections';
|
||||||
import {downloadFileFactory} from './downloadFile';
|
import {downloadFileFactory} from './downloadFile';
|
||||||
import {Base64} from 'js-base64';
|
import {Base64} from 'js-base64';
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
* @format
|
* @format
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {getRenderHostInstance} from '../RenderHost';
|
import {getRenderHostInstance} from 'flipper-frontend-core';
|
||||||
import {IconSize} from '../ui/components/Glyph';
|
import {IconSize} from '../ui/components/Glyph';
|
||||||
|
|
||||||
const AVAILABLE_SIZES: IconSize[] = [8, 10, 12, 16, 18, 20, 24, 32];
|
const AVAILABLE_SIZES: IconSize[] = [8, 10, 12, 16, 18, 20, 24, 32];
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
import type {State, Store} from '../reducers/index';
|
import type {State, Store} from '../reducers/index';
|
||||||
import {sideEffect} from './sideEffect';
|
import {sideEffect} from './sideEffect';
|
||||||
import {Logger, deconstructClientId} from 'flipper-common';
|
import {Logger, deconstructClientId} from 'flipper-common';
|
||||||
import {getRenderHostInstance} from '../RenderHost';
|
import {getRenderHostInstance} from 'flipper-frontend-core';
|
||||||
|
|
||||||
type PlatformInfo = {
|
type PlatformInfo = {
|
||||||
arch: string;
|
arch: string;
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
import {PluginDetails} from 'flipper-common';
|
import {PluginDetails} from 'flipper-common';
|
||||||
import semver from 'semver';
|
import semver from 'semver';
|
||||||
import {getRenderHostInstance} from '../RenderHost';
|
import {getRenderHostInstance} from 'flipper-frontend-core';
|
||||||
import {getAppVersion} from './info';
|
import {getAppVersion} from './info';
|
||||||
|
|
||||||
export function isPluginCompatible(plugin: PluginDetails) {
|
export function isPluginCompatible(plugin: PluginDetails) {
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
* @format
|
* @format
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {getRenderHostInstance} from '../RenderHost';
|
import {getRenderHostInstance} from 'flipper-frontend-core';
|
||||||
|
|
||||||
export default function isProduction() {
|
export default function isProduction() {
|
||||||
return getRenderHostInstance().serverConfig.environmentInfo.isProduction;
|
return getRenderHostInstance().serverConfig.environmentInfo.isProduction;
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import {Settings} from 'flipper-common';
|
import {Settings} from 'flipper-common';
|
||||||
import {getRenderHostInstance} from '../RenderHost';
|
import {getRenderHostInstance} from 'flipper-frontend-core';
|
||||||
|
|
||||||
export function loadTheme(theme: Settings['darkMode']) {
|
export function loadTheme(theme: Settings['darkMode']) {
|
||||||
let shouldUseDarkMode = false;
|
let shouldUseDarkMode = false;
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import {
|
|||||||
reportPlatformFailures,
|
reportPlatformFailures,
|
||||||
FlipperDoctor,
|
FlipperDoctor,
|
||||||
} from 'flipper-common';
|
} from 'flipper-common';
|
||||||
import {getRenderHostInstance} from '../RenderHost';
|
import {getRenderHostInstance} from 'flipper-frontend-core';
|
||||||
|
|
||||||
let healthcheckIsRunning: boolean;
|
let healthcheckIsRunning: boolean;
|
||||||
let runningHealthcheck: Promise<void>;
|
let runningHealthcheck: Promise<void>;
|
||||||
|
|||||||
@@ -7,9 +7,8 @@
|
|||||||
* @format
|
* @format
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {BaseDevice} from 'flipper-frontend-core';
|
import {BaseDevice, getRenderHostInstance} from 'flipper-frontend-core';
|
||||||
import {reportPlatformFailures} from 'flipper-common';
|
import {reportPlatformFailures} from 'flipper-common';
|
||||||
import {getRenderHostInstance} from '../RenderHost';
|
|
||||||
import {getFlipperLib, path} from 'flipper-plugin';
|
import {getFlipperLib, path} from 'flipper-plugin';
|
||||||
import {assertNotNull} from './assertNotNull';
|
import {assertNotNull} from './assertNotNull';
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import {useStore} from './useStore';
|
import {useStore} from './useStore';
|
||||||
import {getRenderHostInstance} from '../RenderHost';
|
import {getRenderHostInstance} from 'flipper-frontend-core';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This hook returns whether dark mode is currently being used.
|
* This hook returns whether dark mode is currently being used.
|
||||||
|
|||||||
Reference in New Issue
Block a user