Commit Graph

14 Commits

Author SHA1 Message Date
Daniel Büchele
a455520ecb adding jest test setup
Summary:
Adds a test runner for jest test and adds three simple test cases:
- render the app
- start a server
- client connecting to the app

Test can be run using `yarn test`.

To make the test runner work, some changes needed to be made:
- remove the export of `init()` from `'flipper'`, because it was a cyclic dependency
- updating Button.js to the new ref-API

Reviewed By: jknoxville

Differential Revision: D10027078

fbshipit-source-id: 49107b0dd4dec666b92ecd841422fe7e6b3a7756
2018-09-28 06:42:08 -07:00
Hilal Alsibai
5285d50abf Add syntax highlighting
Summary: Pretty colors

Reviewed By: danielbuechele

Differential Revision: D9504416

fbshipit-source-id: 7eb467ff43bed5566f3bd9ce72dc74064fb4718c
2018-08-29 03:27:07 -07:00
John Knox
db1b175d44 Use library to create temporary files
Summary: Makes the code a bit cleaner and maintainable.

Reviewed By: passy

Differential Revision: D9496316

fbshipit-source-id: a59a41b12a57bb2eedc25b154c6f9b0cdc77dd8a
2018-08-28 04:26:54 -07:00
Daniel Büchele
726966fdc0 convert to emotion
Summary:
My benchmarks have shown react-emotion to be faster than the current implementation of `styled`. For this reason, I am converting all styling to [emotion](https://emotion.sh).

Benchmark results:
{F136839093}

The syntax is very similar between the two libraries. The main difference is that emotion only allows a single function for the whole style attribute, whereas the old implementation had functions for every style-attirbute.

Before:
```
{
  color: props => props.color,
  fontSize: props => props.size,
}
```

After:
```
props => ({
  color: props.color,
  fontSize: props.size,
})
```

Reviewed By: jknoxville

Differential Revision: D9479893

fbshipit-source-id: 2c39e4618f7e52ceacb67bbec8ae26114025723f
2018-08-23 09:42:18 -07:00
Daniel Büchele
7bdb21e055 adding table debouncing
Summary:
When changing the props of a table often, this might results in a lot of unnecessary rerenders. This could be mostly seen in the analytics plugin, which is sending a lot of messages in a short time.

The update of the table component is now debounced to only re-render every 150ms. This also affects searching and filtering and makes typing in the search input smoother.

Reviewed By: passy

Differential Revision: D9447722

fbshipit-source-id: 00e092e4e047e9c40e5a1ec2789644858acc18dd
2018-08-23 04:57:28 -07:00
Daniel Büchele
1891e2c869 moving tables to react-window
Summary:
Tables were using a custom virtualization, which wasn't as performant as other solutions out there. In this diff, the table component is reworked for performance.
- removes `Table` component, because it was never used standalone, `ManagedTable` is what all plugins used
- uses `react-window` for `ManagedTable`
- reworks table highlighting and arrow-navigation to work with the new virtualization
- moves actual filtering out of `ManagedTable` into `Searchable` component for a better separation of concerns.

Reviewed By: jknoxville

Differential Revision: D9447721

fbshipit-source-id: 15eb2eb55eed9f49a0cb1ccfb2d748b3672fa898
2018-08-23 04:57:28 -07:00
John Knox
f73c28ba6b Prepare desktop app for requestResponse CSR change
Summary:
[Step 1 of a protocol change between desktop app and flipper agent]

The flipper agent periodically tries to connect.
When it doesn't have the required certs, instead of trying to connect, it requests them from the desktop.
After requesting, it just continues the loop, trying to request.

The problem with that is
a) the desktop can take longer than one cycle to generate and provide the certs, meaning the agent will make overlapping requests, causing confusion and it to take longer than necessary.
b) the desktop can take less time than a retry cycle, but the agent will still wait before trying to connect.

Fixing a) by making the agent wait for a response from the desktop before continuing attempting to reconnect.
This means on the next connection attempt, it's guaranteed that the desktop is finished processing the CSR.

b) remains unfixed for now, but can be dealt with separately.

This is step 1 which adds an extra responder to the desktop app. It won't change anything until the agent starts
sending requestResponse messages instead of fireAndForgets. The plan is to leave this in place for a while to give users time to update, after that, we'll roll out the change to the agent.

Reviewed By: passy

Differential Revision: D9179392

fbshipit-source-id: 9a8021253dcd28c15cceeec23630a67aec219fd5
2018-08-07 06:41:38 -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
Benjamin Pankow
4818d87c3f Add hprof analysis to Memory Tools plugin
Summary: Add needle dependency.

Reviewed By: danielbuechele

Differential Revision: D8665740

fbshipit-source-id: 552bbc3d346560d5d9981a666b8fb527a27d72d3
2018-07-31 14:19:15 -07:00
Daniel Büchele
37425e7ae8 persist state over reload
Summary: The selected device, app and plugin are not persisted over a reload using `redux-persist`.

Reviewed By: jknoxville

Differential Revision: D8836481

fbshipit-source-id: 3ace1a950a200255d5daf77791d706ede0ff2138
2018-07-31 07:58:33 -07:00
Daniel Büchele
9f95698492 disable auto publish
Summary: electro-builder automatically publishes when it detects builds on TravisCI. This disables this behaviour, as we want to manually publish releases.

Reviewed By: jknoxville

Differential Revision: D8783066

fbshipit-source-id: d8723c87b879b3ef7ee02585997a13cb55095e65
2018-07-11 08:03:57 -07:00
Daniel Büchele
bcc47bfe0c add missing flow interfaces
Summary: adding missing flow interfaces, fixes flow error

Reviewed By: priteshrnandgaonkar

Differential Revision: D8639038

fbshipit-source-id: 509ebcc86ea64a01dcea4968a39ed0ea51fdec93
2018-07-03 10:05:00 -07:00
Daniel Buchele
f7d487dd76 fbshipit-source-id: 2cd940396d650342920b28835f6e672febe6b55c 2018-06-12 03:39:09 -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