Summary:
Device plugins have an activate and deactivate hook, that reflects the plugin being selected in the UI. Added these same hooks to client plugins as well. In practice they are called at the same times as `onConnect` and `onDisconnect`, except for background plugins, which connect only once, so it is pretty useful to be still able to make the distinction.
Since there is now quite some common functionality between plugins and device plugins, will clean things a bit up in a next diff
[Interesting] as it explains the difference between the different lifecycle methods of plugins, and the impact of being a background plugin
LIfecycle summary:
1. app connects
2. for background plugins: connect them (`onConnect`)
3. user selects a plugin, triggers `onActivate`. will also trigger `onConnect` the plugin if it _isnt_ a bg plugin
4. user selects a different plugin, triggers `onDeactivate`. will also trigger `onDisconnect` if it isn't a bg plugin.
5. app is unloaded. Triggers `onDisconnect` for bg plugins. Triggers `onDestroy` for all plugins,
Reviewed By: jknoxville
Differential Revision: D22724791
fbshipit-source-id: 9fe2e666eb37fa2e0bd00fa61d78d2d4b1080137
Summary:
This diff makes sure that devices will actually instantiate applicable sandy device plugins. Similar to how client plugins are owned by Client, device plugins are directly owned by BaseDevice, which significantly simplifies life cycle management and doesn't dispatch updates to all Redux connect components whenever something irrelevant changes.
Also made sure `device.teardown()` is called. That API already existed, but wasn't used or implemented before.
Updated Flipper test utils to support testing device plugins as well (both Sandy and classic ones)
Reviewed By: passy, nikoant
Differential Revision: D22693929
fbshipit-source-id: 73b2b8666ef7a0e748ea89360db84734d37eb5be
Summary:
Fix long standing issue where text by default in Flipper is not selectable. Which is super annoying when working with tables, trying to copy error messages, etc etc. Wanted to fix it with ant.design, but got so annoyed by not being able to select an error I needed, that I fixed it now :-P.
This diff makes all text selectable by default, and then bails out for specific elements, like section headers, button captions, the left toolbar (navigation) and top toolbar to preserve the desktop app look & feel.
Fixes a popular papercut issue
Changelog: All text is now selectable by default in Flipper.
Reviewed By: passy
Differential Revision: D22897793
fbshipit-source-id: 7bc50a987e012595956c07d1997959a5480790aa
Summary:
This diff adds several improvements to displaying requests / responses in the network plugin
1. If there is no formatter rendering the data, the data is rendered 'raw'
2. For binary data, `(binary data)` text is printed, rather than an empty box
3. For request that have an empty request / response, `(empty)` is printed, rather than an empty box
4. If a formatter is applied, we show which formatter was used, which makes it easier to debug / spot / report issues
5. If the graphql formatter can't parse the data because it is truncated, it won't return anything, so that it falls back to the next formatter (urlencoder) to take care of the presentation
Changelog: [Network plugin] Improved presentation of request / response bodies and fixed issues where they would sometimes not be displayed.
Reviewed By: jknoxville
Differential Revision: D22865373
fbshipit-source-id: 912d2f27269a4c9edbf62f2039d46ccf90a008af
Summary:
This was originally done in https://github.com/facebook/flipper/pull/377 to support chinese characters, but it's not clear how it works, or what problem specifically it is trying to solve.
It's causing some problems where valid responses are failing to be "decoded", so I'm removing it.
Reviewed By: mweststrate
Differential Revision: D22866879
fbshipit-source-id: a19a57b0ddba2b9f434eb3c37e6b92da1dfbef01
Summary: Adds a toggle switch to show/hide disk cache images defaulting to inactive. The image data is only sent on the adb connection when the toggle is activated.
Reviewed By: defHLT
Differential Revision: D20002059
fbshipit-source-id: 05c9e515ffe09441e5cfb6f66eb14559ac4a322c
Summary:
Convert section plugin to Sandy API.
TODO
- Fix layout issues
- scrollbar occurs in small component (bottom layout)
- scrollbar in wrong place (top layout)
- text shrunk in bottom part of tree component
- (?) move away from d3
- better typing for payload
- move components to functional one
- unit test
Reviewed By: mweststrate
Differential Revision: D22385993
fbshipit-source-id: 862d4b775caf2d9a7bcb37446299251965a5d6db
Summary:
This adds support for handling incoming deeplinks in a Sandy plugin, which can be done by using a `client.onDeepLink(deepLink => { } )` listener
Also generalized deeplinks to not just support strings, but also richer objects, which is beneficial to plugin to plugin linking.
Reviewed By: jknoxville
Differential Revision: D22524749
fbshipit-source-id: 2cbe8d52f6eac91a1c1c8c8494706952920b9181
Summary: Created a communication between Layout Plugin and Flipper Desktop. The API allows users to open given file in a selected IDE. The openInIDE function returns true if the connection with Flipper is established, otherwise returns false.
Reviewed By: adityasharat
Differential Revision: D22625829
fbshipit-source-id: feaf186c107d62b1a75dfc6bbe2c1d66ffd7fd78
Summary:
Trying to get our OSS report green and lodash is currently flagged as a security issue on GH.
Manually merged the different PRs on GitHub together.
Reviewed By: jonathoma
Differential Revision: D22599614
fbshipit-source-id: ea4c9abf21aade14cff9338b78b764b181193227
Summary:
let's finally inspect flipper with flipper!
Here we have:
1) a self inspection client which implements FlipperClient interface from js sdk and FlipperClientConnection. It links back and front parts of self inspection
2) simple plugin (UI) to show messages
3) back part of that plugin - it sends all received messages to UI part via client
4) we initialize self inspection for dev builds only
P. S. filesystem dependency will be replaced with npm one before I ship it (need to publish to npm first)
Reviewed By: mweststrate
Differential Revision: D22524533
fbshipit-source-id: 5c77e2f7b50e24ff7314e791a4dfe3c349dccdee
Summary:
This diff makes sure Sandy plugins show up as well in the plugin selector when making exports (and in support form as well).
Also verified that this works with the Sandy updated section plugin.
Note that persisted state now didn't need any changes in the plugin code to work :)
Commented / simplified the calculation of available plugins a little bit and fixed a confusing issue where two different redux stores where created in one unit test, which caused an issue in the new implementation.
Reviewed By: jknoxville
Differential Revision: D22434301
fbshipit-source-id: c911196bc5b105309e82204188f124f40aab487a
Summary:
Created a few breakages. Would appreciate some closer eyes on this.
Pull Request resolved: https://github.com/facebook/flipper/pull/1366
Reviewed By: mweststrate
Differential Revision: D22501454
fbshipit-source-id: 9b882a12aecc65da85f29101bf87bf27519a7d2a
Summary: Unit tests with `.electron.tsx` are not run locally, as it is assumed they need Electron (?). However, since FBLogger is stubbed by default, it looks they all are actually runnable locally now.
Reviewed By: jknoxville
Differential Revision: D22431234
fbshipit-source-id: 9376923255bb96e2d7fc3bc8c3ec09962a07739c
Summary:
While reading through the Inspector I found this prop passed down and not used anywhere
printer_shredder
Reviewed By: Katalune
Differential Revision: D22431895
fbshipit-source-id: 6cbc97b3faec26349a1ad900ffa455e95f53bb2b
Summary:
Flipper reads metadata to show on the sidebar from `package.json` and static fields (`id`, `title`, and `icon`) from `FlipperPlugin` class. If there are fields declared in both file, `FlipperPlugin` class takes precedences.
With Sandy (new Flipper plugin API), there is no static field available. In order to prevent unexpected scenario happening when migrating to Sandy, this codemod-ish is applied to plugins that contain static field.
The static fields are merged into `package.json` to get the same result. In addition, the static fields are also removed.
Reviewed By: mweststrate
Differential Revision: D22411845
fbshipit-source-id: b6f043e74358a9a66d5d466a17252820d712b71c
Summary:
Flipper reads metadata to show on the sidebar from `package.json` and static fields (`id`, `title`, and `icon`) from `FlipperPlugin` class. If there are fields declared in both file, `FlipperPlugin` class takes precedences.
With Sandy (new Flipper plugin API), there is no static field available. In order to prevent unexpected scenario happening when migrating to Sandy, this codemod-ish is applied to plugins that contain static field.
The static fields are merged into `package.json` to get the same result. In addition, the static fields are also removed.
Reviewed By: mweststrate
Differential Revision: D22411856
fbshipit-source-id: 491d93fbe6393a7e9eded91208fdd71990402bb9
Summary:
Flipper reads metadata to show on the sidebar from `package.json` and static fields (`id`, `title`, and `icon`) from `FlipperPlugin` class. If there are fields declared in both file, `FlipperPlugin` class takes precedences.
With Sandy (new Flipper plugin API), there is no static field available. In order to prevent unexpected scenario happening when migrating to Sandy, this codemod-ish is applied to plugins that contain static field.
The static fields are merged into `package.json` to get the same result. In addition, the static fields are also removed.
Reviewed By: eleweek
Differential Revision: D22411839
fbshipit-source-id: efce530bb25def9a10ba8d85c48b31ee8657daa7
Summary:
Flipper reads metadata to show on the sidebar from `package.json` and static fields (`id`, `title`, and `icon`) from `FlipperPlugin` class. If there are fields declared in both file, `FlipperPlugin` class takes precedences.
With Sandy (new Flipper plugin API), there is no static field available. In order to prevent unexpected scenario happening when migrating to Sandy, this codemod-ish is applied to plugins that contain static field.
The static fields are merged into `package.json` to get the same result. In addition, the static fields are also removed.
Reviewed By: rickhanlonii
Differential Revision: D22411862
fbshipit-source-id: cb381261f575313110b781c2fddd3a2099e6479a
Summary:
Converted the Seammammals plugin to use Sandy plugin infra (but the old components). Also updated lock file.
Added unittests have been added as well. The UI snapshots in there are kinda overkill, but nice demo that it works.
This completes the full roundtrip of the new Sandy infra, so this will be the last diff of this stack. I promise. I think.
Reviewed By: nikoant
Differential Revision: D22308265
fbshipit-source-id: 260e91a1951d486f6689880fe25281e80a71806a
Summary: Unit tests tend to randomly bail out once FBLogger is (indirectly) required by some module under test. This makes sure FBLogger is stubbed by default. We might want to do the same for `User` in the future.
Reviewed By: jknoxville
Differential Revision: D22186274
fbshipit-source-id: 2ede364c4b691d69826781355592226b075d8367
Summary: Removed back "prepack" script from every plugin package to keep it simple. Instead we will use `build-plugin` command defined in the root package.json (see next diff in the stack).
Reviewed By: mweststrate
Differential Revision: D22160252
fbshipit-source-id: cffb5df65b89df3fe390c051da0df797b3d16d2d
Summary: Fixed direct source import of Flipper code from layout plugin which broke its packaging
Reviewed By: cekkaewnumchai
Differential Revision: D22135716
fbshipit-source-id: 8f67a21ed94c13dd73d24ef8692d37ae51963319
Summary: D22047276 introduced a new way to adding log data column depending on how one sorts by time. This diff adds unit test to test the logic
Reviewed By: passy
Differential Revision: D22068114
fbshipit-source-id: 3fe01beec69d45d96f2fc2a437c3f408686565a3
Summary:
This is a discussion on Github about reversing log. This diff tries to do that.
Changelog: Add ability to reverse log by time
Reviewed By: mweststrate
Differential Revision: D22047276
fbshipit-source-id: 6100a5ca40db223d1989be2746c7190cce7ffc53
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/1267
Bumped versions of all plugins to match current Flipper version 0.46.0.
Reviewed By: mweststrate
Differential Revision: D22042959
fbshipit-source-id: 37c169bfd1b90debb8f94c9465a345a015524158
Summary: All the plugins migrated to spec v2 to allow packaging/publishing them independently from Flipper releases.
Reviewed By: passy
Differential Revision: D22041384
fbshipit-source-id: 23bfaf724f771a57bd628b9ea1c4d37846534a93
Summary:
See previous diffs, same change as with analytics, don't stringify when creating the rows, but rather provide a closure to do that lazily, which reduces CPU (and mem) usage.
Note that this implicitly assumes the captures variables are immutable, as otherwise the semantics would change. But than again, if those variables are changed in the future, copyText will reflect their latest rather than initial state, which is better anyway.
Reviewed By: nikoant
Differential Revision: D21931748
fbshipit-source-id: 62325dd25953bab3a4e2e9a0d5dea3b3a7787bae
Summary: Single quotes need to be double to be correctly recognized in queries. #thanks mweststrate for reminding me
Reviewed By: mweststrate
Differential Revision: D21908315
fbshipit-source-id: 6c13f9ddb527d1144cc3df90ba48bdb5f2ed4952
Summary:
In D21788243, John suggested the field should be calculated when needed not precomputed. This diff does so by moving calculation logic to the component and removing the field
This also fixes the crashing bug when switching to Structure tab, changing table, and switching back to Data tab.
Reviewed By: mweststrate
Differential Revision: D21906983
fbshipit-source-id: 5a9522a5ba3f504108282fb27deae25b5eadc693
Summary:
Fixes a regression (D21716761) in the layout of the accessibility inspector where the layout was accidentally switched from right to bottom.
Also made the region resizable while at it.
Changelog: Fix regression in the layout plugin where accessibility info was rendered in the wrong place
Reviewed By: cekkaewnumchai
Differential Revision: D21903760
fbshipit-source-id: 08623c17428e86ea77d8438e78766a308dbac1e6
Summary:
per title
Also, edit file to match tests
Reviewed By: mweststrate
Differential Revision: D21819748
fbshipit-source-id: b697ae9915c53162624ba90fc867676c9ca8733b
Summary: To be able to edit correct cell, identifiers are needed. Assume that the primary key is unique, this should be safe to allow the query to find exactly one row to edit
Reviewed By: jknoxville
Differential Revision: D21788239
fbshipit-source-id: b09d1b6da1b46cbc961f08010467e973546acbef
Summary: This diff adds edit button to detail sidebar to allow user to edit column he/she wants to
Reviewed By: jknoxville
Differential Revision: D21788243
fbshipit-source-id: 4bdcef62114d5a6282ba85bc2bd1b5d039322e50
Summary:
This logic relies on the logic on client side, specifically `SqliteDatabaseDriver.java` in specifying some keys to retrieve useful data in `currentStructure`. This will be error-prone if developer writes their own data driver which doesn't follow the same naming as the data driver used as model.
Also, this diff adds util file to deal with query for updating database on client side.
I decided to construct query clause on server side so that the client side change is not needed.
Reviewed By: jknoxville
Differential Revision: D21788241
fbshipit-source-id: cf9a920c3e5b7b29f619bc3f00e68616b3445cab
Summary: The different is small after the change from storing pre-rendered data to raw data. Hence, the diff changes it to match `currentPage` to ease the assignment (used in next diffs)
Reviewed By: jknoxville
Differential Revision: D21788245
fbshipit-source-id: 87bdbce33f0615bf31878797a74fce5d5969db7b
Summary: `'Execute'` action was previously used only for execute tab which assumed the input will come from the state. This changes so that it can take any input attached to parameters (more explanation about the design in <insert diff number>)
Reviewed By: jknoxville
Differential Revision: D21788244
fbshipit-source-id: 8fb8ecb8f8df84f4854f70432e7a1fdb531403e9