Commit Graph

26 Commits

Author SHA1 Message Date
Daniel Büchele
64cefd0f84 migrate redux store
Summary: Migrating redux stores to TypeScript

Reviewed By: passy

Differential Revision: D16579796

fbshipit-source-id: e3e507f17f1bdd57eb45e30cb0b28aaee6c4521c
2019-08-08 08:07:21 -07:00
Pritesh Nandgaonkar
e7198040ea Add UI to select plugins
Summary: Adds UI to the select the plugin to export. It lists the plugins which has currently some data in the redux store and it also lists those plugins which has implemented `exportPersistedState` function, as it might happen that the redux store may not have the data for a plugin but it will still export the data by calling `exportPersistedState`, which will ping the mobile client to get the data at point while we export the flipper trace.

Reviewed By: jknoxville

Differential Revision: D16468408

fbshipit-source-id: 452a7caf7199dd2b8df330bbb10d0a90008e92ec
2019-07-26 10:53:27 -07:00
Daniel Büchele
79414aa3e1 Bumped electron version
Summary:
We in React VR were need newer Chrome DevTools version to make our plugin work properly. Chromium version with required fixes were shipped in electron 5.0.0.

This diff bumps electron version and explicitly allows node integration (accessing require, process and other node related functions from window object in index.html), because it was disabled by default in 5.0.0.

Reviewed By: jknoxville

Differential Revision: D15693539

fbshipit-source-id: 4f71a07b2afaa489aec46940c924f4ad30ad0413
2019-06-10 10:36:25 -07:00
Sachin Irukula
ef510a7d90 Mapping create plugin tutorial to correct external URL
Summary: Previously "Create your own plugin" in welcome screen and "Create Plugins" in menu were directing to a URL https://fbflipper.com/docs/create-plugin.html which doesn't exist anymore. So pointing the URL to page for plugin creation tutorial https://fbflipper.com/docs/tutorial/intro.html

Reviewed By: jknoxville

Differential Revision: D15362962

fbshipit-source-id: 82a9dedb21911607f20884c9bb36e58d622e8431
2019-05-15 15:49:29 -07:00
Pritesh Nandgaonkar
45999a5292 Share sheet for the file export
Summary:
This diff shows an export sheet when one exports the Flipper data in a file. It also shows if any error happens.
Look at the video in test case.

Reviewed By: danielbuechele

Differential Revision: D14624194

fbshipit-source-id: dea0179a83e626e49593e5dde1d5ff128048db02
2019-04-01 08:53:37 -07:00
Pritesh Nandgaonkar
5964f1621e Open source Import/Export feature to open source
Summary: Exposes Import/Export feature to open source. This diff also makes sure that, "Shareable Link" option doesn't show up, as it is specific to fb's infrastructure.

Reviewed By: passy

Differential Revision: D14526634

fbshipit-source-id: 3aeb97c91bc00a9c5f01c74c34a5690ec3b5739d
2019-03-20 06:59:28 -07:00
Daniel Büchele
f30ff068a7 Show offline devices in dropdown
Summary:
This diff aims to make the selected device a little clearer, the button now shows different icons depending on the selected devices: physical, emulators and archived devices.

The dropdown now is grouped in these sections, depending on their availability:
- Connected Devices
- Running Emulators
- Imported Devices
- Launch Android emulators
- Open File...

"Open File..." allows to import a file the same way as File -> Open File...

Reviewed By: jknoxville

Differential Revision: D14460789

fbshipit-source-id: 8d6edff0d90d5e02e4ef5976af5680ab8eaf77b4
2019-03-15 11:30:38 -07:00
Pascal Hartig
3141b954bf Run prettier fix
Summary: Should also fix the build.

Reviewed By: jknoxville

Differential Revision: D14477777

fbshipit-source-id: 01fcfb2321c9b7a12acdf079473d91b6805d4dda
2019-03-15 05:13:30 -07:00
Daniel Büchele
aad970defd UI for sharable URLs
Summary:
Uploading the Flipper data could take some while. With the current implementation the user didn't know what was happening. This is why this diff immediately shows a sheet with a spinner, until the upload is finished.

The URL is still copied to the clipboard and a notifications is displayed. Additionally the user can copy the URL from the sheet.

Reviewed By: priteshrnandgaonkar

Differential Revision: D14441759

fbshipit-source-id: c853526a7da76e2dea5e1aaf6b6eff21e4268789
2019-03-14 04:22:15 -07:00
Daniel Büchele
b304126af3 Share Flipper file
Reviewed By: jknoxville

Differential Revision: D14340965

fbshipit-source-id: 9145ae8d409e9d4f8becfd1a19a8a9b3739af3fb
2019-03-06 05:54:21 -08:00
Pritesh Nandgaonkar
c098269533 Added telemetry for import and export
Summary: Adding telemetry for import and export feature

Reviewed By: jknoxville

Differential Revision: D14267533

fbshipit-source-id: 1a5e041d0dc8c59c325e7d80dc83f6135f479161
2019-03-04 05:08:19 -08:00
Pascal Hartig
dbb4fa1191 Fix typo
Summary: typo_gnome

Reviewed By: jknoxville

Differential Revision: D14224864

fbshipit-source-id: eab74df8fb7c48782a44b5284483ab67c205387e
2019-02-26 07:37:52 -08:00
John Knox
ee54a54ff2 Clean up log statement
Summary: Looks like a left over debug log

Reviewed By: danielbuechele

Differential Revision: D14086508

fbshipit-source-id: 6bf3ef40746d8d248ed38071107cae00ba3040f9
2019-02-15 04:32:43 -08:00
Pritesh Nandgaonkar
029377a849 Change the export file extension type
Summary: This diff imports and exports data in a `.flipper` file extension. This diff also adds the support to open flipper app by double clicking on the `.flipper` file.

Reviewed By: danielbuechele

Differential Revision: D14042846

fbshipit-source-id: 17e6b55bf2796d9abdf985411fce799600f7792b
2019-02-12 06:48:06 -08:00
Pritesh Nandgaonkar
d70e512889 Show save as dialog for export data
Summary: This diff adds support to specify custom location to save the flipper data to be exported

Reviewed By: passy

Differential Revision: D13916944

fbshipit-source-id: cfe816d07eb505d99c00f7798f3a97a2093ab265
2019-02-05 09:36:35 -08:00
Pritesh Nandgaonkar
9bc54597cf Import from exported file
Summary:
This diff adds the feature to import the exported flipper data. It has the following features

- Dialog to select the file
- Merges the data with an existing store.

Reviewed By: danielbuechele

Differential Revision: D13901944

fbshipit-source-id: 1b9755735419732a34254bdc39d911bcb51ad8fe
2019-02-05 09:36:35 -08:00
Pritesh Nandgaonkar
8957b55eda Gate Export Flipper data feature
Summary: This diff gates the flipper export feature behind a gk

Reviewed By: danielbuechele

Differential Revision: D13860474

fbshipit-source-id: b7eda655418ccfd03b7bac42f0f741864164ea29
2019-01-29 08:55:26 -08:00
Pritesh Nandgaonkar
5ef970e5b5 Serialize Store
Summary:
This diff adds the capability to export the flipper data to a file. With this diff you can click on the "Export Flipper" option from the "Edit" menu in menubar. It will export it in the file at this location

`~/.flipper/MessageLogs.json`

We do not exactly export the store, but just the important part of it. We export in the following format

```
{
fileVersion: '1.0',
device: {
   os: 'iOS',
   title: 'iPhone 7',
   serial: '',
   deviceType: 'physical',
  },
clients: [
   {
    query: {
       app: 'Facebook',
      },
      d: '12345678'
     },
   {
    query: {
       app: 'Instagram',
      },
    id: '12345678'
   }
],
store: {
   pluginState: {},
   notifications: {}
  }
}

```

In next diff I will add the capability to select the folder to export the file too.

Reviewed By: danielbuechele

Differential Revision: D13751963

fbshipit-source-id: 7d3d49c6adf8145b2181d2332c7dbd589155cec3
2019-01-28 15:43:24 -08:00
Daniel Büchele
7747a0714d plugin redux
Summary:
Plugins were loaded in `/plugins/index.js` which was loaded once at launch of the app. This moves the list of available plugins to redux. This way, plugins can be dynamically added. The redux store keeps to Maps of plugins (devicePlugins and clientPlugins) with their ID as key:

```
  devicePlugins: Map<string, Class<FlipperDevicePlugin<>>>,
  clientPlugins: Map<string, Class<FlipperPlugin<>>>,
```

On launch of the app, all plugins bundled with the app and the one found in `pluginsPath` are dynamically added.

This changes now allows to add new plugins at any time. All components that need to know which plugins are available (e.g. the sidebar) are connected to the redux store. This way, they will automatically update, whenever a new plugin is added.

- add `plugins` to the redux store to keep the list of available plugins
- add a plugins dispatcher, responsible for loading the plugins on launch
- connecting all React components that imported `plugins/index.js` before to the redux store to get the plugins from there.
- moved the updating of the MenuBar to the plugins dispatcher as it needs to update whenever a new plugin is added.

Reviewed By: jknoxville, passy

Differential Revision: D12449236

fbshipit-source-id: 6ef3e243e2c80443614b901ccbfde485fcb4301c
2018-11-15 07:30:05 -08:00
Alex Langenfeld
f3d2e0983e support user defined device plugins
Summary:
* move CPU and Logs plugin to plugins directory, set up package.json for them
* adjust plugins/index.js to expose device and client plugins in the same place, adding two new exports

Reviewed By: danielbuechele

Differential Revision: D10247606

fbshipit-source-id: 347bf8b3f9629987ad29d1d2ed025e0c88b9c967
2018-10-10 18:43:21 -07:00
Daniel Büchele
2e2924c979 SonarPlugin > FlipperPlugin
Summary:
Renaming:
- `SonarPlugin` > `FlipperPlugin`
- `SonarBasePlugin` > `FlipperBasePlugin`
- `SonarDevicePlugin` > `FlipperDevicePlugin`

Reviewed By: passy

Differential Revision: D9851075

fbshipit-source-id: d59df6952a42eb493c86c38895216c9985f1e14b
2018-09-18 07:01:16 -07:00
Daniel Büchele
134a0d96c5 renaming app to Flipper
Summary: rename all visible references of Sonar to Flipper. Changes endpoint URLs to the new repo address.

Reviewed By: passy

Differential Revision: D9082100

fbshipit-source-id: 2ab8b680a19c23d80050e8e768379c29d66acfca
2018-08-06 10:44:33 -07:00
Daniel Büchele
75dfbf51f8 electron flow type definitions
Summary: Adding a flowtype library definition for electron 3 and fixing related type errors

Reviewed By: passy

Differential Revision: D9124758

fbshipit-source-id: e09cb5b05ba952e7f95f68f9043edc586f81ae83
2018-08-02 03:57:52 -07:00
Daniel Büchele
5edb8bd770 clean up dynamic plugin loading
Summary:
There are 3 sources where plugins can be loaded from:
* `src/plugins`
* `src/fb/plugins`
* any path specified in `~/.sonar/config.json`

Plugins found in the first two directories are bundled with the app when building.

Reviewed By: jknoxville

Differential Revision: D8636061

fbshipit-source-id: 2064090d43d11695ffd99df195e5b594559fe087
2018-06-26 07:17:39 -07:00
Daniel Büchele
cbab597236 show only one device in sidbar
Summary:
Refactors the plugin architecture of Sonar:
- Before plugin rendering had it's own implementation of the react lifecycle. This means the `render`-function was not called by react, but rather by the application it self. In this diff, the render method is now called from react, which enables better debugging and allows react to do optimizations.
- Business logic for querying emulators is moved away from the view components into its own dispatcher
- All plugin handling is moved from `App.js` to `PluginContainer`.
- The sidebar only shows one selected device. This allows us to add the screenshot feature as part of the Sonar main app and not a plugin.
- This also fixes the inconsistency between the devices button and the sidebar

Reviewed By: jknoxville

Differential Revision: D8186933

fbshipit-source-id: 46404443025bcf18d6eeba0679e098d5440822d5
2018-06-25 10:04:00 -07:00
Daniel Büchele
fbbf8cf16b Initial commit 🎉
fbshipit-source-id: b6fc29740c6875d2e78953b8a7123890a67930f2
Co-authored-by: Sebastian McKenzie <sebmck@fb.com>
Co-authored-by: John Knox <jknox@fb.com>
Co-authored-by: Emil Sjölander <emilsj@fb.com>
Co-authored-by: Pritesh Nandgaonkar <prit91@fb.com>
2018-06-01 11:03:58 +01:00