Update to pure Sandy and update custom docs

Summary: Per title

Reviewed By: priteshrnandgaonkar

Differential Revision: D28991625

fbshipit-source-id: cab9cf59d1d053e2f8a47c588cb05abc44a527cc
This commit is contained in:
Michel Weststrate
2021-06-09 07:25:19 -07:00
committed by Facebook GitHub Bot
parent a0c872dd38
commit d2095d5937
5 changed files with 11 additions and 33 deletions

View File

@@ -5,7 +5,7 @@
"private": true,
"version": "0.0.0",
"main": "dist/bundle.js",
"flipperBundlerEntry": "src/index_table.tsx",
"flipperBundlerEntry": "src/index_custom.tsx",
"license": "MIT",
"keywords": [
"flipper-plugin"

View File

@@ -7,27 +7,6 @@
* @format
*/
// eslint-disable-next-line
import {act} from '@testing-library/react';
{
// These mocks are needed because seammammals still uses Flipper in its UI implementation,
// so we need to mock some things
const origRequestIdleCallback = window.requestIdleCallback;
const origCancelIdleCallback = window.cancelIdleCallback;
// @ts-ignore
window.requestIdleCallback = (fn: () => void) => {
// the synchronous implementation forces DataInspector to render in sync
act(fn);
};
// @ts-ignore
window.cancelIdleCallback = clearImmediate;
afterAll(() => {
window.requestIdleCallback = origRequestIdleCallback;
window.cancelIdleCallback = origCancelIdleCallback;
});
}
import {TestUtils} from 'flipper-plugin';
import * as MammalsPlugin from '../index_custom';

View File

@@ -17,8 +17,9 @@ import {
useValue,
theme,
styled,
DataInspector,
DetailSidebar,
} from 'flipper-plugin';
import {ManagedDataInspector, DetailSidebar} from 'flipper';
type Row = {
id: number;
@@ -47,10 +48,9 @@ export function plugin(client: PluginClient<Events, {}>) {
handler: async () => {
const selection = selectedID.get();
if (selection) {
const url = await client.createPaste(
await client.createPaste(
JSON.stringify(rows.get()[selection], null, 2),
);
alert(url); // TODO: use notifications T69990351
}
},
},
@@ -105,7 +105,7 @@ function renderSidebar(row: Row) {
return (
<Layout.Container gap pad>
<Typography.Title level={4}>Extras</Typography.Title>
<ManagedDataInspector data={row} expandRoot />
<DataInspector data={row} expandRoot />
</Layout.Container>
);
}