Commit Graph

2258 Commits

Author SHA1 Message Date
John Knox
85c0ec0d13 Persist settings in ${XDG_CONFIG_HOME}/flipper/settings
Summary:
Moves the settings state from electron local storage into a json file in the users configured config location.
Unless modified by the user, this will usually be `~/.config/flipper/settings.json`

Settings will now persist across re-installs, and can now be easily inspected and backed up.

Reviewed By: passy

Differential Revision: D17712687

fbshipit-source-id: 1e778063e41d0a1a86145817b9797bf0458121da
2019-10-07 08:51:05 -07:00
John Knox
7775e82851 Add JsonFileStorage for redux-persist
Summary:
This will be used for the settings file.
It results in normal JSON, as opposed to json where the value of every key is an escaped string.

Reviewed By: passy

Differential Revision: D17712688

fbshipit-source-id: d37ed93707c7352719fa72a05bf51953611f52c0
2019-10-07 08:51:05 -07:00
John Knox
eb64ff0832 Add settings UI
Summary:
Adds a simple UI for editing settings, a reducer and persistance config for the data.
These values aren't yet used for anything.

Reviewed By: passy

Differential Revision: D17684490

fbshipit-source-id: e76ac43ffa17d3606e59f4a1ccb940e8d9fbd9e8
2019-10-07 08:51:05 -07:00
John Knox
8c15547597 Add explicit dismiss button to feedback prompt
Summary:
You can already click the star icon in the title bar to dismiss, but according to feedback this isn't obvious: https://our.intern.facebook.com/intern/itsr?start_date=1561849200&end_date=1570402800&tab=4&all_tools=true

So adding an explicit dismiss button.

Reviewed By: passy

Differential Revision: D17788570

fbshipit-source-id: b0995e5abdaafc5bd6f93edb27dad703c81b8f2b
2019-10-07 08:37:15 -07:00
Arnaud Frugier
57e8f8e235 Updating documentation for new version of database plugin
Summary: ^^

Reviewed By: jknoxville

Differential Revision: D17770002

fbshipit-source-id: f2aa1a0fbdea0f2f794261f77dfe2557def2aef0
2019-10-07 08:19:41 -07:00
Pascal Hartig
e074898d46 Basic error handling
Summary:
Adds some very basic error handling. It's not great
because once you hit an error, you're basically stuck
and there's no retry yet, but it's still strictly
an improvement over being stuck with the looping
spinner, so I think it's worth shipping it in this state.

Reviewed By: jknoxville

Differential Revision: D17763467

fbshipit-source-id: b5b7996554dd1dce682fba87f96e3806432a475a
2019-10-07 08:12:10 -07:00
Pritesh Nandgaonkar
d310027d88 Fix toggle switch bug when Flipper's width is small
Summary:
Bug:

{F214979227}

Reviewed By: passy

Differential Revision: D17763781

fbshipit-source-id: 21890caee796ac0df6f39e618a762c44955dd647
2019-10-07 07:43:58 -07:00
Pascal Hartig
ff76b17a5b Add metrics
Summary:
Add some usage and failure rate stats to the PluginInstaller. Small
typo fix and added a helper to the metrics utils to make simple
usage tracking a little more intuitive.

Reviewed By: jknoxville

Differential Revision: D17760511

fbshipit-source-id: 957031d428f3124435925415619b1555a0c2dc2a
2019-10-04 08:26:26 -07:00
Pascal Hartig
a3f7e6aa59 Make documentation xplat aware (#572)
Summary:
Update the docs to include Windows and Linux.
Pull Request resolved: https://github.com/facebook/flipper/pull/572

Test Plan: eyes

Reviewed By: jknoxville

Differential Revision: D17738803

Pulled By: passy

fbshipit-source-id: 8e556fb6b3e57de6f3334286e83a59a48dbdd982
2019-10-04 08:17:46 -07:00
LAgagggggg
0ba47d9a71 Fix crash of iOS FlipperNetworkPlugin (#563)
Summary:
Flipper's network plugin may cause crash on a frequency of about one time per 1~2 days(I think it depends on how many network request we send).
![IMG_3095](https://user-images.githubusercontent.com/24563710/65739973-cc540080-e119-11e9-9e6e-e4a925ecc63c.JPG)

  I assume the crash is caused by part of the code of HTTPParser is not thread-safe, and invoke it asynchronously may cause double-free crash. So I manually ask for HTTPBody synchronously, make the HTTPParser parse the request and cache them in advance, before any possible asynchronous invoking.

## Changelog
  Fix potential crash cause by network plugin.
Pull Request resolved: https://github.com/facebook/flipper/pull/563

Test Plan:
1. Run our App with Flipper integrated
2. Make sure FlipperNetworkPlugin is active
3. It may take days to reproduce the crash

Reviewed By: passy

Differential Revision: D17739327

Pulled By: priteshrnandgaonkar

fbshipit-source-id: e814145c346bd2da1d2f5f87b6a2f7e200f0bf2d
2019-10-04 05:38:05 -07:00
Pritesh Nandgaonkar
6e6873a4f6 Pass idler and statusupdate callback as an argument to the export persisted state function
Summary: This diff passes the idler and statusUpdate arguments to the export persisted state, as it is being used in the MobileConfig's export function

Reviewed By: passy

Differential Revision: D17715815

fbshipit-source-id: 98a0f0f5950254de2139c4aaa52cb73401c86c3c
2019-10-04 05:33:44 -07:00
Pascal Hartig
485898f5c7 Set key for SelectPluginSheet row
Summary: Getting a React warning because it previously didn't.

Reviewed By: jknoxville

Differential Revision: D17736486

fbshipit-source-id: 422e023abe0501804d5b447e365ff014969d6286
2019-10-03 09:14:26 -07:00
Pascal Hartig
22f8d26c33 Use explicit cast in plugin.tsx
Summary:
Marginally safer than ignoring the entire line, which
makes type-checking weaker on subsequent references.

Reviewed By: jknoxville

Differential Revision: D17736479

fbshipit-source-id: 13afcb5f08e53016b7a6cdc7ea135e726586a67b
2019-10-03 08:47:26 -07:00
Pascal Hartig
83ad3b956a Upgrade website dependencies
Summary:
Got a warning during `yarn start` that the caniuse database
was out of date so I updated it along with the rest.

allow-large-files

Reviewed By: jknoxville

Differential Revision: D17715099

fbshipit-source-id: 8ff705afbaa0f2be272f85e2996d8e32c1f6ab05
2019-10-03 07:47:34 -07:00
John Knox
957427d740 Fix startup race condition
Summary:
Currently Flipper.init is called as soon as the script loads.
However, if the store takes a bit longer than usual to get rehydrated, then this init call can get called before it has been set.

Fixing it by using a specific event instead of the generic `onload`.

Reviewed By: passy

Differential Revision: D17711399

fbshipit-source-id: fcaf9e5943bfd15359038b8e3722f11d7e06379b
2019-10-03 07:17:49 -07:00
Bartol Karuza
b3a98dc5e5 chore(docs): typo (#566)
Summary:
## Changelog
Pull Request resolved: https://github.com/facebook/flipper/pull/566

Differential Revision: D17737731

Pulled By: passy

fbshipit-source-id: f2aac8d7b256b3d2849942c42581046944bc11c9
2019-10-03 06:57:26 -07:00
Pascal Hartig
975b52d26b Build with static libc++
Summary:
This avoids having to perform gymnastics like in
https://github.com/facebook/react-native/pull/26697

Reviewed By: jknoxville

Differential Revision: D17735954

fbshipit-source-id: 507548aab89309beeb228b104a24af8acd10ce9a
2019-10-03 04:39:20 -07:00
Hilal Alsibai
447e918607 Make copying an element list out its attributes instead of a useless id
Summary: When copying elements from the layout inspector its much more useful to copy all associated attributes rather than just the name and an implementation detail id.

Reviewed By: jknoxville

Differential Revision: D17727520

fbshipit-source-id: 8ac1828059cc10f7f9faf0bdc72eb3d57c881121
2019-10-03 03:40:51 -07:00
Pascal Hartig
9bce894b71 Add publishing/installing docs
Summary:
Adding publishing and installation procedure docs to
our tutorial to round things off.

Reviewed By: jknoxville

Differential Revision: D17711800

fbshipit-source-id: 57c848c559208eb2a0ca790a72bcd493730baf16
2019-10-02 08:56:38 -07:00
Pascal Hartig
1de1bbaf8a Prepare for TypeScript 3.7
Summary:
These are the only four errors currently happening when upgrading to the 3.7 beta.
Luckily, these are all forwards-compatible changes.

Reviewed By: jknoxville

Differential Revision: D17711797

fbshipit-source-id: 429036e90300c81848cc3252b67bb89871ff2e32
2019-10-02 08:35:39 -07:00
Kfir Schindelhaim
52976f1ee3 Introduce CKMountable protocol
Summary:
- Introduce new base protocol `CKMountable`
  - Contains Layout & Mount methods that have been extracted from `CKComponent`
  - This will allows us to introduce a new lighter version of `CKComponent`, which doesn't rely on Scope/State/Controllers/etc
- Refactor `CKComponentLayout` to work with `CKMountable` instead of `CKComponent`, which will allows us to interop between `CKComponent` and a new type of components.
- Refactor the codebase to support this change

Reviewed By: kevin0571

Differential Revision: D17668253

fbshipit-source-id: 13db5ff4acb37b338e291ca2dd7d67cd25dbc6d2
2019-10-02 08:20:00 -07:00
Pritesh Nandgaonkar
9bad9ba976 Add status messages for the Support Form
Summary: Shows status messages for the Support Form

Reviewed By: passy

Differential Revision: D17601944

fbshipit-source-id: a2a8ad392dfbaf467625eb809020d687d066da57
2019-10-02 05:48:03 -07:00
Pritesh Nandgaonkar
05328167c6 Add support for status bar
Summary:
This diff adds a status bar, which can be used to show the status messages, for example for Litho Support Form.
The logic for the status bar is as follows:

It maintains the array of the messages. At any point it shows the last pushed message. It will keep showing that message until it is being removed, once removed it will show second last message. The messages will be removed as and when its corresponding task/Promise is fulfilled.

Reviewed By: danielbuechele

Differential Revision: D17551495

fbshipit-source-id: 96b2f401599b9ee8a472607e6a2f027e63b3b807
2019-10-02 05:48:03 -07:00
Mateo Silguero
4ec8ffcf53 Update images-plugin.md (#562)
Summary:
the name of the plugin into documentation is not correct.

## Changelog

chore: plugin-name
Pull Request resolved: https://github.com/facebook/flipper/pull/562

Differential Revision: D17709629

Pulled By: passy

fbshipit-source-id: ce6233ce9cac67c42b0501bd969c46114d74365a
2019-10-02 01:51:45 -07:00
Mateo Silguero
4c3028bd91 Update databases-plugin.md (#564)
Summary:
## Changelog
Pull Request resolved: https://github.com/facebook/flipper/pull/564

Differential Revision: D17709625

Pulled By: passy

fbshipit-source-id: fe62f8958872893b04e12527ef338b6140a82a68
2019-10-02 01:46:41 -07:00
Pascal Hartig
b80e18762e Bump some dependencies manually to avoid security alerts
Reviewed By: jknoxville

Differential Revision: D17666660

fbshipit-source-id: 114379d1b8edb833417cf72253ddb18a3be593c6
2019-10-01 12:24:17 -07:00
Pascal Hartig
c6d5b8ccb5 Fix screen recording on Android
Summary:
There were two issues with the previous approach:

1) We didn't block the shell process, so we would immediately
    start pulling the video from the device as soon as we **started**
    recording it. This meant, you'd usually get the previous recording
    or just an empty file.
2) The stop side doesn't know when it's actually safe to start displaying
    the video as pulling takes time. So we need access to the process
    promise there.

Reviewed By: jknoxville

Differential Revision: D17687827

fbshipit-source-id: 6ad5da52442f1888dd491b2a4c7f7a6b5a7885dd
2019-10-01 11:23:30 -07:00
Pascal Hartig
25cdca1d6f Explicit cast instead of ts-ignore
Summary: Slightly safer.

Reviewed By: jknoxville

Differential Revision: D17686947

fbshipit-source-id: 2c478707e20a1475427be4a652283960e4515cf9
2019-10-01 08:48:11 -07:00
John Knox
be72debf99 Improve headless test running script
Summary: Now emits a warning if api version doesn't match expected one.

Reviewed By: cekkaewnumchai

Differential Revision: D17685261

fbshipit-source-id: 2a01d64e2e160d411d7a58125b5bb45437476f8f
2019-10-01 07:47:04 -07:00
Chaiwat Ekkaewnumchai
7e4696cf95 Update Snapshot for Headless Test
Summary:
D14932994 changes the layout, but we did not update the snapshot.

Another option is to disable a test for now.

Reviewed By: jknoxville

Differential Revision: D17548543

fbshipit-source-id: 455e5047eab0044cabd503cae7cbc386443f376e
2019-10-01 06:16:03 -07:00
John Knox
d6f7d75e83 Remove sheet animation delay
Summary: I noticed every time you open a sheet it feels laggy and unresponsive. This removes the wait time to make it immediate.

Reviewed By: passy

Differential Revision: D17684407

fbshipit-source-id: f918bf8ca3bb0ef68c3fe01991c67d50f3967d68
2019-10-01 03:27:40 -07:00
Andres Suarez
c4c5d453c2 Fix license headers
Reviewed By: scottrice

Differential Revision: D17673481

fbshipit-source-id: 1794e0a6e92e6894b5634b24c6e7910847616261
2019-09-30 15:10:17 -07:00
Pritesh Nandgaonkar
920d4eaa1d Migrate Mobile Config plugin to tsx
Summary: This diff migrates the Mobile config plugin to typescript. In the later diffs, I will refactor the logic of the plugin to use persisted state as it can then be used to export the data, which is required for the litho support form.

Reviewed By: jknoxville

Differential Revision: D17628276

fbshipit-source-id: b48d4fb346b582408774ef08ffbead23adc7aaac
2019-09-30 07:20:58 -07:00
John Knox
8e623d7a05 Add .ignore file to speed up ripgrep
Summary:
Some repositories disable using .gitignore files with ripgrep. This adds an explicit .ignore symlink so that it is always used.
Vastly speeds up using ripgrep in VS code.

Reviewed By: passy

Differential Revision: D17664864

fbshipit-source-id: cd798a41b813e32f64e8e75b6100445ace6b00d8
2019-09-30 06:41:57 -07:00
Pascal Hartig
e6d8844ceb Potential fix for console proxying
Summary: My hypothesis is that on hot reloads / `Ctrl+R`s calls to `this.log` from within the proxy would call the proxy itself. So the only truly relevant change here should be the `.bind(this)` removal. But I'm still not 100% sure that this was the reason for the stack overflow error. Let's keep an eye on this.

Reviewed By: jknoxville

Differential Revision: D17664509

fbshipit-source-id: c9e1c5fe32048b04ef0585f7162bd00ad5ccf18a
2019-09-30 06:32:34 -07:00
Pascal Hartig
31f9d865b2 Fix screenshot taking and video recording for Windows
Summary: Turns out Windows really doesn't like colons in filenames. Sigh.

Reviewed By: jknoxville

Differential Revision: D17664236

fbshipit-source-id: 664885308815d862007c8a9a9d1278c426b4e756
2019-09-30 05:24:19 -07:00
Pascal Hartig
0039d5be4a Use 'open' module to open stuff
Summary:
Instead of our ad-hoc mechanism. There's quite a bit
of trickery involved to make this work reliably on Windows
so I'd rather take an off-the-shelf solution than reimplement this
myself.

Reviewed By: jknoxville

Differential Revision: D17628949

fbshipit-source-id: 98806b60a107231d9ee07b721ebb70f2cbd8aec1
2019-09-30 03:49:06 -07:00
Vladyslav Stepanov
ba559ac338 Added new Flipper API
Differential Revision: D17542140

fbshipit-source-id: 2d7512b345d1d5e8add76a607e62effe4f4a5f16
2019-09-27 17:11:49 -07:00
James Donald
5bc5c34d2e Remove unused variable in catch(...) expressions
Summary:
D17629896 was intended to fix this in ovrsource, but it turns out these changes should be made on fbsource first then get synced.

The MSVC build of OculusPCSDK has numerous warnings, including these low-hanging fruit:

```
c:\open\ovrsource\xplat\omnistore\client\common\reportsubscriptionstatetiming.cpp(28): warning C4101: 'e': unreferenced local variable
c:\open\ovrsource\xplat\omnistore\client\common\databaseanalyticsmetadatatiming.cpp(23): warning C4101: 'e': unreferenced local variable
c:\open\ovrsource\xplat\omnistore\client\common\sendqueuereportbacklogtiming.cpp(32): warning C4101: 'e': unreferenced local variable
c:\open\ovrsource\xplat\omnistore\client\common\omnistore.cpp(192): warning C4101: 'e': unreferenced local variable
c:\open\ovrsource\xplat\omnistore\client\common\omnistore.cpp(907): warning C4101: 'e': unreferenced local variable
c:\open\ovrsource\xplat\omnistore\client\common\omnistore.cpp(934): warning C4101: 'e': unreferenced local variable
c:\open\ovrsource\xplat\omnistore\client\common\omnistore.cpp(946): warning C4101: 'e': unreferenced local variable
```

Clang doesn't complain, but the code is just as clear without the 'e' so best to remove.

Reviewed By: vener91

Differential Revision: D17631747

fbshipit-source-id: 0190a48e640311b40c9d1b988b0c07cfbdcfd7e5
2019-09-27 15:47:03 -07:00
Pascal Hartig
4b60433425 Add warning when config parsing fails
Summary:
This can quite easily happen if you manually edit it and
aren't careful. The least we can do is tell the user about it,
because it be a bit surprising otherwise.

Reviewed By: jknoxville

Differential Revision: D17626760

fbshipit-source-id: 8c7d64b041fa4b97ce2753116800d0e855442dd9
2019-09-27 08:14:53 -07:00
Alexander Putilin
dda800c4a3 Initial support for KaiOS device plugins
Summary: Introduces basic KaiOSDevice class. Since kaios phones support adb, it is inherited from AndroidDevice

Reviewed By: jknoxville

Differential Revision: D17608605

fbshipit-source-id: 6b2c5834a1f5862b864c8e76202d0d401e58cbcc
2019-09-27 06:11:18 -07:00
John Knox
1c9fc75457 Add some uncached icons to the preloaded set
Reviewed By: passy

Differential Revision: D17602891

fbshipit-source-id: f06b2de37eec0909dd7098dd0b2ea0f0514c5ab5
2019-09-27 03:36:27 -07:00
John Knox
2bd8548252 Warn when uncached icons are used
Reviewed By: passy

Differential Revision: D17602743

fbshipit-source-id: 8f7dc0cc8d181ad4f7784ed3aafe064d816832c9
2019-09-27 03:36:27 -07:00
John Knox
9d4cc64bc9 Fix outline icon caching
Summary:
The build-release script was using different logic to construct the local url, than the lookup file.
Changed so they both use the same function.
And unit tests added.

Reviewed By: passy

Differential Revision: D17602476

fbshipit-source-id: 6aaedd58eafb2cc59adcdc0ebb4dd329bf99c33a
2019-09-27 03:00:49 -07:00
John Knox
74b9ba5c40 Auto-format FlipperClient.cpp
Reviewed By: passy

Differential Revision: D17601356

fbshipit-source-id: 04701b409a838ad4dac54ae7c4f5f97cfa574dbe
2019-09-27 02:57:13 -07:00
John Knox
6796a87e76 Enable adbConfig test
Summary:
I noticed this didn't have the node prefix so isn't run during `yarn test`.
Now it runs and passes :)
Also checked `ls **/__tests__/*.js` for any similar files and found none.

Reviewed By: passy

Differential Revision: D17601931

fbshipit-source-id: cf45a0ba578d5d0000ba1d25ae4fb26a4f7fc7af
2019-09-27 02:45:28 -07:00
Pascal Hartig
48161cb6cf Flipper Bump: v0.25.1-SNAPSHOT
Summary: Back to snapshots.

Reviewed By: priteshrnandgaonkar

Differential Revision: D17601073

fbshipit-source-id: 4987f717d34ecd13577f06e39fff86419346bad6
2019-09-26 11:05:37 -07:00
Pascal Hartig
2e3499cd4a Flipper Release: v0.25.0
Summary:
**Highlights**

- Android: Leakcanary is no longer part of the core distribution but a separate artifact: `com.facebook.flipper:flipper-leakcanary-plugin`.

Reviewed By: priteshrnandgaonkar

Differential Revision: D17601074

fbshipit-source-id: 862fc44d45b4ddc95059deb3959476af162b1cb0
2019-09-26 11:05:37 -07:00
Pascal Hartig
8a8316097a Update bump binaries
Summary: Compiled versions of scripts/bump/.

Reviewed By: priteshrnandgaonkar

Differential Revision: D17572052

fbshipit-source-id: 91f273b43daf4f59cdb0e7d2cd4ee97648ca53b9
2019-09-26 11:05:36 -07:00
Pascal Hartig
c401f2c27d Add new bump paths
Summary: Make sure our docs get updated on release.

Reviewed By: danielbuechele

Differential Revision: D17571990

fbshipit-source-id: 36d19601cb5fb5d215e0894ef4a362e364d32880
2019-09-26 11:05:36 -07:00