Commit Graph

3359 Commits

Author SHA1 Message Date
Pascal Hartig
2c20f016d4 Use anyhow for error handling
Summary:
This is a nice solution if you don't want to spend
too much time thinking about error handling.
You have one common return type and can basically use `?`
everywhere while still maintaining the flexibility to
create custom error types where needed.

Reviewed By: jknoxville

Differential Revision: D21349046

fbshipit-source-id: 073539ce8422cdb3e0141886e95321052bc0c7a3
2020-05-01 09:43:16 -07:00
Pritesh Nandgaonkar
6f9d82117e Publish pods gh (#1083)
Summary:
This PR adds a github action to publish pods on a new tag. It also tries to fix a race condition which happens when we try to publish FlipperKit pod. During the release of FlipperKit pod, we rely on the newly published Flipper Pod, and sometimes the release of Flipper Pod takes a time to get updated in the cocoapods trunk.

This is a known issue by the Cocoapods and they will be shipping a fix to this in Cocoapods 1.10. Till then we can keep retrying for 5 times.

Ref: https://github.com/CocoaPods/CocoaPods/issues/9502#issuecomment-579486258

## Changelog

- Adds Github actions to publish cocoapods.
- Removes the Circle CI config to publish on cocoapods
Pull Request resolved: https://github.com/facebook/flipper/pull/1083

Test Plan: I tested this action by running it on this PR and it worked fine.

Reviewed By: jknoxville

Differential Revision: D21348084

Pulled By: priteshrnandgaonkar

fbshipit-source-id: f33f3cdef43ae032ad42c94db72323212e40ec67
2020-05-01 09:07:02 -07:00
John Knox
c5cd182ac6 Use docusaurus-plugin-internaldocs-fb
Summary: Adds a docusaurus plugin to direct fb employees to the internal documentation.

Reviewed By: nikoant

Differential Revision: D21348579

fbshipit-source-id: 5093d68a23ec6ba91c6ae94bf7cb0e58fcf3e7ef
2020-05-01 07:03:01 -07:00
Pascal Hartig
155a8c6952 Initial packer project
Summary:
This is a tool (right now more a script, really) for splitting a Flipper distribution into smaller chunks that can be individually cached, hashed and downloaded. It's incomplete but can already bundle up Mac apps into smaller chunks that can be merged back again into one app.

It takes a config file that specifies how to slice the inputs up and comes with a default copy bundled in. That's in line with the general "design" where it tries to make the right assumptions, for instance defaulting to the normal dist output directory.

Reviewed By: jknoxville

Differential Revision: D21302551

fbshipit-source-id: b22670ff4825ce526dd0f20320f87080c058cd93
2020-05-01 04:04:48 -07:00
Dan Melnic
de5147a516 Add support for io_uring based async read/recvmsg
Summary:
Add support for io_uring based async read/recvmsg

(Note: this ignores all push blocking failures!)

Reviewed By: kevin-vigor

Differential Revision: D21208891

fbshipit-source-id: 21b3b5e0f201e982ecb50a284d03ab53413ec3e3
2020-04-30 13:30:22 -07:00
John Knox
a0cd37b5ef Distinguish links from regular text
Summary: Changes the link color to something that isn't very similar to the rest of the text.

Reviewed By: nikoant

Differential Revision: D21328856

fbshipit-source-id: 9467e368411caeb58e00642b48ef4413d285850e
2020-04-30 10:26:24 -07:00
Anton Nikolaev
a47cd12c84 Fixed publishing of "flipper-pkg"
Summary: There was an error on "lint" command, because json schemas was not published as a part of npm package

Reviewed By: jknoxville

Differential Revision: D21328254

fbshipit-source-id: 531d5892ccfea0c68a6369d44af43c840c3fe4ca
2020-04-30 10:21:44 -07:00
John Knox
263aba9f31 Add custom edit url for ui-components page
Summary:
This page is auto generated, so the default link gives a 404.
Pointing it to the script instead.

Reviewed By: passy

Differential Revision: D21325554

fbshipit-source-id: 5ede07daa6335ad0199a11c5483e328c3ca2c5e3
2020-04-30 07:13:47 -07:00
Pascal Hartig
ac400e5420 Update homepage title
Summary:
It's currently a lower-case "index" which looks a bit off. :)

{F235813923}

Reviewed By: mweststrate

Differential Revision: D21324972

fbshipit-source-id: 6b75b23aa0122e2db08f7532205b6e07758155fc
2020-04-30 06:59:31 -07:00
Michel Weststrate
5db7820820 Add support for Jest runner
Summary:
This diff adds compatibility with https://marketplace.visualstudio.com/items?itemName=Orta.vscode-jest and makes sure the `yarn jest` command works without further arguments by defaulting to the unit test setup.

This makes tests runnable from VSCode, highlights which tests passed, and show errors inline (and coverage as well if desired), and will report failing tests in the problems panel.

{F235815220}

The debugger can be started right from the code pane as well by clicking the tiny 'debug'

{F235815208}

Currently set up the defaults to not start tests after startup, as it can be CPU hogging, so simply run the command CMD+SHIFT+P 'start jest runner' instead.

Reviewed By: passy

Differential Revision: D21325241

fbshipit-source-id: 7b87297a710a18bbac394110dc2006218ccc7d86
2020-04-30 06:32:34 -07:00
Michel Weststrate
b474ef24e0 expand components slowly
Summary:
This diff introduces the concept of `shouldExpand` in DataInspector. Rather than expanding components right away, we only expand if the CPU is idly, this makes sure our app remains interactive, rather than stalling for 15 seconds as shown in the example query.

In the future we could solve the blocking by using react suspense as well, but this solution has the nice benefit that it allows inspecting and interacting with the data right away.

Changelog: The JSON inspector in plugins like GraphQL no longer freezes Flipper temporarily when expanding large data sets and will remain interactive during

Reviewed By: jknoxville

Differential Revision: D21302821

fbshipit-source-id: 6a53858f9062175596dc695c4af172d60422abe7
2020-04-30 06:32:34 -07:00
Michel Weststrate
3726bddefc Refactor some render computations to local state
Summary: The goal of this stack is to gradually expand large data trees, rather than all at once. To enable that, we need to be able to distinguish 'expandability' vs. 'being expanded'. By moving computations from render to the component hooks and store the results locally, we get a step closer to that.

Reviewed By: jknoxville

Differential Revision: D21301927

fbshipit-source-id: cfb617214d4b2005796b33b41c1abe0032e41847
2020-04-30 06:32:34 -07:00
Michel Weststrate
8f22cf9e81 Add unit tests
Summary:
Added unit tests to DataInspector prevent regressions in upcoming refactor

Found a bug where changes in `collapsed` aren't propagated. Fixed as well.

Reviewed By: jknoxville

Differential Revision: D21301858

fbshipit-source-id: 764bddeff30f9d4dbfc85d990635f67c20cfacb1
2020-04-30 06:32:33 -07:00
Pascal Hartig
5c05e4e85b Point "Report Problems" to Workplace internally
Summary: OSS continues to be GitHub issues.

Reviewed By: mweststrate

Differential Revision: D21324887

fbshipit-source-id: c024337d7f8e976d9f755de928a0af29d76d4321
2020-04-30 06:05:46 -07:00
Pascal Hartig
1011042bdb Remove bugnub
Summary:
Good bye, sweet prince.
We've decided to remove the internal bugnub as its usage is quite low
and the experience is subpar. In the future, we'd rather reuse the
support form v2 and integrate it with our group.

Reviewed By: mweststrate

Differential Revision: D21300627

fbshipit-source-id: d3c7271efcee4ad22ec76394870902f2712e392d
2020-04-30 06:05:46 -07:00
John Knox
4a777df617 Fix more links
Summary:
Somehow I missed these two the last time.
These are the final broken links reported by https://www.brokenlinkcheck.com/broken-links.php#status except for the "edit this page" link on the autogenerated ui-components page.

Reviewed By: mweststrate

Differential Revision: D21325511

fbshipit-source-id: dbc61bbed1366a007ed2cdde3a72f8ea974d871f
2020-04-30 05:59:01 -07:00
Anton Nikolaev
fc18bafb71 Fix workspace version bumping script to also bump peerDependencies
Summary: Fixed bumping of local peer dependencies and manually bumped the version which was not bumped automatically during the latest release.

Reviewed By: passy

Differential Revision: D21308701

fbshipit-source-id: 936a04b432ad3c9313644c1bf96966c52e022d7e
2020-04-30 04:32:36 -07:00
Anton Nikolaev
b0a0b0f355 Babel transformations refactoring
Summary: Just a small refactoring to only create array with plugins once. This should make transformations a bit faster as all these methods are called many times for each file in the project.

Reviewed By: passy

Differential Revision: D21308498

fbshipit-source-id: 0ed47f13cebfebd2992817caa207dc55f1dbeb0a
2020-04-30 04:29:41 -07:00
Anton Nikolaev
c21ccedf14 Dev mode: fixed loading plugins located outside of the Flipper source root folder
Summary: Dev mode: fixed loading of plugins located outside of the Flipper source root folder, e.g. in ~/flipper-plugins as suggested in tutorial docs.

Reviewed By: passy

Differential Revision: D21306639

fbshipit-source-id: bb9044b25324065f0c12169b95fbe663da8d4305
2020-04-30 04:29:41 -07:00
John Knox
b27f8ee236 Fix broken links inside app
Summary:
Searched for broken link patterns inside the app itself. I think I found them all but it's not certain.

Patterns searched for and replaced:
```
.html
getting-started/)
getting-started)
getting-started"
```

and also searched the repo for regex `\]\(.*)` and checked them by eye.

Reviewed By: passy

Differential Revision: D21306944

fbshipit-source-id: a2e09b0fd8677f5f26e5cc4a06805b474247f7e6
2020-04-30 03:19:22 -07:00
Dan Yang
56b4d43eb0 Database Plugin - Increase blob max length and attempt to render UTF-8
Summary: 512 is a pretty small blob length. Increasing it to 5120 and changing it to attempt to stringify UTF-8 if not ascii.

Reviewed By: jknoxville

Differential Revision: D21253132

fbshipit-source-id: 1cc9226b86a9b9ddfd73e29c8b0c04ac54b5b4b2
2020-04-29 16:11:22 -07:00
Dan Yang
3e0f07ac97 Database plugin - Render blob cells
Summary: As titled. The android plugin was already sending the data in blob cells as `{ type: 'blob' value: string }` (see com/facebook/flipper/plugins/databases/ObjectMapper.java?lines=213-216).

Reviewed By: jknoxville

Differential Revision: D21253129

fbshipit-source-id: 15a44c72f4030887a50faece780c89aa65f6a45b
2020-04-29 16:11:21 -07:00
Chaiwat Ekkaewnumchai
168d06011f Try to Retrieve Body from Request
Summary:
Previously, requests were passed to process first in an interceptor, and it is responsibility of an interceptor to process requests for responses. In FlipperOkhttpInterceptor, we did read data from request body before processing it. This caused a bug when the network process itself wants to also read that data, but the stream has been closed because the interceptor has just read. The fix is to report request body after we have triggered network call so that we can just drop request body if we cannot read.

This diff tries to bring back the same functionality while not cause the bug to occur by cloning the content to be read by Flipper and using the same one for the request.

Reviewed By: jknoxville

Differential Revision: D21279679

fbshipit-source-id: 47f8b29a1896705d8d2d601661cd485db572d251
2020-04-29 10:47:16 -07:00
Adam Ernst
affade67ff Remove unused getAllNodes support from Layout plugin impl
Summary: Added in D14209157, but the JavaScript no longer ever calls this method.

Reviewed By: jknoxville

Differential Revision: D21290792

fbshipit-source-id: df1969d83f0dc096a24977c15c27100d2f2bdfc0
2020-04-29 08:37:55 -07:00
generatedunixname89002005306973
60e9ebb4f1 Flipper Snapshot Bump: v0.40.1-SNAPSHOT
Summary: Releasing snapshot version 0.40.1-SNAPSHOT

Reviewed By: nikoant

Differential Revision: D21302036

fbshipit-source-id: cbf996760ca70db53607ebec722ac593fa882959
2020-04-29 08:33:04 -07:00
generatedunixname89002005306973
bd320b94e1 Flipper Release: v0.40.0
Summary: Releasing version 0.40.0

Reviewed By: nikoant

Differential Revision: D21302037

fbshipit-source-id: 2f2aeaf0aaf7a0d2fb65b21b6243c9ecd2684cdc
2020-04-29 08:33:04 -07:00
Scott Kyle
c7a6908093 Add API to retrieve Java Object from Flipper objects
Summary: There's no existing API on the Flipper objects to get an arbitrary Java object, which we need in an inspector plugin we're building (`getDynamic` requires you to know what you want in the end).

Reviewed By: jknoxville

Differential Revision: D21223329

fbshipit-source-id: 29e9f8788be404cec44c6ddeb6b56b939b97b766
2020-04-29 08:27:21 -07:00
John Knox
7e4682b694 Fix the remaining broken links on fbflipper.com
Summary:
Used https://www.brokenlinkcheck.com/broken-links.php#status for now to find broken links and fixed them all.

Would be better to use some automated tool to check this at diff time, but that's not setup yet.

Reviewed By: passy

Differential Revision: D21301702

fbshipit-source-id: f13c8769b15d9f99563fc65dc0544320d07a2bfb
2020-04-29 07:33:43 -07:00
Pascal Hartig
f1abd8a4a4 Update bump binaries
Summary: Update pre-compiled binaries in the repo by running `stack build` on Linux and MacOS.

Reviewed By: nikoant

Differential Revision: D21301515

fbshipit-source-id: f3b648c03a4ec7c680c88574caa3f4abbe5e0fe0
2020-04-29 06:34:58 -07:00
Pascal Hartig
c21a2645ed Fix doc path
Summary: This was broke the script from running.

Reviewed By: nikoant

Differential Revision: D21301581

fbshipit-source-id: 146c4bacb638171d8efe9ba1d25d75cac0b19a06
2020-04-29 06:34:58 -07:00
Pritesh Nandgaonkar
513414de04 Make integration of new groups simpler
Summary: This diff simplifies the way new groups can be added into the Support form. Users will have to just make an entry in constants folder, thats it. It will automatically be added into the support form.

Reviewed By: jknoxville

Differential Revision: D21257033

fbshipit-source-id: 8823855c7a7732862a964fc17fa7311512b861db
2020-04-29 05:41:46 -07:00
Pritesh Nandgaonkar
38186c8995 Add dropdown for selecting groups
Summary: This diff refactors the group selection to the dropdown. As with the growing list of grps, dropdown will be easy to search and scale

Reviewed By: mweststrate

Differential Revision: D21175998

fbshipit-source-id: 90f1a81dfc6c2232cd2dcf767ed01205fc63e1fd
2020-04-29 05:41:45 -07:00
John Knox
281cd67ddb Fix some broken links
Summary:
KESHAmambo pointed out some internal links are broken on the website: https://twitter.com/KESHAmambo/status/1255443093542895619

The way relative links are processed in docusaurus v1 and v2 has changed. This fixes them up.

Reviewed By: mweststrate

Differential Revision: D21301293

fbshipit-source-id: 7610e38a55bc066625373cf2eee9a3efb63aec08
2020-04-29 05:21:31 -07:00
Adam Ernst
c62760b3e8 Speed up Flipper by using background queue for serialization
Reviewed By: jknoxville

Differential Revision: D21290732

fbshipit-source-id: 21fcb793900a6517d764fa3a581255fd75a39801
2020-04-28 21:32:49 -07:00
John Knox
b483e0688d Make h3 smaller than h2
Summary:
After moving to docusaurus v2, our h3 tags are bigger than the h2 tags.
Removing our custom css fixes this, so doing that to get closer to the default theme.

Reviewed By: mweststrate

Differential Revision: D21283840

fbshipit-source-id: ceaf7488b90bbb90a463037d9e1dfcca1d694366
2020-04-28 17:33:25 -07:00
John Knox
6554f23853 Fix numbered list syntax
Summary:
Numbered list syntax changed during the docusaurus migration from v1 to v2.

It looks wrong at https://fbflipper.com/docs/extending/js-setup/

This fixes it.

I searched for "1)" and replaced all numbered lists it found.

Reviewed By: mweststrate

Differential Revision: D21283693

fbshipit-source-id: adeb6e04693f50e0a0cfe4b2de5f4663075c34ce
2020-04-28 17:33:25 -07:00
Scott Kyle
39a384e33d Syntax highlight state values
Summary: This adds simple syntax highlighting for state value in the table.

Differential Revision: D21223208

fbshipit-source-id: 82b474cf19e3e13f5ebe5c474dc0f7d41cf4a56a
2020-04-28 15:54:22 -07:00
Anton Nikolaev
cdc851f281 Fix release version bumping in docs
Summary: Fix release version bumping in docs after switching from ".md" to ".mdx".

Reviewed By: mweststrate

Differential Revision: D21282492

fbshipit-source-id: 60ecfd9a058b71d1895945c9c3d05b9df8f6493c
2020-04-28 11:43:58 -07:00
greenkeeper[bot]
dade1dadf7 Update @oclif/plugin-help in group pkg to the latest version � (#1069)
Summary:
***
☝️ **Important announcement:** Greenkeeper will be saying goodbye 👋 and passing the torch to Snyk on June 3rd, 2020! [Find out how to migrate to Snyk and more at greenkeeper.io](https://greenkeeper.io)
***
## The dependency [oclif/plugin-help](https://github.com/oclif/plugin-help) was updated from `2.2.3` to `3.0.0`.
This version is **not covered** by your **current version range**.

If you don’t accept this pull request, your project will work just like it did before. However, you might be missing out on a bunch of new features, fixes and/or performance improvements from the dependency update.

 ---

**Publisher:** [chadian](https://www.npmjs.com/~chadian)
**License:** MIT

[Find out more about this release](https://github.com/oclif/plugin-help).

 ---

<details>
  <summary>FAQ and help</summary>

  There is a collection of [frequently asked questions](https://greenkeeper.io/faq.html). If those don’t help, you can always [ask the humans behind Greenkeeper](https://github.com/greenkeeperio/greenkeeper/issues/new).
</details>

 ---

Your [Greenkeeper](https://greenkeeper.io) bot 🌴
Pull Request resolved: https://github.com/facebook/flipper/pull/1069

Reviewed By: nikoant

Differential Revision: D21278324

Pulled By: passy

fbshipit-source-id: 6217e4d078341d15795b454b47b3ce482a0bfeeb
2020-04-28 07:13:49 -07:00
Pascal Hartig
b24b6110fa Set up E2E workspace
Summary:
To be very clear, this is not the final layout of this in any way
but it already automates at least testing that the app starts
up and the changelog shows.

This sets up the annoyingly verbose setup for this. One
of the downsides of workspaces is that we need to be able
to install all dependencies at once, including the chrome-webdriver
which means we need to install the full electron cache now for linting, too.

Reviewed By: nikoant

Differential Revision: D21204578

fbshipit-source-id: b3403ab62b799228976a651620ea360e0bb1cf99
2020-04-28 07:04:11 -07:00
Radek Czemerys
884d64df71 Add missing TS type in UserAccount (#1063)
Summary:
Adds missing TS for Store type in `react-redux` `connect`, same as in other components.
Forgot to add in https://github.com/facebook/flipper/issues/1062

## Changelog

Internal change: Typescript typings improved.
Pull Request resolved: https://github.com/facebook/flipper/pull/1063

Test Plan: Try to compile/do a type check.

Reviewed By: nikoant

Differential Revision: D21278326

Pulled By: passy

fbshipit-source-id: c8e8e18c3c6d5f8904e97228540d4d7c4274124f
2020-04-28 06:55:57 -07:00
Timur Valiev
931bf1f14f export ElementsInspectorProps; optional id of linked Elements
Summary: a bit of refactoring since we are going to use elements inspector a lot in NT related plugins

Reviewed By: jknoxville

Differential Revision: D21155830

fbshipit-source-id: 0ff6acf97658bccbbed86388257bbad207fd65b4
2020-04-28 06:06:09 -07:00
Timur Valiev
79937f198d graph api calls to sandbox
Summary: We are working on integrating new NT debug api and debug metadata is stored in sandbox

Reviewed By: jknoxville

Differential Revision: D21155832

fbshipit-source-id: 2a7c8303e62793092f9e5b27f61d9db38eab14c5
2020-04-28 06:06:08 -07:00
Anton Nikolaev
1cf3c30b7c "migrate" command for flipper-pkg tool
Summary: "migrate" command for easy migration of existing Flipper plugins to the specification version 2.

Reviewed By: passy

Differential Revision: D21253913

fbshipit-source-id: 9edb170fbaa10e9c3f670d5d68e69f4f6106c151
2020-04-28 05:01:06 -07:00
Anton Nikolaev
deb0daa7f3 Fix tests on Windows (#1072)
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/1072

Once again fixed GH windows jobs which are currently failing

Reviewed By: mweststrate

Differential Revision: D21277273

fbshipit-source-id: 0df6ee7eb00b8f72bd6952747fa0e25e787ca335
2020-04-28 04:58:04 -07:00
Anton Nikolaev
c1b97e5d1f Fix loading plugins in dev mode
Summary: Fixed loading plugins in dev mode

Reviewed By: timur-valiev

Differential Revision: D21262894

fbshipit-source-id: c4ab6902d3153c3580c71f27df91290122627fae
2020-04-27 18:15:42 -07:00
Anton Nikolaev
d08dfee018 "init" command for flipper-pkg tool
Summary: Added command "init" to "flipper-pkg" which helps to quickly initialise Flipper desktop plugin.

Reviewed By: passy

Differential Revision: D21253819

fbshipit-source-id: 85a2fbde07ecb63737d180d2a7e5cc2846b4f533
2020-04-27 17:34:12 -07:00
Anton Nikolaev
21c574ac80 "lint" command for flipper-pkg tool
Summary:
Implemented json schema for flipper plugin package.json and used it for validation in "flipper-pkg lint" command.

Nice thing about json schema is that it not only allows to validate json, but also can be referenced using "$schema" property in json so IDEs like VSCode can find it and use for code completion, validation and to show properties documentation. I'm going to deploy the schema as a part of documentation website so it can be referenced as https://fbflipper.com/schemas/plugin-package/v2.json.

Also the "$schema" field can be used instead of "specVersion" to determine the specification according to which the plugin is defined. E.g., if specification version 3 would be created, it will be described in schema https://fbflipper.com/schemas/plugin-package/v3.json, etc.

Reviewed By: passy

Differential Revision: D21228294

fbshipit-source-id: f21351e584ef936a7d6b314436448489691f83a6
2020-04-27 17:34:11 -07:00
Pascal Hartig
01f8d80402 Fix getting started link from README (#1065)
Summary:
Fix https://github.com/facebook/flipper/issues/1064.
Pull Request resolved: https://github.com/facebook/flipper/pull/1065

Test Plan: eyes

Reviewed By: jknoxville

Differential Revision: D21257849

Pulled By: passy

fbshipit-source-id: 9e973b8eceef66b9ceaaba1c326b07c92817316d
2020-04-27 11:19:33 -07:00
Michel Weststrate
dba480ce74 Preserve Navigation plugin as background plugin eevn when disabled
Summary:
This diff fixes an issue where we don't want to have the Navigation plugin be disabled as background plugins like all other plugins, so that the breadcrumb navigation keeps working.

Yet another hack concerning the super useful Navigation plugin. On a positive note, since connection management for background is not entirely managed by the Desktop and not the native said, these kind of exceptions are fairly easy to make :)

Reviewed By: passy

Differential Revision: D21089537

fbshipit-source-id: 209954ff35c95e066fe688a60ad46ccfc3835c44
2020-04-27 09:46:14 -07:00