Revert RN-only

Summary: ^

Reviewed By: aigoncharov

Differential Revision: D49953166

fbshipit-source-id: b08a09b89e3b857f633e62bbc5b63064c3657aa4
This commit is contained in:
Lorenzo Blasa
2023-10-05 07:14:03 -07:00
committed by Facebook GitHub Bot
parent c05fe8cb53
commit 4b078a4472
7 changed files with 179 additions and 118 deletions

View File

@@ -291,10 +291,10 @@ async function waitForLogin(store: Store) {
async function verifyFlipperIsUpToDate(title: string) {
const serverConfig = getRenderHostInstance().serverConfig;
// If this is not a headless build, do not check for updates.
if (!serverConfig.environmentInfo.isHeadlessBuild) {
return;
}
// // If this is not a headless build, do not check for updates.
// if (!serverConfig.environmentInfo.isHeadlessBuild) {
// return;
// }
const config = serverConfig.processConfig;
if (
!isProduction() ||

View File

@@ -103,8 +103,7 @@ export const Navbar = withTrackingScope(function Navbar() {
<TroubleshootMenu />
<ExtrasMenu />
<RightSidebarToggleButton />
{getRenderHostInstance().serverConfig.environmentInfo
.isHeadlessBuild && <UpdateIndicator />}
<UpdateIndicator />
</Layout.Horizontal>
</Layout.Horizontal>
);

View File

@@ -15,32 +15,31 @@ import {
Layout,
Dialog,
_PortalsManager,
getFlipperLib,
styled,
} from 'flipper-plugin';
import {Link, styled} from '../ui';
import {theme} from 'flipper-plugin';
import {isProduction, Logger} from 'flipper-common';
import {Logger} from 'flipper-common';
import {Navbar} from './Navbar';
import {useStore} from '../utils/useStore';
import {AppInspect} from './appinspect/AppInspect';
import PluginContainer from '../PluginContainer';
import {ContentContainer} from './ContentContainer';
import {showChangelog} from '../chrome/ChangelogSheet';
import PlatformSelectWizard, {
hasPlatformWizardBeenDone,
} from '../chrome/PlatformSelectWizard';
import {getVersionString} from '../utils/versionString';
import config from '../fb-stubs/config';
import {WelcomeScreenStaticView} from './WelcomeScreen';
import {isFBEmployee} from '../utils/fbEmployee';
import {Button, Modal, notification} from 'antd';
import {getRenderHostInstance} from 'flipper-frontend-core';
import {WarningOutlined} from '@ant-design/icons';
import PWAInstallationWizard, {
shouldShowPWAInstallationWizard,
} from '../chrome/PWAppInstallationWizard';
import {showChangelog} from '../chrome/ChangelogSheet';
import {Link} from '../ui';
import {getVersionString} from '../utils/versionString';
import config from '../fb-stubs/config';
import {WelcomeScreenStaticView} from './WelcomeScreen';
import fbConfig from '../fb-stubs/config';
import {isFBEmployee} from '../utils/fbEmployee';
import {notification} from 'antd';
import isProduction from '../utils/isProduction';
import {getRenderHostInstance} from 'flipper-frontend-core';
export function SandyApp() {
const logger = useLogger();
@@ -49,17 +48,10 @@ export function SandyApp() {
);
const staticView = useStore((state) => state.connections.staticView);
const serverConfig = getRenderHostInstance().serverConfig;
useEffect(() => {
let title = `Flipper (${getVersionString()}${
document.title = `Flipper (${getVersionString()}${
config.isFBBuild ? '@FB' : ''
})`;
if (!serverConfig.environmentInfo.isHeadlessBuild) {
title += ' (Unsupported)';
}
document.title = title;
registerStartupTime(logger);
@@ -79,55 +71,17 @@ export function SandyApp() {
Dialog.showModal((onHide) => <PWAInstallationWizard onHide={onHide} />);
}
if (serverConfig.environmentInfo.isHeadlessBuild) {
showChangelog(true);
}
showChangelog(true);
// don't warn about logger, even with a new logger we don't want to re-register
// eslint-disable-next-line
}, []);
useEffect(() => {
isFBEmployee()
.then((isEmployee) => {
if (isEmployee) {
if (!serverConfig.environmentInfo.isHeadlessBuild) {
Dialog.showModal((onHide) => (
<Modal
closable={false}
keyboard={false} // Don't allow escape to close modal
maskClosable={false} // Don't allow clicking away
open
centered
onCancel={() => onHide()}
width={570}
title={
<>
<WarningOutlined /> This Version of Flipper is Unsupported
</>
}
footer={
<>
<Button
type="primary"
onClick={() => {
getFlipperLib().openLink('munki://detail-Flipper');
onHide();
}}>
Open Flipper Stable instead
</Button>
<Button type="ghost" onClick={() => onHide()}>
I understand
</Button>
</>
}>
This version is only meant to be used for React Native
debugging. It is not maintained and it doesn't receive updates.
Instead, you should be using the main Flipper version from
Managed Software Center for all other purposes.
</Modal>
));
} else if (fbConfig.warnFBEmployees && isProduction()) {
if (fbConfig.warnFBEmployees && isProduction()) {
isFBEmployee()
.then((isEmployee) => {
if (isEmployee) {
notification.warning({
placement: 'bottomLeft',
message: 'Please use Flipper@FB',
@@ -144,11 +98,11 @@ export function SandyApp() {
duration: null,
});
}
}
})
.catch((e) => {
console.warn('Failed to check if user is employee', e);
});
})
.catch((e) => {
console.warn('Failed to check if user is employee', e);
});
}
}, []);
return (

View File

@@ -160,7 +160,7 @@ function WelcomeScreenContent() {
}}
width={125}
height={125}
src={isHeadlessBuild ? './icon.png' : './icon-rn-only.png'}
src={isHeadlessBuild ? './icon.png' : './icon.png'}
preview={false}
/>
<Title level={1}>Welcome to Flipper</Title>