Commit Graph

11 Commits

Author SHA1 Message Date
Michel Weststrate
f0c54667e0 Support handling deeplinks in plugins
Summary:
This adds support for handling incoming deeplinks in a Sandy plugin, which can be done by using a `client.onDeepLink(deepLink => { } )` listener

Also generalized deeplinks to not just support strings, but also richer objects, which is beneficial to plugin to plugin linking.

Reviewed By: jknoxville

Differential Revision: D22524749

fbshipit-source-id: 2cbe8d52f6eac91a1c1c8c8494706952920b9181
2020-07-22 04:13:59 -07:00
ZHANG Qichuan
c068deac2d Fix the network plugin crashes when Add Route button is pressed (#1281)
Summary:
Changelog:
Fix Network Mock Dialog crashes when 'Add Route' button is pressed  https://github.com/facebook/flipper/issues/1280

Pull Request resolved: https://github.com/facebook/flipper/pull/1281

Reviewed By: cekkaewnumchai

Differential Revision: D22151908

Pulled By: passy

fbshipit-source-id: cafd2b53d76cd9ea213f8be09866222a6330d043
2020-06-22 02:14:26 -07:00
ZHANG Qichuan
ae9c07c8f3 Persist the Network mock data (#1218)
Summary:
Persist the Network mock data, so it can survive after switching the plugins

Closes https://github.com/facebook/flipper/issues/1206
## Changelog

- Persist the Network mock data
- Remove the pref-filled '/' when creating a mock route
Pull Request resolved: https://github.com/facebook/flipper/pull/1218

Test Plan: <img width="807" alt="Screenshot 2020-06-02 at 11 45 15 PM" src="https://user-images.githubusercontent.com/410850/83540614-27e95000-a52b-11ea-8fc8-d7ad1373e904.png">

Reviewed By: mweststrate

Differential Revision: D21863561

Pulled By: passy

fbshipit-source-id: 4706ede721c7990a6bcc0bfe51f41e80306ffac7
2020-06-19 05:27:48 -07:00
Zheng Rongyan
2dcb73aba5 Check whether the request url is null or not to avoid error. (#1146)
Summary:
### The existing issue
[The `buildRow` function in `network/index.js`](c7ff6f6266/desktop/plugins/network/index.tsx (L458)) doesn't check if the url is valid. However,
since the `request` data comes from the App which developers are building,
there will be an error, if the `request.url` is `null` or `undefined`.

![image](https://user-images.githubusercontent.com/7471672/81561808-5c536b80-93c6-11ea-846b-3aa76d726350.png)

When this error occurs,  the `NetworkTable` can't go back to normal even I try to  click `Clear error and try again`.  Only after killing the Flipper desktop and restart again, it can work again.
![error](https://user-images.githubusercontent.com/7471672/81563438-d553c280-93c8-11ea-86be-883fa457dda3.gif)

### How to fix

In order to make `Flipper` desktop more stable, I think it is better to check the url is valid and avoid the crash.

## Changelog

-  check the url in the `buildRow` function in `network/index.js`
Pull Request resolved: https://github.com/facebook/flipper/pull/1146

Test Plan:
- [x] Using the same input `request` data, `Flipper` will not show this row and it works as normal.
![image](https://user-images.githubusercontent.com/7471672/81562713-e819c780-93c7-11ea-809d-cf6893c58a68.png)

Reviewed By: jknoxville

Differential Revision: D21502032

Pulled By: passy

fbshipit-source-id: 1dd8ad7f13297ce99680053447024a8563b8a975
2020-05-11 09:13:05 -07:00
Anton Nikolaev
3ff2d3bf99 Add "id" field to Flipper plugin manifest
Summary:
Added "id" field to Flipper plugin manifest which is used to match native and desktop plugin parts. Before that, "name" field was used both as npm package name and as plugin id.

The problem is that currently there are a lot of plugins which has invalid values in "name", e.g. not starting with "flipper-package-", or containing upper cased letters.

Simple renaming of "name" field can be very problematic, so we need a new field to avoid any breaking changes and keep historical analytics data which is also bound to plugin id.

Reviewed By: mweststrate

Differential Revision: D21129689

fbshipit-source-id: efd143c82a6a802cc0b5438fd3f509bd99aded0e
2020-04-20 11:14:36 -07:00
Anton Nikolaev
ca2d04a5da Versioning for plugin format
Summary:
Added versioning for plugin format.

The first version is where "main" points to source code entry and plugins are bundled by Flipper in run-time on loading them.

The second version is where "main" points to the already existing bundle and Flipper just loads it without bundling. The plugins of version 2 must be bundled using "flipper-pkg" tool before publishing.

Changelog: Support new packaging format for plugins.

Reviewed By: mweststrate

Differential Revision: D21074173

fbshipit-source-id: 7b70250e48e5bd5d359c96149fb5b14e67783c4d
2020-04-20 06:03:16 -07:00
Pascal Hartig
fc9ed65762 prettier 2
Summary:
Quick notes:

- This looks worse than it is. It adds mandatory parentheses to single argument lambdas. Lots of outrage on Twitter about it, personally I'm {emoji:1f937_200d_2642} about it.
- Space before function, e.g. `a = function ()` is now enforced. I like this because both were fine before.
- I added `eslint-config-prettier` to the config because otherwise a ton of rules conflict with eslint itself.

Close https://github.com/facebook/flipper/pull/915

Reviewed By: jknoxville

Differential Revision: D20594929

fbshipit-source-id: ca1c65376b90e009550dd6d1f4e0831d32cbff03
2020-03-24 09:38:11 -07:00
Anton Nikolaev
863f89351e Yarn workspaces
Summary:
1) moved "sonar/desktop/src" to "sonar/desktop/app/src", so "app" is now a separate package containing the core Flipper app code
2) Configured yarn workspaces with the root in "sonar/desktop": app, static, pkg, doctor, headless-tests. Plugins are not included for now, I plan to do this later.

Reviewed By: jknoxville

Differential Revision: D20535782

fbshipit-source-id: 600b2301960f37c7d72166e0d04eba462bec9fc1
2020-03-20 13:37:41 -07:00
Chaiwat Ekkaewnumchai
1d23b5418a (Server) Include Mock Component to Main Files
Summary:
- Add mock button if a client supports the function
- Open the dialog when clicking the button

Note:
- This is a part of this PR: https://github.com/facebook/flipper/pull/488

Reviewed By: mweststrate

Differential Revision: D20440145

fbshipit-source-id: 750099020e0b2d6ed10bb20e883f6b3be664ae79
2020-03-17 10:09:13 -07:00
Chaiwat Ekkaewnumchai
59c821db8d (Server) Add Context to Manipulate Route State
Summary:
This diff added dummy state handler for route, which appeared in the next diffs. Routes will be used to render components for mocking handler and determine data on the client side.

State and other variables will appear on the next diffs.

Note:
- This is a part of this PR: https://github.com/facebook/flipper/pull/488

Reviewed By: mweststrate

Differential Revision: D20440150

fbshipit-source-id: d441ae1d53caf7280bef78d937aaa71617e2da9f
2020-03-17 10:09:12 -07:00
Anton Nikolaev
10d990c32c Move plugins to "sonar/desktop/plugins"
Summary:
Plugins moved from "sonar/desktop/src/plugins" to "sonar/desktop/plugins".

Fixed all the paths after moving.

New "desktop" folder structure:
- `src` - Flipper desktop app JS code executing in Electron Renderer (Chrome) process.
- `static` - Flipper desktop app JS code executing in Electron Main (Node.js) process.
- `plugins` - Flipper desktop JS plugins.
- `pkg` - Flipper packaging lib and CLI tool.
- `doctor` - Flipper diagnostics lib and CLI tool.
- `scripts` - Build scripts for Flipper desktop app.
- `headless` - Headless version of Flipper desktop app.
- `headless-tests` - Integration tests running agains Flipper headless version.

Reviewed By: mweststrate

Differential Revision: D20344186

fbshipit-source-id: d020da970b2ea1e001f9061a8782bfeb54e31ba0
2020-03-14 14:35:18 -07:00