Device plugin management (1/n): use static metadata for checking plugin compatibility with devices
Summary: *Stack summary*: this stack adds ability to manage device plugins in the same way as client plugins: install, update, uninstall, enable (star) and disable (unstar) them. *Diff summary*: changed the way how plugin compatibility with devices is checked from dynamic call to "supportsDevice" to static checks of "supportedDevices" metadata property which make it possible to check compatibility without even downloading plugin from Marketplace. Changelog: plugin compatibility with devices is now checked according to metadata in property "supportedDevices" in package.json Reviewed By: mweststrate Differential Revision: D26315848 fbshipit-source-id: 6e4b052c4ea0507ee185fc17999b6211cdb11093
This commit is contained in:
committed by
Facebook GitHub Bot
parent
19f2fccc79
commit
899fcd0783
@@ -1333,7 +1333,7 @@ test('Sandy plugins are imported properly', async () => {
|
||||
});
|
||||
|
||||
const sandyDeviceTestPlugin = new _SandyPluginDefinition(
|
||||
TestUtils.createMockPluginDetails(),
|
||||
TestUtils.createMockPluginDetails({pluginType: 'device'}),
|
||||
{
|
||||
supportsDevice: () => true,
|
||||
devicePlugin(client: DevicePluginClient) {
|
||||
@@ -1536,7 +1536,7 @@ test('Sandy plugin with custom import', async () => {
|
||||
|
||||
test('Sandy device plugin with custom import', async () => {
|
||||
const plugin = new _SandyPluginDefinition(
|
||||
TestUtils.createMockPluginDetails(),
|
||||
TestUtils.createMockPluginDetails({pluginType: 'device'}),
|
||||
{
|
||||
supportsDevice: () => true,
|
||||
devicePlugin(client: DevicePluginClient) {
|
||||
@@ -1665,7 +1665,10 @@ test('Sandy plugins with complex data are imported / exported correctly', async
|
||||
|
||||
test('Sandy device plugins with complex data are imported / exported correctly', async () => {
|
||||
const deviceplugin = new _SandyPluginDefinition(
|
||||
TestUtils.createMockPluginDetails({id: 'deviceplugin'}),
|
||||
TestUtils.createMockPluginDetails({
|
||||
id: 'deviceplugin',
|
||||
pluginType: 'device',
|
||||
}),
|
||||
{
|
||||
supportsDevice() {
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user