Export power search enabled components and types by default
Summary: Provides power search typings to all users by default Reviewed By: LukeDefeo Differential Revision: D51306600 fbshipit-source-id: c1f0d318d8b6953dd02af16d2c51abbf0e6e9590
This commit is contained in:
committed by
Facebook GitHub Bot
parent
b34718ac32
commit
bfc4e959bc
@@ -13,10 +13,10 @@ import {
|
||||
usePlugin,
|
||||
createDataSource,
|
||||
dataTablePowerSearchOperators,
|
||||
_DataTableColumnWithPowerSearch,
|
||||
_DataTableWithPowerSearch,
|
||||
DataTableColumn,
|
||||
DataTable,
|
||||
theme,
|
||||
_DataTableWithPowerSearchManager,
|
||||
DataTableManager,
|
||||
createState,
|
||||
useValue,
|
||||
DataFormatter,
|
||||
@@ -48,7 +48,7 @@ const logLevelEnumLabels = Object.entries(logTypes).reduce(
|
||||
|
||||
function createColumnConfig(
|
||||
_os: 'iOS' | 'Android' | 'Metro',
|
||||
): _DataTableColumnWithPowerSearch<ExtendedLogEntry>[] {
|
||||
): DataTableColumn<ExtendedLogEntry>[] {
|
||||
return [
|
||||
{
|
||||
key: 'type',
|
||||
@@ -153,7 +153,7 @@ export function devicePlugin(client: DevicePluginClient) {
|
||||
});
|
||||
const isPaused = createState(true);
|
||||
const tableManagerRef = createRef<
|
||||
undefined | _DataTableWithPowerSearchManager<ExtendedLogEntry>
|
||||
undefined | DataTableManager<ExtendedLogEntry>
|
||||
>();
|
||||
|
||||
client.onDeepLink((payload: unknown) => {
|
||||
@@ -264,7 +264,7 @@ export function Component() {
|
||||
const plugin = usePlugin(devicePlugin);
|
||||
const paused = useValue(plugin.isPaused);
|
||||
return (
|
||||
<_DataTableWithPowerSearch<ExtendedLogEntry>
|
||||
<DataTable<ExtendedLogEntry>
|
||||
dataSource={plugin.rows}
|
||||
columns={plugin.columns}
|
||||
enableAutoScroll
|
||||
|
||||
@@ -28,9 +28,9 @@ import {
|
||||
usePlugin,
|
||||
useValue,
|
||||
createDataSource,
|
||||
_DataTableWithPowerSearch as DataTable,
|
||||
_DataTableColumnWithPowerSearch as DataTableColumn,
|
||||
_DataTableWithPowerSearchManager as DataTableManager,
|
||||
DataTable,
|
||||
DataTableColumn,
|
||||
DataTableManager,
|
||||
theme,
|
||||
renderReactRoot,
|
||||
batch,
|
||||
|
||||
@@ -7,11 +7,7 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
import {
|
||||
Atom,
|
||||
_DataTableWithPowerSearchManager as DataTableManager,
|
||||
getFlipperLib,
|
||||
} from 'flipper-plugin';
|
||||
import {Atom, DataTableManager, getFlipperLib} from 'flipper-plugin';
|
||||
import {createContext} from 'react';
|
||||
import {Header, Request} from '../types';
|
||||
|
||||
|
||||
@@ -9,12 +9,11 @@
|
||||
|
||||
import {DeleteOutlined, PartitionOutlined} from '@ant-design/icons';
|
||||
import {
|
||||
_DataTableWithPowerSearch as DataTable,
|
||||
DataTable,
|
||||
DataTableColumn,
|
||||
DetailSidebar,
|
||||
Layout,
|
||||
_DataTableColumnWithPowerSearch,
|
||||
_DataTableWithPowerSearchManager,
|
||||
DataTableManager,
|
||||
dataTablePowerSearchOperators,
|
||||
usePlugin,
|
||||
useValue,
|
||||
@@ -44,10 +43,9 @@ export function FrameworkEventsTable({
|
||||
|
||||
const focusedNode = useValue(instance.uiState.focusedNode);
|
||||
|
||||
const managerRef =
|
||||
useRef<_DataTableWithPowerSearchManager<AugmentedFrameworkEvent> | null>(
|
||||
null,
|
||||
);
|
||||
const managerRef = useRef<DataTableManager<AugmentedFrameworkEvent> | null>(
|
||||
null,
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
tracker.track('framework-event-table-opened', {});
|
||||
@@ -175,74 +173,73 @@ const inferredEnum = [
|
||||
dataTablePowerSearchOperators.enum_is_not({}),
|
||||
];
|
||||
|
||||
const staticColumns: _DataTableColumnWithPowerSearch<AugmentedFrameworkEvent>[] =
|
||||
[
|
||||
{
|
||||
key: 'timestamp',
|
||||
sortable: true,
|
||||
onRender: (row: FrameworkEvent) => formatTimestampMillis(row.timestamp),
|
||||
title: 'Timestamp',
|
||||
formatters: MonoSpace,
|
||||
const staticColumns: DataTableColumn<AugmentedFrameworkEvent>[] = [
|
||||
{
|
||||
key: 'timestamp',
|
||||
sortable: true,
|
||||
onRender: (row: FrameworkEvent) => formatTimestampMillis(row.timestamp),
|
||||
title: 'Timestamp',
|
||||
formatters: MonoSpace,
|
||||
|
||||
powerSearchConfig: [
|
||||
dataTablePowerSearchOperators.newer_than_absolute_date(),
|
||||
dataTablePowerSearchOperators.older_than_absolute_date(),
|
||||
],
|
||||
powerSearchConfig: [
|
||||
dataTablePowerSearchOperators.newer_than_absolute_date(),
|
||||
dataTablePowerSearchOperators.older_than_absolute_date(),
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'type',
|
||||
title: 'Event type',
|
||||
onRender: (row: FrameworkEvent) => eventTypeToName(row.type),
|
||||
powerSearchConfig: {
|
||||
inferEnumOptionsFromData: true,
|
||||
operators: inferredEnum,
|
||||
},
|
||||
{
|
||||
key: 'type',
|
||||
title: 'Event type',
|
||||
onRender: (row: FrameworkEvent) => eventTypeToName(row.type),
|
||||
powerSearchConfig: {
|
||||
inferEnumOptionsFromData: true,
|
||||
operators: inferredEnum,
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'duration',
|
||||
title: 'Duration (Nanos)',
|
||||
onRender: (row: FrameworkEvent) =>
|
||||
row.duration != null ? formatDuration(row.duration) : null,
|
||||
formatters: MonoSpace,
|
||||
},
|
||||
{
|
||||
key: 'duration',
|
||||
title: 'Duration (Nanos)',
|
||||
onRender: (row: FrameworkEvent) =>
|
||||
row.duration != null ? formatDuration(row.duration) : null,
|
||||
formatters: MonoSpace,
|
||||
|
||||
powerSearchConfig: [
|
||||
dataTablePowerSearchOperators.int_greater_or_equal(),
|
||||
dataTablePowerSearchOperators.int_greater_than(),
|
||||
dataTablePowerSearchOperators.int_equals(),
|
||||
dataTablePowerSearchOperators.int_less_or_equal(),
|
||||
dataTablePowerSearchOperators.int_less_than(),
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'treeId',
|
||||
title: 'TreeId',
|
||||
powerSearchConfig: idConfig,
|
||||
powerSearchConfig: [
|
||||
dataTablePowerSearchOperators.int_greater_or_equal(),
|
||||
dataTablePowerSearchOperators.int_greater_than(),
|
||||
dataTablePowerSearchOperators.int_equals(),
|
||||
dataTablePowerSearchOperators.int_less_or_equal(),
|
||||
dataTablePowerSearchOperators.int_less_than(),
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'treeId',
|
||||
title: 'TreeId',
|
||||
powerSearchConfig: idConfig,
|
||||
|
||||
formatters: MonoSpace,
|
||||
},
|
||||
{
|
||||
key: 'rootComponentName',
|
||||
title: 'Root component name',
|
||||
powerSearchConfig: stringConfig,
|
||||
formatters: MonoSpace,
|
||||
},
|
||||
{
|
||||
key: 'nodeId',
|
||||
title: 'Component ID',
|
||||
powerSearchConfig: idConfig,
|
||||
formatters: MonoSpace,
|
||||
},
|
||||
{
|
||||
key: 'nodeName',
|
||||
title: 'Component name',
|
||||
powerSearchConfig: stringConfig,
|
||||
formatters: MonoSpace,
|
||||
},
|
||||
{
|
||||
key: 'thread',
|
||||
title: 'Thread',
|
||||
onRender: (row: FrameworkEvent) => startCase(row.thread),
|
||||
powerSearchConfig: stringConfig,
|
||||
formatters: MonoSpace,
|
||||
},
|
||||
];
|
||||
formatters: MonoSpace,
|
||||
},
|
||||
{
|
||||
key: 'rootComponentName',
|
||||
title: 'Root component name',
|
||||
powerSearchConfig: stringConfig,
|
||||
formatters: MonoSpace,
|
||||
},
|
||||
{
|
||||
key: 'nodeId',
|
||||
title: 'Component ID',
|
||||
powerSearchConfig: idConfig,
|
||||
formatters: MonoSpace,
|
||||
},
|
||||
{
|
||||
key: 'nodeName',
|
||||
title: 'Component name',
|
||||
powerSearchConfig: stringConfig,
|
||||
formatters: MonoSpace,
|
||||
},
|
||||
{
|
||||
key: 'thread',
|
||||
title: 'Thread',
|
||||
onRender: (row: FrameworkEvent) => startCase(row.thread),
|
||||
powerSearchConfig: stringConfig,
|
||||
formatters: MonoSpace,
|
||||
},
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user