Reload instead of restart to apply plugin changes
Summary: Now full restart is not required for applying plugin changes (install/uninstall/update). So this diff changes the behavior to use reload instead of restart in Plugin Manager and Auto Update Manager. It is much faster than full restart. Changelog: faster reload after plugin install/uninstall/update. Reviewed By: jknoxville Differential Revision: D23706701 fbshipit-source-id: b2dcaf7768a5d47b3c967c17e090fa74884b3850
This commit is contained in:
committed by
Facebook GitHub Bot
parent
df0508e826
commit
16a640b7ee
@@ -28,7 +28,7 @@ import {
|
||||
import React, {useCallback, useState, useEffect} from 'react';
|
||||
import {List} from 'immutable';
|
||||
import {reportPlatformFailures, reportUsage} from '../../utils/metrics';
|
||||
import restartFlipper from '../../utils/restartFlipper';
|
||||
import reloadFlipper from '../../utils/reloadFlipper';
|
||||
import {registerInstalledPlugins} from '../../reducers/pluginManager';
|
||||
import {
|
||||
UpdateResult,
|
||||
@@ -124,7 +124,7 @@ const PluginInstaller = function ({
|
||||
|
||||
const rows = useNPMSearch(query, onInstall, installedPlugins);
|
||||
const restartApp = useCallback(() => {
|
||||
restartFlipper();
|
||||
reloadFlipper();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
@@ -132,8 +132,7 @@ const PluginInstaller = function ({
|
||||
<Container>
|
||||
{restartRequired && (
|
||||
<RestartBar onClick={restartApp}>
|
||||
To activate this plugin, Flipper needs to restart. Click here to
|
||||
restart!
|
||||
To apply the changes, Flipper needs to reload. Click here to reload!
|
||||
</RestartBar>
|
||||
)}
|
||||
<Toolbar>
|
||||
|
||||
11
desktop/app/src/utils/reloadFlipper.tsx
Normal file
11
desktop/app/src/utils/reloadFlipper.tsx
Normal file
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* 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 {remote} from 'electron';
|
||||
export default () => remote.getCurrentWindow().reload();
|
||||
Reference in New Issue
Block a user