Commit Graph

1816 Commits

Author SHA1 Message Date
Benjamin Elo
a9e90aa9b2 Receive navigation events and persist them
Summary: After setting up the navigation event emitter on the android side, we must now receive them on the client side and persist them in the Redux store.

Reviewed By: passy

Differential Revision: D16280944

fbshipit-source-id: 3dc4c5c6add41388469c801700974eb0ccd9a56b
2019-07-17 03:00:50 -07:00
Benjamin Elo
ce93ecfcca Speed up Redux dev tools by disabling log serialization
Summary: Serializing the logs of the devices within Redux dev tools was causing Electron to crash due to it being out of memory. We can sanitize the state serialization by rewriting the device logs to <<DEVICE_LOGS>>. This fixes the issue and causes Electron to use less memory and CPU while in devlopment mode.

Reviewed By: jknoxville

Differential Revision: D16282673

fbshipit-source-id: abee6d167b23f24647e45f039a77ab60576ab3e6
2019-07-17 02:50:13 -07:00
Mihaela Ogrezeanu
9c96545bbd Add Flipper plugin to Litho's sample apps
Summary: Add plugin to sample app.

Reviewed By: marco-cova

Differential Revision: D16181876

fbshipit-source-id: fe60fa9f593c16cb24d6901c98b6392a05c6d837
2019-07-16 10:57:24 -07:00
Sidd Srinivasan
aff991b313 Render Webview
Summary: When Trace has been uploaded, load it inside a webview in Flipper.

Reviewed By: habond

Differential Revision: D16185763

fbshipit-source-id: 3217211f1d5035fc16d733ef48db44d8f8d9d360
2019-07-16 09:05:11 -07:00
Pascal Hartig
3af9e889f4 Enable cocoapods caching (#491)
Summary:
Enable caching for cocoapods.

This was my attempt to fix the test which priteshrnandgaonkar did with https://github.com/facebook/flipper/issues/490, but might still be useful.
Pull Request resolved: https://github.com/facebook/flipper/pull/491

Reviewed By: priteshrnandgaonkar

Differential Revision: D16280689

Pulled By: passy

fbshipit-source-id: 5da72a7b75d9f49afa8f6c889074bf31e9d58dcd
2019-07-16 08:59:00 -07:00
John Knox
782c23393a Back out "[flipper] disconnect client instead of removing it"
Summary:
Original commit changeset: 650ef1344b8b

Backing this out until we can come up with a better way to do it.

The change was introduced so that when a device disconnects / crashes, we don't lose all plugin state, and you can still see what was on screen before the crash..

However, there are some problems with this solution, which get quite complicated. Putting them here for future reference:
* Closing an app results in the plugins staying there, and there's no way to tell it's not actually connected.
* If the app reconnects, the JS plugin doesn't get re-initialized. Even though the client plugin has been.

Reviewed By: bnelo12

Differential Revision: D16280931

fbshipit-source-id: 48e09b876e631aa87372054e706cdb9a2b3e2eb7
2019-07-16 08:39:05 -07:00
John Knox
a097e673d8 Back out "[flipper] fix reconnecting clients"
Summary:
Original commit changeset: 1d0e6ce17c89

Backing this out until we can come up with a better way to do it.

The change was introduced so that when a device disconnects / crashes, we don't lose all plugin state, and you can still see what was on screen before the crash..

However, there are some problems with this solution, which get quite complicated. Putting them here for future reference:
* Closing an app results in the plugins staying there, and there's no way to tell it's not actually connected.
* If the app reconnects, the JS plugin doesn't get re-initialized. Even though the client plugin has been.

Reviewed By: bnelo12

Differential Revision: D16280932

fbshipit-source-id: 92585cdd0dace2012924df4106327a1e21ab9f9b
2019-07-16 08:39:05 -07:00
Mihaela Ogrezeanu
42c887e634 Add more fields on the Tree nodes
Summary:
Add fields for colouring the changeset operation that was performed on a node in the tree.
Changesets are not ordered by type of operation, they need to be displayed in order

Reviewed By: danielbuechele

Differential Revision: D16121158

fbshipit-source-id: 411557170b16ada9d1d72fb617b1aaf583e0f0e7
2019-07-16 07:33:12 -07:00
Pritesh Nandgaonkar
1047ee6d48 Fix broken travis test (#490)
Summary:
The travis test used to terminate after 10 minutes of `pod install --silent` being unresponsive, added `travis_wait` to circumvent it.

## Changelog

Fixed the broken travis test
Pull Request resolved: https://github.com/facebook/flipper/pull/490

Test Plan: All tests are green on this PR.

Reviewed By: jknoxville

Differential Revision: D16261250

Pulled By: priteshrnandgaonkar

fbshipit-source-id: 323c5decb66232830d692b784f7cf5f9cbf67a01
2019-07-15 08:45:04 -07:00
John Knox
9a97b3b45b Add 1h tolerance to ssl certs
Summary:
This changes the start date of all generated certificates to be 1h in the past.

Why? To allow for clock skew, and allow clock manipulation in tests.

To do this, I had to switch from `openssl x509 req`, to `openssl ca` for generating them, because it has the startdate parameter.

This variant is a bit more complicated to use, so I've added an openssl.conf and some extra files.

I also changed the org from Sonar to Flipper because it now needs to match the CSRs coming from the mobile apps, and they use Flipper.

Reviewed By: passy

Differential Revision: D16223722

fbshipit-source-id: bdbd61bce1bc1b54d7b0b3cc6741675aa68d2cf6
2019-07-15 04:33:52 -07:00
Pritesh Nandgaonkar
ba95e73a8d Show status updates while exporting
Summary: Adds a feature to display status update, while exporting Flipper trace. This will make user aware of the steps which are being executed to export flipper trace. This diff also logs the status update, to better support the issue posted by the user regarding the Flipper trace.

Reviewed By: jknoxville

Differential Revision: D16203810

fbshipit-source-id: 8f0bdc3836fec6dd79f2ca9827822d13f6cfd8bd
2019-07-15 04:01:45 -07:00
Pritesh Nandgaonkar
7f2709e1a5 Add close button to the export share sheet
Summary: Adds close button to the dialog box which appears while exporting a flipper trace. To implement this I had to first see what is the bottle neck of the export process. The major bottle neck turned out to be the serialization step. So to make the export process interruptible, I have put in a call `await idler.idle()` which resolves when the main thread is idle. I have also added the tests for the idler.

Reviewed By: passy

Differential Revision: D16183582

fbshipit-source-id: 4ec0c985e216fd9d41e91cdcd8b4cca66d2cb04d
2019-07-15 04:01:44 -07:00
Pascal Hartig
c63e6cffeb Flipper Bump: v0.23.2-SNAPSHOT
Summary: Back to snapshots.

Reviewed By: jknoxville

Differential Revision: D16221049

fbshipit-source-id: f3a2d3c7f8d117269da2d37b7b9b669b33652f09
2019-07-15 03:12:24 -07:00
Pascal Hartig
e45e174dba Flipper Release: v0.23.1
Summary:
- New Litho Sections APIs.
- New version of Metro.
- Hardened eslint rules.
- Flipper Headless now offers a `--no-plugins` build mode to speed up compilation.

Reviewed By: jknoxville

Differential Revision: D16221050

fbshipit-source-id: 5eb7a0e8caaf11188ece94a149003daa36eb0a30
2019-07-15 03:12:24 -07:00
Pritesh Nandgaonkar
aebca6bb57 Update OpenSSL dependency
Summary: Updated the OpenSSL dependency and released the new versions of Folly and RSocket.

Reviewed By: jknoxville

Differential Revision: D16222388

fbshipit-source-id: e894650a8c3ac764bc489e843e9a3ccf33688659
2019-07-12 09:35:52 -07:00
Daniel Büchele
0a42558344 TitleBar
Summary: Let's migrate one file to TS, this helps us to test our tooling and make sure, everything works as expected.

Reviewed By: bnelo12

Differential Revision: D16149514

fbshipit-source-id: 05055a1830f187c6812baa661e109ea67995253b
2019-07-12 04:24:33 -07:00
Mihaela Ogrezeanu
474cc1289e Add data model to tree and colour changeset operation
Summary:
This colours data model nodes in the tree to show how they were part of the current changeset: whether the data model caused an insert, update, remove etc.
This also adds phantom Section nodes for Sections that were completely removed from the tree; this is helpful for debugging cases where a section's key changes without intention, causing items to be completely removed and inserted.

Reviewed By: topwu

Differential Revision: D16165767

fbshipit-source-id: a011666dce33e4d757fb415e71ba163aa334f6e6
2019-07-11 09:56:18 -07:00
Mihaela Ogrezeanu
0d4e2e6eb3 Add changeset info in side panel
Summary: the side panel displays information with the changesets that were applied for each section

Reviewed By: adityasharat

Differential Revision: D16131069

fbshipit-source-id: d03547148e483e196600191291e58a13acf505c3
2019-07-11 09:56:17 -07:00
John Knox
c69f3e3103 Disallow throwing non-error objects
Summary: It's annoying to have to treat things like they might not be errors, inside catch blocks. This should stop that.

Reviewed By: passy

Differential Revision: D16201509

fbshipit-source-id: b028ea3a1e0766763fcf2659d80456f4dd281c40
2019-07-11 08:57:54 -07:00
Benjamin Elo
9f1f34bd99 Added search bar to navigation plugin
Summary:
Here I've started work on a search bar for the top of my plugin. Currently it supports navigation in a device by typing in an app uri and pressing the enter key or by pressing the send icon.

More features will be added as other components for this plugin are added. I have added a function stub for the bookmark button for now and the drop down icon is purely cosmetic at the moment.

Reviewed By: jknoxville

Differential Revision: D16183223

fbshipit-source-id: 0313d8c6e3a967c9400b9e9d3f24960e6a021a8c
2019-07-11 07:48:47 -07:00
John Knox
df6c485b6b Fix test failure message when headless out isn't json
Summary: Jest expects any promise rejections to be errors, not strings.

Reviewed By: passy

Differential Revision: D16200876

fbshipit-source-id: 7ebb6c63262b3c13ec677b1e72010146aa5b55e8
2019-07-11 05:54:01 -07:00
Benjamin Elo
222676eb44 Moved navigation inside of Android Device
Summary:
It makes more sense for the navigation ability to be inside the Device's class instead of scattered throughout the rest of the app.

I have moved the Android navigation logic inside the AndroidDevice and added a function stub to BaseDevice. I also encoded the URI as an initial safeguard to injection attacks via adb, but will remove this altogether once I enable navigation through the socket connection.

Reviewed By: jknoxville

Differential Revision: D16182374

fbshipit-source-id: be3c6d1cfcbe293583edada1f77c023965dfd12c
2019-07-10 12:13:16 -07:00
Daniel Büchele
ee5091c742 and so it begins...
Summary: This is the basic setup for TypeScript support in Flipper and makes sure our build system can handle `.ts(x)` files. Support for flow is still fully working, so we can land this and continue with the TS migration.

Reviewed By: jknoxville

Differential Revision: D15920150

fbshipit-source-id: d5a7f22fe824d1c1904105bbf738767d735cc0f1
2019-07-10 12:13:16 -07:00
Roman Gorbunov
cf1347d2e3 Fixed bug with flipper live editing
Summary:
Fixed bug with live editing
Previously if the meaining of the value was changed in flipper you receive back same value as it was
Now you see correct changed value

Reviewed By: priteshrnandgaonkar

Differential Revision: D16162141

fbshipit-source-id: 1a68ea64603171e952382c5093470d2cc12f7bbe
2019-07-10 12:13:15 -07:00
Mihaela Ogrezeanu
169836fc2f Create SectionTree in plugin
Summary: Create Sections hierarchy from data received when a changeset is applied and send it to the plugin to render it

Reviewed By: adityasharat

Differential Revision: D16120480

fbshipit-source-id: 30b824d8d6e65b537c3e98b7ee3438055f6f1ec2
2019-07-10 12:13:15 -07:00
Mihaela Ogrezeanu
a952f988d6 Generate and send bogus data to changeset plugin
Summary:
This hooks up the listeners that send events from the SectionTree to the desktop plugin. gradle build will fail until I release a new Litho version with D16120818
ChangesetDebug receives events on every valid changeset, it will parse the data into Flipper objects and pass it to the desktop client to render it.
Right now this just sends an event with empty data

Reviewed By: adityasharat

Differential Revision: D16121473

fbshipit-source-id: eeef92cea7dae836861d417ed6a00fcb11901e78
2019-07-10 12:13:15 -07:00
John Knox
5371d5bdce Fix empty headless output bug
Summary:
The SIGINT handler in headless was being squashed by the one that `tmp` adds. This is a bug introduced in its latest release: https://github.com/raszi/node-tmp/issues/192

Downgrading version to fix this for now. There's a PR to fix it, we can upgrade when it's shipped.

Reviewed By: passy

Differential Revision: D16163208

fbshipit-source-id: 058ec1094dd2e5e5474f7ac36be376bae0431f0c
2019-07-10 12:13:15 -07:00
Pascal Hartig
48db46def2 Fix lint
Summary: This one snuck in while rebasing my new rules onto master.

Reviewed By: bnelo12

Differential Revision: D16180472

fbshipit-source-id: b715c218ff1886c1901c7730a6b8dac67beb3968
2019-07-10 12:13:14 -07:00
Pascal Hartig
e831743132 Harden lint rules
Summary: Taking another stab at adding some lint rules to make it harder to shoot yourself in the foot. Hopefully nothing too controversial. Preferring spread and rest should lead is more readable and there's no downside when using ES6. The "useless" rules are just things like renaming imports to the original name which should only happen during refactors.

Reviewed By: jknoxville

Differential Revision: D16180453

fbshipit-source-id: 1cf6851b7726c0aee953ec7cf7dd6fa0aca32253
2019-07-10 12:06:39 -07:00
Roman Gorbunov
8b2a886c19 Fixed a bug with accessibility button
Summary:
Fixed a bug with accessibility button
Now it's pressable

Reviewed By: kevin0571

Differential Revision: D16165294

fbshipit-source-id: 9c6ea464f2faa149aa78c0534c51a0f58bd249ad
2019-07-10 11:40:03 -07:00
Edward Pastuszenski
4f4d9fa76e Omit invisible columns from horizontallyScrollable ManagedTables' width
Summary: Currently, `horizontallyScrollable` logic includes even invisible columns in the width calculation for `horizontallyScrollable` `ManagedTable`s, resulting in large empty spaces when many columns are invisible.

Reviewed By: danielbuechele

Differential Revision: D16139713

fbshipit-source-id: f653121845fbeac8a29bdb67ad0309add28e526a
2019-07-10 03:28:26 -07:00
John Knox
385d9ded57 Don't create adb client during module import
Summary:
Creation of the adb client requires the logger to already be initialized, so this should never be called at the global scope in a module, or you'll get weird import-order related bugs.

I noticed this while debugging, I don't think it's impacting anything right now, but have made it lazy just to avoid confusion in future.

Reviewed By: passy

Differential Revision: D16162266

fbshipit-source-id: 5363292d5cfcf2867a2654777cd8f4baed01d2c0
2019-07-10 03:28:25 -07:00
Pascal Hartig
c588b650ae Prefer const wherever possible
Summary:
Non-final identifiers make code harder to understand.
This is particularly true for JavaScript where even the *type*
can change as a value gets reassigned later.

This enforces to use `const` whereever possible, but doesn't
"outlaw" `let`. Mixed destructuring is also still allowed.

Used `eslint --fix` to change all existing cases.

Reviewed By: jknoxville

Differential Revision: D16131329

fbshipit-source-id: 2eceaca7c603b71b36e005be5d135e1849f2518d
2019-07-10 03:28:25 -07:00
Pascal Hartig
662db20948 Disallow var
Summary: We're ES6 and `var`s scoping rules are weird. Let's block this.

Reviewed By: jknoxville

Differential Revision: D16131290

fbshipit-source-id: ba67d16bb8a185a4bb59a657a97b00230dbacafe
2019-07-10 03:28:25 -07:00
Daniel Büchele
af8fbf2b46 remove warning for GKs
Summary: As we are trying to clean the console from any non-important logs, I am removing the warnings about GK'd plugins. This information can be seen on the "Plugin not showing" panel.

Reviewed By: jknoxville

Differential Revision: D16148408

fbshipit-source-id: 5aeffa6e82524aacb050385ba86439654c07c741
2019-07-09 03:07:04 -07:00
Daniel Büchele
df795a3b88 metro upgrade
Summary: updating to the latest metro version

Reviewed By: passy

Differential Revision: D15986739

fbshipit-source-id: 83fba99bf7cc0903590831aeb852d14dde576901
2019-07-09 03:07:04 -07:00
Pascal Hartig
d9c1c35581 Upgrade eslint (#479)
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/479

Just getting us to the latest major version. Luckily, no new errors were introduced.

Reviewed By: jknoxville

Differential Revision: D16131273

fbshipit-source-id: f605b315afbe4282e21923d7c970402f834f287c
2019-07-08 11:00:58 -07:00
Pascal Hartig
434913de40 Add yarn lock
Summary: Gets generated when running yarn, let's check it in.

Reviewed By: danielbuechele

Differential Revision: D16131278

fbshipit-source-id: d604a0af148826818d89c95f5ef07b595f60dca3
2019-07-08 04:56:01 -07:00
Mihaela Ogrezeanu
7b3b97a375 Bump Litho version in Flipper to 0.28.0
Reviewed By: passy

Differential Revision: D16132461

fbshipit-source-id: 135cc98fb0317ba8702c047dfe3a4dad6214fe27
2019-07-08 03:56:03 -07:00
Roman Gorbunov
6c5e2cbcf8 Added highlighting of search results
Summary:
Text of the component is now can be searched if flipper layout plugin
Flipper now highlight all the row if name of id or text of this component matched to the query

Reviewed By: priteshrnandgaonkar

Differential Revision: D16108315

fbshipit-source-id: ff5eb0bc4890f02c9b07e47c26b9ea1408d9c606
2019-07-08 03:43:55 -07:00
Roman Gorbunov
7551b6da04 Added search in text of some components
Summary: Added a possibility to search for the text not only in name and id of components but also in text for all components, that conforms to a protocol <SKTextSearchable>

Reviewed By: priteshrnandgaonkar

Differential Revision: D16108297

fbshipit-source-id: 31da4ac6762c487ef644d62c9576d9eff43e8cd4
2019-07-08 03:43:55 -07:00
Zoltán Gilián
6e1483edfa Export graphQLQuery function from fb/user.js
Summary: ... so device plugins can import it via the flipper module.

Reviewed By: danielbuechele

Differential Revision: D16111730

fbshipit-source-id: ac399692a11fc2b61d702eb46c57f6ca30fe0d72
2019-07-08 03:28:31 -07:00
Pascal Hartig
18140cbcf7 Apply security update suggestions
Summary:
Manually applying these "fixes":

- fixes https://github.com/facebook/flipper/pull/480
- fixes https://github.com/facebook/flipper/pull/481

This is mainly to sush the security warnings we get
even though we don't really have an attack surface where these matter.

Reviewed By: danielbuechele

Differential Revision: D16148208

fbshipit-source-id: 79865a97b442fd2b2621f1ef632e974e1e355e84
2019-07-08 03:28:31 -07:00
Zoltán Gilián
aff51b881d Fix uneccesary compilation when fs.watch rapid-fires
Summary:
On Windows fs.watch fires multiple times after a single edit causing multiple instances of plugin compilation threads to start bogging down system resources.
This diff delays compilation by 1 second, soaking additional watch events fired for that plugin in that time window.

Reviewed By: danielbuechele

Differential Revision: D16109076

fbshipit-source-id: bc4f89d83f04487a3d32ee5cc2105fe0a8b7366c
2019-07-08 03:05:08 -07:00
John Knox
5d99817555 Add --no-plugins arg to speed up headless development
Summary:
Compiling headless flipper takes a long time. This is because it individually compiles and bundles every plugin.

When debugging core headless, you don't need to compile any plugins, so this adds a build flag `--no-plugins` to skip that and vastly speed up iteration speed.

Reduces build time from 3 minutes to 20s

Reviewed By: priteshrnandgaonkar

Differential Revision: D16131322

fbshipit-source-id: 2b38ee37183a1257b3993f392cf623b2631fd7da
2019-07-05 08:09:18 -07:00
Pascal Hartig
dd7924c963 Move navigation tests into private folder
Summary: The corresponding implementation isn't open-sourced.

Reviewed By: danielbuechele

Differential Revision: D16121833

fbshipit-source-id: 91b2fd3bce79468321e49f7798ff54dbf5abd38f
2019-07-05 02:31:26 -07:00
Pascal Hartig
fbd9af0289 Flipper Bump: v0.23.1-SNAPSHOT
Summary: Back to snapshots.

Reviewed By: jknoxville

Differential Revision: D16121346

fbshipit-source-id: 60ee543de70c1ef5c2c224ad687981408e75a937
2019-07-04 09:10:37 -07:00
Pascal Hartig
82fdfa0915 Flipper Release: v0.23.0
Summary:
# Highlights

- Disconnected devices now remain available as archived until they're reconnected.
- Exporting is now significantly faster.

# Bug Fixes

- Re-enable x86 distribution for Android.

Reviewed By: jknoxville

Differential Revision: D16121347

fbshipit-source-id: ab58086ef3dc1f2e43feaee66ab2a1e5a69b44a1
2019-07-04 09:10:37 -07:00
Daniel Büchele
5c96b0952b set selectedDevice to null instead of undefined
Summary:
We are using `redux-persist` to persist parts of our redux store over reloads. In this library, there is a check if a value "was removed to the store". However, they are doing this check by checking if the value of this key is `undefined`. This is not a good way of checking if a property exists on an object, because it can exists but explicitly be set to `undefined`. This was the case for `connections.selectedDevice`, we were setting the value to undefined, once the device disconnected. This caused the key to be persisted, eventhough it wasn't whitelisted for persisting.

In this diff, we are setting the `selectedDevice` to `null` instead of `undefined` once a device disconnects.

Reviewed By: passy

Differential Revision: D16121260

fbshipit-source-id: f32c8ea9e30f02e065fa63380ae0245379a47496
2019-07-04 08:11:53 -07:00
Pascal Hartig
660fa71505 Reenable x86 builds (#476)
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/476

Fixes https://github.com/facebook/flipper/issues/471

Disabling the x86 builds altogether does more harm than good.

Reviewed By: jknoxville

Differential Revision: D16119936

fbshipit-source-id: cc276dcbd1d55585d8c108b76703aa260c9c9a09
2019-07-04 06:29:50 -07:00