Summary:
Previously, plugins could relatively safely use `client.call` at any moment in time to fetch some information from / to the client. Except for some raise conditions there was generally speaking a connection available.
With this stack it becomes possible to interact with plugins even after an app (unexpectedly) disconnected, which makes Flipper a lot more versatile, especially when it comes to inspect crashes post mortem. (For more explanation see the second diff in this stack)
However, this means that it is no longer safe to assume there is always a connection available. For that reason `client.isConnected` has been introduced to safeguard against that.
This diff introduces guards on all user interactions that are not super explicitly triggered by the user to avoid a lot of errors being generated. This is mostly in `init()` blocks and implicit user events like selecting or hovering rows.
Explicit user interactions like pressing buttons are not guarded by this diff, as ideally failure to communicate with the client should be communicated back to the user more explicitly rather than failing silently. The next diff will introduce a fallback mechanism where a popup is shown in case those calls aren't guarded.
Fixed a few key warnings while at it.
Reviewed By: nikoant
Differential Revision: D26275604
fbshipit-source-id: 5630066cdd9541e448a6dd1f8a21861b5d751ced
Summary:
This diff sets all package version to "0.0.0" except of the root package and changes the bump script to only bump version in the root package. This should reduce possibility of conflicts on release diffs. Anyway we always use the same version for all of our packages, so we can only set it to the root.
Before npm publishing we will set all package versions to the same number as in the root package (we actually already do that) so there will be no differences except we won't need to bump version in more than 100 packages each release.
Reviewed By: mweststrate
Differential Revision: D25162373
fbshipit-source-id: 02fe401bee72845339c67925c130027bdaee559d
Summary:
* Removed Flow compilation step
* Removed all `flow` annotations
* Removed all FlowFixMe's
* Removed flow typings for Flipper
* Left flow transpilation (stripping) in babel, in case there is any external user using Flow in his plugin
* Left `eslint-plugin-flowtype` dependencies, as `eslint-config-fbjs` requires it
Reviewed By: passy
Differential Revision: D24755545
fbshipit-source-id: 9c0a7910657fd1cba88294e041bf2bfdf7b565bf
Summary:
Some exploratory testing on all iOS and Android plugins, to see how they behave inside Sandy, and fixed some layout glitches (some were also present without Sandy)
General fixes:
* Introduced some niceties like searchbox resizing properly, and toolbars wrapping automatically in Sandy, rather than buttons becoming invisible
* Containers don't grow anymore by default, but take size of contents
* ScrollContainer child is now a Layout.Vertical. Layout.Vertical should be used as default container everywhere (e.g. Tabs, Panels) in the future
* Fixed layout issue if a split container had only 1 visible child
* DetailsSidebar now scrolls vertically by default
* Details sidebar would sometimes render content in-place rather than in the reserved area
* AppSelector dropdown and Plugin list will now properly ellipse (...) if there is not enough space
Plugin fixes:
* Long database / table names in Database plugin would break layout
Also fixes https://github.com/facebook/flipper/issues/1611
Reviewed By: passy
Differential Revision: D24454188
fbshipit-source-id: c60c867270900a1d4f28587d47067c6ec1072ede
Summary: In D24138822 I basically bumped all desktop deps. That was a bit too much as it affected our build infra and broke it. The problem wasn't easy to bisect so choose a smaller set of deps instead to update; everything transpile & lint related + a few well tested runtime deps.
Reviewed By: cekkaewnumchai
Differential Revision: D24161841
fbshipit-source-id: 67162efeccd05a344b229ce976102cfafe6d1099
Summary:
This diff improves showing details in the databases plugin in a few ways:
1. if there is large content, it is no longer rendered of screen
1. the section is now scrollable
1. made layout vertical rather than horizontal to have more space vor values
1. show the type of a value
1. better detection of JSON versus non-json values (primitives would be picked up as json, but in contrast binary ascii such as used in instagram wouldn't). This fixes also string to be rendered incorrectly by accidentally parsing them as numbers, such as can be seen in https://fb.workplace.com/groups/flippersupport/permalink/948112715669387/
Changelog: [Databases] Fixed several layout issues when inspecting rows, and added better JSON support and support for larger responses.
Reviewed By: cekkaewnumchai
Differential Revision: D23317689
fbshipit-source-id: 47ab5164e25da003e0d1a4ae7ccb1537b637e572
Summary:
Added infra for writing and using custom eslint rules and created a rule for disallowing cross-package file imports. Such imports are anti-pattern and they also break standalone plugin bundling.
We still have a bunch of places where Flipper core references code directly from plugins. I've ignored these places for now and added task T71355623 to revisit them.
Reviewed By: passy
Differential Revision: D22998955
fbshipit-source-id: d04cff8fc115ba1300a7e6830306ec134046e927
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: 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:
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: 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:
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
Summary: This diff helps obtaining metadata for using to edit row
Reviewed By: jknoxville
Differential Revision: D21788246
fbshipit-source-id: bf01eff8866c82f001575d59cc2886b6cdd39dc5
Summary:
This refactor has the following changes:
- Change way to store data: raw data instead of rendered data
- Move render function to separated function component file
- Remove repetitive pattern
Reviewed By: jknoxville
Differential Revision: D21739468
fbshipit-source-id: 1f7e7ae902c3b55f3863300aaed26c2adda898ac
Summary:
As suggested in the previous diff, I change the way to store row values. Now, (kinda) raw values are stored instead of processed values that can be used directly for `ManagedTable`. This simplifies logic in detail sidebar.
I'm not sure what the effect to performance.
Reviewed By: mweststrate
Differential Revision: D21621896
fbshipit-source-id: 472be3caa955ca32f876f81095af21e9c17cb159
Summary:
This allows long text to be seen on the sidebar in database plugin. Also, remove weird padding in the sidebar and separate sidebar component to a new file
Refactoring is in the next diff
Reviewed By: mweststrate
Differential Revision: D21550672
fbshipit-source-id: 3e80be16783719e18392fe3d8f8068caf9283f8f
Summary:
As mentioned in [the first comment in the Github issue](https://github.com/facebook/flipper/issues/989#issuecomment-616673590), we were mixing database `id` given from client and `index + 1` on server side. After investigating, most are used correctly; it searches `id` from given database `name`. However, there are a few (if not one) that, in my opinion, was used incorrectly. For example, [`tableOption`](https://fburl.com/diffusion/vlo7xbo1) assumed `id - 1` is the index, which is sometime incorrect.
This diff sorts the database listed from client by `id` before storing in the state.
Changelog: Fixed wrong order assumption on server side
Reviewed By: jknoxville
Differential Revision: D21496345
fbshipit-source-id: 5e15f776356b0357ac14fbde6c2a11efd76cd1e1