Make sure that limited top-level exports are exposed from flipper-plugin
Summary: This prefixes APIs of `flipper-plugin`, that are used by Flipper, but should not be used by plugins directly, with `_`. Also added tests to make sure we are always intentional when extending the exposed APIs Reviewed By: passy Differential Revision: D24991700 fbshipit-source-id: ed3700efa188fca7f5a14d5c68250598cf011e42
This commit is contained in:
committed by
Facebook GitHub Bot
parent
cc438e60ad
commit
45db64f0d0
@@ -21,10 +21,10 @@ import {getPluginKey} from '../pluginUtils';
|
||||
import {TestIdler} from '../Idler';
|
||||
import {registerPlugins} from '../../reducers/plugins';
|
||||
import {
|
||||
SandyPluginDefinition,
|
||||
_SandyPluginDefinition,
|
||||
TestUtils,
|
||||
PluginClient,
|
||||
SandyPluginInstance,
|
||||
_SandyPluginInstance,
|
||||
} from 'flipper-plugin';
|
||||
|
||||
type Events = {
|
||||
@@ -47,7 +47,7 @@ function plugin(client: PluginClient<Events, {}>) {
|
||||
};
|
||||
}
|
||||
|
||||
const TestPlugin = new SandyPluginDefinition(
|
||||
const TestPlugin = new _SandyPluginDefinition(
|
||||
TestUtils.createMockPluginDetails(),
|
||||
{
|
||||
plugin,
|
||||
@@ -211,7 +211,7 @@ test('queue - events are NOT processed immediately if plugin is NOT selected (bu
|
||||
});
|
||||
|
||||
test('queue - events ARE processed immediately if plugin is NOT selected / enabled BUT NAVIGATION', async () => {
|
||||
const NavigationPlugin = new SandyPluginDefinition(
|
||||
const NavigationPlugin = new _SandyPluginDefinition(
|
||||
TestUtils.createMockPluginDetails({
|
||||
id: 'Navigation',
|
||||
}),
|
||||
@@ -599,7 +599,7 @@ test('client - incoming messages are buffered and flushed together', async () =>
|
||||
}
|
||||
`);
|
||||
expect(client.messageBuffer[pluginKey].plugin).toBeInstanceOf(
|
||||
SandyPluginInstance,
|
||||
_SandyPluginInstance,
|
||||
);
|
||||
|
||||
await sleep(500);
|
||||
|
||||
Reference in New Issue
Block a user