Remove plugin bundling
Summary: Remove the notion of bundled plugins Reviewed By: lblasa Differential Revision: D39308888 fbshipit-source-id: aa88ddbf2801ad1da95f89e4c761259b697b0d66
This commit is contained in:
committed by
Facebook GitHub Bot
parent
f835e07c46
commit
650ff4bcfb
@@ -776,7 +776,6 @@ test('test determinePluginsToProcess for mutilple clients having plugins present
|
||||
['RandomPlugin', TestPlugin.details],
|
||||
['TestDevicePlugin', TestDevicePlugin.details],
|
||||
]),
|
||||
bundledPlugins: new Map(),
|
||||
gatekeepedPlugins: [],
|
||||
disabledPlugins: [],
|
||||
failedPlugins: [],
|
||||
@@ -851,7 +850,6 @@ test('test determinePluginsToProcess for no selected plugin present in any clien
|
||||
['RandomPlugin', TestPlugin.details],
|
||||
['TestDevicePlugin', TestDevicePlugin.details],
|
||||
]),
|
||||
bundledPlugins: new Map(),
|
||||
gatekeepedPlugins: [],
|
||||
disabledPlugins: [],
|
||||
failedPlugins: [],
|
||||
@@ -905,7 +903,6 @@ test('test determinePluginsToProcess for multiple clients on same device', async
|
||||
['TestPlugin', TestPlugin.details],
|
||||
['TestDevicePlugin', TestDevicePlugin.details],
|
||||
]),
|
||||
bundledPlugins: new Map(),
|
||||
gatekeepedPlugins: [],
|
||||
disabledPlugins: [],
|
||||
failedPlugins: [],
|
||||
@@ -998,7 +995,6 @@ test('test determinePluginsToProcess for multiple clients on different device',
|
||||
['TestPlugin', TestPlugin.details],
|
||||
['TestDevicePlugin', TestDevicePlugin.details],
|
||||
]),
|
||||
bundledPlugins: new Map(),
|
||||
gatekeepedPlugins: [],
|
||||
disabledPlugins: [],
|
||||
failedPlugins: [],
|
||||
@@ -1085,7 +1081,6 @@ test('test determinePluginsToProcess to ignore archived clients', async () => {
|
||||
['TestPlugin', TestPlugin.details],
|
||||
['TestDevicePlugin', TestDevicePlugin.details],
|
||||
]),
|
||||
bundledPlugins: new Map(),
|
||||
gatekeepedPlugins: [],
|
||||
disabledPlugins: [],
|
||||
failedPlugins: [],
|
||||
|
||||
@@ -26,13 +26,6 @@ export function isPluginVersionMoreRecent(
|
||||
if (semver.gt(versionDetails.version, otherVersionDetails.version)) {
|
||||
return true;
|
||||
}
|
||||
if (
|
||||
semver.eq(versionDetails.version, otherVersionDetails.version) &&
|
||||
versionDetails.isBundled
|
||||
) {
|
||||
// prefer bundled versions
|
||||
return true;
|
||||
}
|
||||
if (
|
||||
semver.eq(versionDetails.version, otherVersionDetails.version) &&
|
||||
versionDetails.isActivatable &&
|
||||
|
||||
@@ -17,7 +17,6 @@ import {
|
||||
import type Client from '../Client';
|
||||
import type {
|
||||
ActivatablePluginDetails,
|
||||
BundledPluginDetails,
|
||||
DownloadablePluginDetails,
|
||||
PluginDetails,
|
||||
} from 'flipper-common';
|
||||
@@ -30,7 +29,7 @@ export type PluginLists = {
|
||||
enabledPlugins: PluginDefinition[];
|
||||
disabledPlugins: PluginDefinition[];
|
||||
unavailablePlugins: [plugin: PluginDetails, reason: string][];
|
||||
downloadablePlugins: (DownloadablePluginDetails | BundledPluginDetails)[];
|
||||
downloadablePlugins: DownloadablePluginDetails[];
|
||||
};
|
||||
|
||||
export type ActivePluginListItem =
|
||||
@@ -46,7 +45,7 @@ export type ActivePluginListItem =
|
||||
}
|
||||
| {
|
||||
status: 'uninstalled';
|
||||
details: DownloadablePluginDetails | BundledPluginDetails;
|
||||
details: DownloadablePluginDetails;
|
||||
}
|
||||
| {
|
||||
status: 'unavailable';
|
||||
@@ -162,7 +161,6 @@ export function computePluginLists(
|
||||
>,
|
||||
plugins: Pick<
|
||||
State['plugins'],
|
||||
| 'bundledPlugins'
|
||||
| 'marketplacePlugins'
|
||||
| 'loadedPlugins'
|
||||
| 'devicePlugins'
|
||||
@@ -180,12 +178,12 @@ export function computePluginLists(
|
||||
enabledPlugins: PluginDefinition[];
|
||||
disabledPlugins: PluginDefinition[];
|
||||
unavailablePlugins: [plugin: PluginDetails, reason: string][];
|
||||
downloadablePlugins: (DownloadablePluginDetails | BundledPluginDetails)[];
|
||||
downloadablePlugins: DownloadablePluginDetails[];
|
||||
} {
|
||||
const enabledDevicePluginsState = connections.enabledDevicePlugins;
|
||||
const enabledPluginsState = connections.enabledPlugins;
|
||||
const uninstalledMarketplacePlugins = getLatestCompatibleVersionOfEachPlugin(
|
||||
[...plugins.bundledPlugins.values(), ...plugins.marketplacePlugins],
|
||||
[...plugins.marketplacePlugins],
|
||||
getAppVersion(),
|
||||
).filter((p) => !plugins.loadedPlugins.has(p.id));
|
||||
const devicePlugins: PluginDefinition[] = [...plugins.devicePlugins.values()]
|
||||
@@ -205,10 +203,7 @@ export function computePluginLists(
|
||||
)
|
||||
.filter((p) => !enabledDevicePluginsState.has(p.id));
|
||||
const unavailablePlugins: [plugin: PluginDetails, reason: string][] = [];
|
||||
const downloadablePlugins: (
|
||||
| DownloadablePluginDetails
|
||||
| BundledPluginDetails
|
||||
)[] = [];
|
||||
const downloadablePlugins: DownloadablePluginDetails[] = [];
|
||||
|
||||
if (device) {
|
||||
// find all device plugins that aren't part of the current device / metro
|
||||
@@ -431,7 +426,6 @@ export type PluginStatus =
|
||||
| 'unknown'
|
||||
| 'failed'
|
||||
| 'gatekeeped'
|
||||
| 'bundle_installable'
|
||||
| 'marketplace_installable';
|
||||
|
||||
export function getPluginStatus(
|
||||
@@ -452,9 +446,6 @@ export function getPluginStatus(
|
||||
if (failedPluginEntry) {
|
||||
return ['failed', failedPluginEntry[1]];
|
||||
}
|
||||
if (state.bundledPlugins.has(id)) {
|
||||
return ['bundle_installable'];
|
||||
}
|
||||
if (state.marketplacePlugins.find((d) => d.id === id)) {
|
||||
return ['marketplace_installable'];
|
||||
}
|
||||
|
||||
@@ -56,7 +56,6 @@ export function createMockDownloadablePluginDetails(
|
||||
version: version,
|
||||
downloadUrl: `http://localhost/${lowercasedID}/${version}`,
|
||||
lastUpdated: lastUpdated,
|
||||
isBundled: false,
|
||||
isActivatable: false,
|
||||
isEnabledByDefault: false,
|
||||
};
|
||||
@@ -69,7 +68,6 @@ export function createMockActivatablePluginDetails(
|
||||
return {
|
||||
id: 'Hello',
|
||||
specVersion: 2,
|
||||
isBundled: false,
|
||||
isActivatable: true,
|
||||
dir: '/Users/mock/.flipper/thirdparty/flipper-plugin-sample1',
|
||||
entry: './test/index.js',
|
||||
|
||||
Reference in New Issue
Block a user