Commit Graph

1741 Commits

Author SHA1 Message Date
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
Benjamin Elo
4d774ba252 Added navigation plugin
Summary: Adding the auto-genrated scarf files from creating the Flipper navigation plugin. GK for this plugin is flipper-navigation.

Reviewed By: jknoxville, danielbuechele

Differential Revision: D16119841

fbshipit-source-id: 74e19c82dc95e73fe2ae06d1eb8cef2456b81931
2019-07-04 05:20:51 -07:00
henry_zheng
1b3ae77c40 fix network stackoverflow #215 (#474)
Summary:
fixed issue: https://github.com/facebook/flipper/issues/215

## Changelog

1. use pako to inflate direct to unicode string to avoid 'stack size limit exceed' problem
Pull Request resolved: https://github.com/facebook/flipper/pull/474

Test Plan:
Tested with Meetup trace that crashes reproducibly without this fix:
{F165395994}

Tested gzipped body with fb4a:

{F165396053}

Reviewed By: jknoxville

Differential Revision: D16090209

Pulled By: passy

fbshipit-source-id: 64b8a61fa9d80d9e8b62105b3f1dc3289a29cc07
2019-07-04 05:15:22 -07:00
Mihaela Ogrezeanu
3ba71cea9c Added plugin for Sections Changesets in Android
Summary: just the skeleton for the android plugin

Reviewed By: passy

Differential Revision: D16006791

fbshipit-source-id: b0fe2143afeab6bc0671b7ad5a3ccfbccdd6e40a
2019-07-04 03:40:13 -07:00
John Knox
33df17b462 Fix layout search red text
Summary: The search text should only appear red when it's a regex, and when that regex is not valid.

Reviewed By: danielbuechele

Differential Revision: D16091096

fbshipit-source-id: 22b3e229e2c82ced956bae8fd203c5f177323dc2
2019-07-03 03:40:16 -07:00
Pritesh Nandgaonkar
004efcb7a8 Fasten up serialization
Summary:
The serialization algo was slow. The problem was that it used to just go to the first child which was not serializable and went back to the parent which then looked for first child from the remaining children and serialized it, and this happened at all levels. Instead, currently, the child fills the stack up with the children which needs to be serialized, so there is no back and forth for each child. This improved the speed a lot.

Test case: Serializing ~10000 rows of logs
Previous Iterative algo: 33215.3 ms
Iterative Algo with the above change: 2051.1 ms
Recursive Algo: ~1000 ms

New Algo Video:

{F164050963}

Prev Algo: Too Slow

{F164051027}

{F164051085}

Recursive Speed:

{F164051982}

Reviewed By: jknoxville

Differential Revision: D16037998

fbshipit-source-id: 70fae9a0073ff28d1a6528ec0dbddceb213b2c5f
2019-07-02 08:12:28 -07:00
Benjamin Elo
641c9eee36 Added LocationButton component
Summary: This button will be used to navigate between most recent and favorite locations within an Android app. Button is WIP and will be modified when work on the Navigation plugin begins.

Reviewed By: jknoxville

Differential Revision: D16088389

fbshipit-source-id: 64dcbc678ddeaeb36dd771d0cccef7c78bbc4b5c
2019-07-02 06:36:37 -07:00
Pascal Hartig
f279da4d90 Fix Fresco typos
Summary: Per title.

Reviewed By: jknoxville

Differential Revision: D16089146

fbshipit-source-id: 3bfa6494ecc99c191fbb57ef67723283b5ab0998
2019-07-02 06:23:54 -07:00
Daniel Büchele
f2c8fe0205 fix reconnecting clients
Summary:
When an archived device reconnected, the clients from the architved device weren't removed and a new client was added. This caused a client to be shown multiple times after reconnecting a device.

In this diff, all clients and pluginStates from an archived device are removed once the device reconnects.

Reviewed By: passy

Differential Revision: D16075349

fbshipit-source-id: 1d0e6ce17c89bb75dd993466bca6bd64e2c63338
2019-07-02 03:11:06 -07:00
Benjamin Elo
28d4e6409d Created chained button group component
Summary:
This is a new component that allows for chaining of buttons in a button group by placing an icon in between them.

This is how we plan to navigate between views within an Android app.

Reviewed By: danielbuechele

Differential Revision: D16071234

fbshipit-source-id: 404a3a341081b6111667bd5acf27876bec627435
2019-07-01 08:31:22 -07:00
Mihaela Ogrezeanu
353f65cd7f Move Sections Plugin to OS folder
Summary: as title; we'd like to reuse this for the Litho sections plugin but not having it in OS makes setting up deps more difficult than it should be.

Reviewed By: danielbuechele

Differential Revision: D16052298

fbshipit-source-id: cd965688eff4fedbe57264e6676b6ca09b9deb45
2019-07-01 07:06:39 -07:00
Daniel Büchele
468468a3bc Client fixes
Summary:
Event emitter was typed any. Therefore, Client extended any and thing went south.
removing the explicit any type and fixing flow errors.

Reviewed By: jknoxville

Differential Revision: D15987630

fbshipit-source-id: 9456149d46f839d9579fcc2671ab2a82935fc23a
2019-07-01 02:36:18 -07:00
Benjamin Elo
1a0ee24b1a Mac devices excluded from default devices
Summary:
Bug Summary:

When running Flipper on Mac, the Mac device is always first to register with Flipper and thus is always selected as the default connected device when first launching. This blocks the beautiful tutorial screen from appearing for new users.

Fix:

When registering new devices in the redux store, a new check has been added that maintains a blacklist of devices that cannot be selected as default. I have added Mac to start. At the same time, this fix preserves userPreferredDevices so that if the user has selected Mac as a device in the past, then next time Flipper is opened, even blacklisted devices will be displayed.

Making this fix uncovered a race condition, between the redux state being rehydrated and the devices being registered. I have potentially fixed this via a callback function in persistStore.

Reviewed By: passy

Differential Revision: D16048371

fbshipit-source-id: 79580b30e8a3b077dac1ac15131266e59646253f
2019-06-28 03:46:34 -07:00
Pascal Hartig
63ad32f66b Flow 0.102
Summary: Nothing broke. Yay.

Reviewed By: jknoxville

Differential Revision: D16048261

fbshipit-source-id: 536b7eec147552f702670aceadcd422fdc14364d
2019-06-28 02:57:02 -07:00
John Knox
2f5f69a2c8 Print success message to stderr after headless
Summary: Adding some verbose logging for remote debugging during integrations.

Reviewed By: passy

Differential Revision: D16039055

fbshipit-source-id: 963e0be5ac1526badbd71b9ef2f4906bec2f13ed
2019-06-28 02:52:47 -07:00
Roman Gorbunov
30b7d4e9dd Copy ID of view
Summary: Now if you copy one of components in flipper in layout plugin, you will get not only name but also id in your clipboard

Reviewed By: priteshrnandgaonkar

Differential Revision: D16031628

fbshipit-source-id: e2c38182dea28719615609f3aa2c74e58749cce4
2019-06-28 01:51:40 -07:00
Pascal Hartig
d6cb86e4c0 Update layout-plugin.md (#473)
Summary:
Fix https://github.com/facebook/flipper/issues/472
Pull Request resolved: https://github.com/facebook/flipper/pull/473

Reviewed By: jknoxville

Differential Revision: D16030793

Pulled By: passy

fbshipit-source-id: 52d53be3ca0a4932e4c762e9906bc4576dd8147d
2019-06-27 09:30:54 -07:00
Benjamin Elo
ecf2831d5d Added toggle fix for dropdown device menu
Summary:
Summary of Bug:

The devices menu popup does not toggle as expected.

Because of the way the click event is fired in Javascript, that is mousedown, mouseup, click, and the fact that the electron menu closes on mousedown, was why the menu was not toggling as expected.

Fix:

This is a potential fix where I add some state to tell if the menu was recently closed, and disable the popup if it was. This is done through the callback method of menu.popup. Then on the next mouse event I renable the popup.

In addition to this, I moved the popup logic into onMouseUp instead of onClick. This was simply to make the code neater. Before I would have to add a timer to the onMouseUp event that would fire after the click event and renable the popup.

Let me know if there is a simple solution to this problem that I've completely missed.

Reviewed By: jknoxville

Differential Revision: D16028864

fbshipit-source-id: a73202536762cce2ab623176cbda0369ca2b8079
2019-06-27 07:19:43 -07:00
Pritesh Nandgaonkar
81b71352dd Fix the bug related to the crash selection
Summary:
Fixes the bug when the crash options had same title. Selection was broken in that case. Look at the video.

{F163450316}

Reviewed By: jknoxville

Differential Revision: D15985919

fbshipit-source-id: 7366c8f5f33bbddc15c058b7d20d78d295161404
2019-06-27 06:58:08 -07:00
Pritesh Nandgaonkar
c38a55d98f Clear entries from the device when logs are cleared
Summary: Before this diff "Clear Logs" didn't used to clear the log entries from the redux store. It just used to update the state, so when you switched back from other plugins, all previous log information used to pop up again. This diff fixes that.

Reviewed By: passy

Differential Revision: D16012710

fbshipit-source-id: 4393520ab6f77caa5f286e22446d2cb6d0827d71
2019-06-27 06:58:08 -07:00
Pritesh Nandgaonkar
43495fa64c Do no fetch meta data for the archived device
Summary: Do not fetch meta data when the selected device is the archived one,

Reviewed By: jknoxville

Differential Revision: D16011742

fbshipit-source-id: cd84ef62094ffd8f90922d304ebd911f3b36f469
2019-06-27 06:58:07 -07:00
John Knox
0a0aec17ca Don't allow rejecting with non-error objects
Summary: This will make it easier to handle errors, because you know you can get the message out, along with stack trace, without having to deal with potentially any object that could be passed in.

Reviewed By: passy

Differential Revision: D16006180

fbshipit-source-id: f200965d7663c5f8a471603fceb6b4cdbea73381
2019-06-26 09:59:26 -07:00
John Knox
34f835ace8 More exit handling fixes
Summary:
Line 166 is missing a process.exit() causing the process to stay open forever if anything goes wrong.

Making everything use errorAndExit, and making use of the utility function so we don't need to remember when to print e, and when to print e.message.

Reviewed By: passy

Differential Revision: D15989164

fbshipit-source-id: c683fa07d98fe49283a59b5f8108ef54babc97a3
2019-06-26 09:17:56 -07:00
Pascal Hartig
1fd5fa23a1 Upgrade deps
Summary:
Upgrading `tmp`, `dashify` and `fs-extras` to their latest versions in an attempt to break my PSC writer's block.
Changelogs don't indicate any breaking changes that should affect us.

Reviewed By: danielbuechele

Differential Revision: D15983944

fbshipit-source-id: 53e87cf3c05e5742db1073e6ccf7f3bd4412638d
2019-06-26 05:40:15 -07:00
Daniel Büchele
718939cd6b disconnect client instead of removing it
Summary: When an Android device disconnects, the device is marked as offline. In this diff, we want to make sure the client for the disconnected apps is not removed, but converted into a "disconnected" client. This makes sure plugins are still shown for the disconnected app.

Reviewed By: passy

Differential Revision: D15985424

fbshipit-source-id: 650ef1344b8be4411794b0344805cb75ceae4a83
2019-06-25 07:51:51 -07:00
Pascal Hartig
7d4bd4e1f3 Track usage of leak switch
Summary:
Logging to see how many people use this feature in addition to the notification logs
we keep.

Reviewed By: oprisnik

Differential Revision: D15983761

fbshipit-source-id: db64bf97d0643f2bfce25a539ee10147924ee3f8
2019-06-25 05:42:08 -07:00