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
@@ -10,8 +10,8 @@
|
||||
import stream from 'stream';
|
||||
import {
|
||||
DeviceLogEntry,
|
||||
SandyDevicePluginInstance,
|
||||
SandyPluginDefinition,
|
||||
_SandyDevicePluginInstance,
|
||||
_SandyPluginDefinition,
|
||||
DeviceType,
|
||||
DeviceLogListener,
|
||||
} from 'flipper-plugin';
|
||||
@@ -66,9 +66,9 @@ export default class BaseDevice {
|
||||
// sorted list of supported device plugins
|
||||
devicePlugins: string[] = [];
|
||||
|
||||
sandyPluginStates: Map<string, SandyDevicePluginInstance> = new Map<
|
||||
sandyPluginStates: Map<string, _SandyDevicePluginInstance> = new Map<
|
||||
string,
|
||||
SandyDevicePluginInstance
|
||||
_SandyDevicePluginInstance
|
||||
>();
|
||||
|
||||
supportsOS(os: OS) {
|
||||
@@ -175,12 +175,12 @@ export default class BaseDevice {
|
||||
}
|
||||
|
||||
loadDevicePlugin(plugin: DevicePluginDefinition) {
|
||||
if (plugin instanceof SandyPluginDefinition) {
|
||||
if (plugin instanceof _SandyPluginDefinition) {
|
||||
if (plugin.asDevicePluginModule().supportsDevice(this as any)) {
|
||||
this.devicePlugins.push(plugin.id);
|
||||
this.sandyPluginStates.set(
|
||||
plugin.id,
|
||||
new SandyDevicePluginInstance(
|
||||
new _SandyDevicePluginInstance(
|
||||
getFlipperLibImplementation(),
|
||||
plugin,
|
||||
this,
|
||||
|
||||
Reference in New Issue
Block a user