Update public docs to use Sandy
Summary: This updates the docs of Flipper to use Sandy, rather than `FlipperPlugin` class. Restructured the docs a bit as a result. Reviewed By: passy Differential Revision: D24991285 fbshipit-source-id: 66d5760c25cf9cf3983515433dfd64348d51db3d
This commit is contained in:
committed by
Facebook GitHub Bot
parent
da6d6593a5
commit
cc438e60ad
@@ -94,8 +94,8 @@ test('It generates the correct files', async () => {
|
||||
"/dev/null/src/__tests__/test.spec.tsx": "import {TestUtils} from 'flipper-plugin';
|
||||
import * as Plugin from '..';
|
||||
|
||||
// Read more: https://fbflipper.com/docs/extending/desktop-plugins#testing-plugin-logic
|
||||
// API: https://fbflipper.com/docs/extending/desktop-plugins#testing-plugin-logic
|
||||
// Read more: https://fbflipper.com/docs/tutorial/js-custom#testing-plugin-logic
|
||||
// API: https://fbflipper.com/docs/tutorial/js-custom#testing-plugin-logic
|
||||
test('It can store data', () => {
|
||||
const {instance, sendEvent} = TestUtils.startPlugin(Plugin);
|
||||
|
||||
@@ -116,8 +116,8 @@ test('It generates the correct files', async () => {
|
||||
\`);
|
||||
});
|
||||
|
||||
// Read more: https://fbflipper.com/docs/extending/desktop-plugins#testing-plugin-logic
|
||||
// API: https://fbflipper.com/docs/extending/desktop-plugins#testing-plugin-logic
|
||||
// Read more: https://fbflipper.com/docs/tutorial/js-custom#testing-plugin-logic
|
||||
// API: https://fbflipper.com/docs/tutorial/js-custom#testing-plugin-logic
|
||||
test('It can render data', async () => {
|
||||
const {instance, renderer, sendEvent} = TestUtils.renderPlugin(Plugin);
|
||||
|
||||
@@ -148,7 +148,7 @@ test('It generates the correct files', async () => {
|
||||
newData: Data;
|
||||
};
|
||||
|
||||
// Read more: https://fbflipper.com/docs/extending/desktop-plugins#creating-a-first-plugin
|
||||
// Read more: https://fbflipper.com/docs/tutorial/js-custom#creating-a-first-plugin
|
||||
// API: https://fbflipper.com/docs/extending/flipper-plugin#pluginclient
|
||||
export function plugin(client: PluginClient<Events, {}>) {
|
||||
const data = createState<Record<string, Data>>({}, {persist: 'data'});
|
||||
@@ -169,7 +169,7 @@ test('It generates the correct files', async () => {
|
||||
return {data};
|
||||
}
|
||||
|
||||
// Read more: https://fbflipper.com/docs/extending/desktop-plugins#building-a-user-interface-for-the-plugin
|
||||
// Read more: https://fbflipper.com/docs/tutorial/js-custom#building-a-user-interface-for-the-plugin
|
||||
// API: https://fbflipper.com/docs/extending/flipper-plugin#react-hooks
|
||||
export function Component() {
|
||||
const instance = usePlugin(plugin);
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import {TestUtils} from 'flipper-plugin';
|
||||
import * as Plugin from '..';
|
||||
|
||||
// Read more: https://fbflipper.com/docs/extending/desktop-plugins#testing-plugin-logic
|
||||
// API: https://fbflipper.com/docs/extending/desktop-plugins#testing-plugin-logic
|
||||
// Read more: https://fbflipper.com/docs/tutorial/js-custom#testing-plugin-logic
|
||||
// API: https://fbflipper.com/docs/tutorial/js-custom#testing-plugin-logic
|
||||
test('It can store data', () => {
|
||||
const {instance, sendEvent} = TestUtils.startPlugin(Plugin);
|
||||
|
||||
@@ -23,8 +23,8 @@ test('It can store data', () => {
|
||||
`);
|
||||
});
|
||||
|
||||
// Read more: https://fbflipper.com/docs/extending/desktop-plugins#testing-plugin-logic
|
||||
// API: https://fbflipper.com/docs/extending/desktop-plugins#testing-plugin-logic
|
||||
// Read more: https://fbflipper.com/docs/tutorial/js-custom#testing-plugin-logic
|
||||
// API: https://fbflipper.com/docs/tutorial/js-custom#testing-plugin-logic
|
||||
test('It can render data', async () => {
|
||||
const {instance, renderer, sendEvent} = TestUtils.renderPlugin(Plugin);
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ type Events = {
|
||||
newData: Data;
|
||||
};
|
||||
|
||||
// Read more: https://fbflipper.com/docs/extending/desktop-plugins#creating-a-first-plugin
|
||||
// Read more: https://fbflipper.com/docs/tutorial/js-custom#creating-a-first-plugin
|
||||
// API: https://fbflipper.com/docs/extending/flipper-plugin#pluginclient
|
||||
export function plugin(client: PluginClient<Events, {}>) {
|
||||
const data = createState<Record<string, Data>>({}, {persist: 'data'});
|
||||
@@ -31,7 +31,7 @@ export function plugin(client: PluginClient<Events, {}>) {
|
||||
return {data};
|
||||
}
|
||||
|
||||
// Read more: https://fbflipper.com/docs/extending/desktop-plugins#building-a-user-interface-for-the-plugin
|
||||
// Read more: https://fbflipper.com/docs/tutorial/js-custom#building-a-user-interface-for-the-plugin
|
||||
// API: https://fbflipper.com/docs/extending/flipper-plugin#react-hooks
|
||||
export function Component() {
|
||||
const instance = usePlugin(plugin);
|
||||
|
||||
Reference in New Issue
Block a user