Commit Graph

22 Commits

Author SHA1 Message Date
Lorenzo Blasa
ff6f98fc0d Import File implementation
Summary: Implementation was missing for the browser. This provides a default implementation.

Reviewed By: aigoncharov

Differential Revision: D48311198

fbshipit-source-id: fd067600f571234e0fbccfb90853b62f175ff8fb
2023-08-14 11:33:06 -07:00
Lukas Kurucz
279a9e6b52 fix: prefixed plugin package name (#4811)
Summary:
When distributing plugin over Marketplace. Currently there is an issue with downloading a plugin to `tmp` folder if the plugin `packageName` starts with `company-prefix/flipper-plugin-name`. It would throw `ENONET` error while trying to stream the response data into `tmp` folder.

## Changelog

- add support for prefixed plugin package names (`shopify/flipper-plugin-name`,...)

Pull Request resolved: https://github.com/facebook/flipper/pull/4811

Test Plan: - Try install a plugin from Marketplace which has `/` in the plugin `package.json` `name`.

Reviewed By: lblasa

Differential Revision: D46679195

Pulled By: passy

fbshipit-source-id: f330896dae9da7cbe101b1c6d7ed07667fb7ae0a
2023-06-13 03:53:18 -07:00
Michel Weststrate
6196204a7b Plugin download failure is not an error
Summary: Plugin download failure is typical a transient error, no need to trigger monitoring for that

Reviewed By: ivanmisuno

Differential Revision: D43118116

fbshipit-source-id: 0cd0f87f0ed6123adcba28139308ecea92b1b508
2023-02-10 02:22:50 -08:00
Lorenzo Blasa
587f428cf8 Allow plugins to use css
Summary:
Flipper plugins fail when importing css from third-party dependencies. This diff tries to fix that.

Effectively, the plugin can import the css and export it when is bundled.

When we load the plugin, we check if there's a css file for it. If there's one, we return it and try to use it.

Reviewed By: aigoncharov

Differential Revision: D40758178

fbshipit-source-id: e53afffcc481504905d5eeb1aea1f9114ee2a86b
2022-10-27 22:50:30 -07:00
Andrey Goncharov
a888e6affa Simplify bundled plugin setup
Summary: Stop bundling plugins into Flipper Server bundles. In later diffs, we will start building all plugins even in dev mode which removes the need to bundle them.

Reviewed By: lblasa

Differential Revision: D39276249

fbshipit-source-id: 091405cfcf58aa7e1bd2b382da40f8d9841ae6b1
2022-09-15 10:02:19 -07:00
Lorenzo Blasa
b9e1039b7a Load marketplace plugins from PluginManager
Summary: Expand PluginManager as to be able to load and install plugins from Marketplace.

Reviewed By: passy

Differential Revision: D37749802

fbshipit-source-id: 7d7e23427cc9d01f5c953b90e5b346a9d6bab19f
2022-07-11 07:04:55 -07:00
Anton Nikolaev
37ff34390a Enable Marketplace for Flipper (#3491)
Summary:
This is PR on top of: https://github.com/facebook/flipper/pull/3473

It adds an option to Settings to allow distribution of marketplace plugins.

Also includes a simple fetch function to retrieve data from external API/server.

## Changelog

Allow marketplace plugins

Pull Request resolved: https://github.com/facebook/flipper/pull/3491

Test Plan:
1. Enable marketplace
2. Provide custom marketplace server (it will serve the list of internal plugins with downloadURL)
3. Test if can see Available plugins and can download/remove the plugin
4. If new update for the plugin, it should also allow auto update

Reviewed By: antonk52

Differential Revision: D34586339

Pulled By: nikoant

fbshipit-source-id: c887982aa0f0f9abd3b5360f22e8692a2445d345
2022-03-07 02:49:49 -08:00
Andrey Goncharov
9e4ac0aaa9 Add unit tests for PluginManager
Reviewed By: mweststrate

Differential Revision: D34307076

fbshipit-source-id: 7cb6c808bea10d15627958e8fabc02b4563183d4
2022-02-28 03:50:34 -08:00
Andrey Goncharov
81d0057a8d Fix potential race conditions for starting/stopping server add-ons
Reviewed By: mweststrate

Differential Revision: D34301593

fbshipit-source-id: 2950de8a8567318cd3e87eff176657df5ba8fd1b
2022-02-28 03:50:34 -08:00
Andrey Goncharov
8b94186783 Load installed server add-ons
Reviewed By: nikoant

Differential Revision: D34300475

fbshipit-source-id: 6bb6c0ab811e28806a0924b3487931bdb0dd2c59
2022-02-28 03:50:34 -08:00
Andrey Goncharov
04eab80c98 Move server add-on interfaces to flipper-common
Reviewed By: antonk52

Differential Revision: D34169419

fbshipit-source-id: 69fcc8da7d98f59818fbb5b486a488f19830cd81
2022-02-28 03:50:34 -08:00
Andrey Goncharov
db976d5113 Implement sending messages from a server add-on
Reviewed By: mweststrate

Differential Revision: D34074383

fbshipit-source-id: de85e7a22dc9bb780163fc5b522708e8bc976df3
2022-02-28 03:50:34 -08:00
Andrey Goncharov
12151e4a71 Extend Flipper commands to support server add-on messaging
Reviewed By: mweststrate

Differential Revision: D34046466

fbshipit-source-id: 9acc172c1805ec724b8709999bacf9e899c39e6b
2022-02-28 03:50:34 -08:00
Andrey Goncharov
3b390b74ff Track client connections and autostop server add-ons when all clients leave
Reviewed By: mweststrate

Differential Revision: D34045584

fbshipit-source-id: 1ad0cfffb9d304f0359c973d76d6956f7e932f72
2022-02-28 03:50:34 -08:00
Andrey Goncharov
a60865f0be Intergrate ServerAddOn with PluginManager
Reviewed By: lblasa

Differential Revision: D34042338

fbshipit-source-id: 2ae3992738e647075f19c4dba0ebfb01e6c12b8f
2022-02-28 03:50:34 -08:00
Andrey Goncharov
fc20abf392 Add Flipper server command definitions
Reviewed By: lblasa

Differential Revision: D33980529

fbshipit-source-id: b64f48134d4816d3502c70d15beff90a044490a4
2022-02-28 03:50:34 -08:00
Andres Suarez
79023ee190 Update copyright headers from Facebook to Meta
Reviewed By: bhamodi

Differential Revision: D33331422

fbshipit-source-id: 016e8dcc0c0c7f1fc353a348b54fda0d5e2ddc01
2021-12-27 14:31:45 -08:00
Michel Weststrate
dcfeb4a4d5 Clean up packages and types
Summary:
This diff removes most deps from the root package.json, which now only contains electron and shared build / test infra structure: lint, prettier, jest, typescript.

This makes it possible to control much better which packages are used where, as all sub packages now have their deps explicitly in their package.json instead of incidentally shared. This allows for example to disable DOM types for all packages by default (flipper-plugin, ui(-core) and app still request it), and in the next diff I hope to add to this that nodeJS types are no longer shared either, so that UI oriented packages will generate compile errors when using Node built-ins

This diff removes most deps that were currently unused, and dedupes a bunch of other ones, so the build should probably be a bit smaller now as well:

{F686704253}

{F686704295}

Reviewed By: antonk52

Differential Revision: D33062859

fbshipit-source-id: 5afaa4f2103d055188382a3370c1fffa295a298a
2021-12-16 14:54:59 -08:00
Michel Weststrate
7e9ad72baa Fix --no-bundled-plugins was not respected
Summary: Even with the `--no-bundled-plugins` flag, still a hundred plugins were loaded when running flipper-server

Reviewed By: timur-valiev, aigoncharov

Differential Revision: D32987158

fbshipit-source-id: 19e51e7e5f8ec9e664eb48cf2f2b8936f2f5ed73
2021-12-13 05:48:17 -08:00
Michel Weststrate
ad4a55f263 move node types, stub node modules
Summary: This diff stubs all node modules when running in the browser, so that, albeit with a lot of errors and without plugins, the UI loads in a browser. To be continued in the rest of this diff

Reviewed By: antonk52

Differential Revision: D32665705

fbshipit-source-id: 4632e241f59c5b9712a41d01a26878afb01f69b5
2021-12-08 04:30:57 -08:00
Michel Weststrate
de59bbedd2 Make plugin loading async
Summary: This diff makes plugin loading async, which we'd need in a browser env (either because we'd use `import()` or we need to fetch the source and than eval it), and deals with all the fallout of that

Reviewed By: timur-valiev

Differential Revision: D32669995

fbshipit-source-id: 73babf38a6757c451b8200c3b320409f127b8b5b
2021-12-08 04:30:56 -08:00
Michel Weststrate
64747dc417 move plugin management from ui-core to server-core
Summary:
Follow up of D32665064, this diff moves all plugin management logic from flipper-ui to flipper-server. Things like downloading, installing, querying new plugins.

Loading plugins is handled separately in the next diff.

Reviewed By: nikoant

Differential Revision: D32666537

fbshipit-source-id: 9786b82987f00180bb26200e38735b334dc4d5c3
2021-12-08 04:30:56 -08:00