From 5b4179d4823dbbbdb13a9975f3eb2a634983ca64 Mon Sep 17 00:00:00 2001 From: Michel Weststrate Date: Fri, 25 Jun 2021 04:34:08 -0700 Subject: [PATCH] Move plugin installer away from immutable Summary: Trying to get rid of immutable_table, which is used in only 3 places. One of them being the plugin installer. Reviewed By: jknoxville Differential Revision: D29295534 fbshipit-source-id: dfae9476635c3a8ebba9f1439905bae693fdfd57 --- .../chrome/plugin-manager/PluginInstaller.tsx | 11 +- .../PluginInstaller.node.tsx.snap | 462 +++++++++--------- 2 files changed, 241 insertions(+), 232 deletions(-) diff --git a/desktop/app/src/chrome/plugin-manager/PluginInstaller.tsx b/desktop/app/src/chrome/plugin-manager/PluginInstaller.tsx index 43a442dd9..ac7fa97e5 100644 --- a/desktop/app/src/chrome/plugin-manager/PluginInstaller.tsx +++ b/desktop/app/src/chrome/plugin-manager/PluginInstaller.tsx @@ -10,22 +10,21 @@ import { FlexColumn, styled, - ManagedTable_immutable, SearchInput, SearchBox, Button, colors, Spacer, - TableRows_immutable, FlexRow, Glyph, Link, Text, LoadingIndicator, Tooltip, + TableRows, + ManagedTable, } from '../../ui'; import React, {useCallback, useState, useEffect} from 'react'; -import {List} from 'immutable'; import {reportPlatformFailures, reportUsage} from '../../utils/metrics'; import reloadFlipper from '../../utils/reloadFlipper'; import {registerInstalledPlugins} from '../../reducers/plugins'; @@ -144,7 +143,7 @@ const PluginInstaller = function ({ /> - void, installedPlugins: Map, -): TableRows_immutable { +): TableRows { useEffect(() => { reportUsage(`${TAG}:open`); }, []); @@ -358,7 +357,7 @@ function useNPMSearch( })(); }, [query, installedPlugins]); - const rows: TableRows_immutable = List(searchResults.map(createRow)); + const rows = searchResults.map(createRow); return rows; } diff --git a/desktop/app/src/chrome/plugin-manager/__tests__/__snapshots__/PluginInstaller.node.tsx.snap b/desktop/app/src/chrome/plugin-manager/__tests__/__snapshots__/PluginInstaller.node.tsx.snap index dcec721ae..715488f21 100644 --- a/desktop/app/src/chrome/plugin-manager/__tests__/__snapshots__/PluginInstaller.node.tsx.snap +++ b/desktop/app/src/chrome/plugin-manager/__tests__/__snapshots__/PluginInstaller.node.tsx.snap @@ -20,7 +20,8 @@ exports[`load PluginInstaller list 1`] = `
- - hello - -
-
- - 0.1.0 - -
-
- World? + hello - -
- -
-
-
-
- - world - -
-
- - 0.2.0 - -
-
- Hello? + 0.1.0 +
+
- + + World? + +
+
- +
+
+ + 0.2.0 + +
+
+
+ + Hello? + +
+ +
+ +
+
+
+ +
@@ -322,7 +327,8 @@ exports[`load PluginInstaller list with one plugin installed 1`] = `
- - hello - -
-
- - 0.1.0 - -
-
- World? + hello - -
- -
-
-
-
- - world - -
-
- - 0.2.0 - -
-
- Hello? + 0.1.0 +
+
- + + World? + +
+
- +
+
+ + 0.2.0 + +
+
+
+ + Hello? + +
+ +
+ +
+
+
+ +