Commit Graph

265 Commits

Author SHA1 Message Date
Brian Vaughn
07a6a3b87d Upgrade React DevTools 4.0.6 -> 4.6.0
Summary:
Upgrading the embedded version of React DevTools, primarily to pull in [this PR](https://github.com/facebook/react/pull/18397) which will reduce the impact of this package on `node_modules` size.

# Update process

Following a similar process as D15973709, I began by searching for [all of the references](https://our.intern.facebook.com/intern/biggrep/?corpus=xplat&filename=.json&case=false&view=default&extre=&s=%22react-devtools&engine=apr_strmatch&context=false&filter[uninteresting]=false&filter[intern]=false&filter[test]=false&grep_regex=) to the `react-devtools-core` package and updated all v4 usage to to point to the new 4.6.0 release:

1: Manually update "react-devtools-core" versions:
```
js/package.json
js/react-native-github/package.json
nuclide/package.json
sonar/desktop/app/package.json
sonar/desktop/plugins/reactdevtools/package.json
vscode/modules/vscode-webview/package.json
```
2: Setup Yarn proxy:
```
yarn config set proxy http://fwdproxy:8080/
yarn config set https-proxy http://fwdproxy:8080
```
3: Run "yarn" in each of the above directories.
4: Run the lockfile shell script:
```
~/xplat/js/scripts/update-oss-yarn-lockfile.sh
```
5: Update the generated `MOBILE_JS_NODE_MODULE_DEPS.bzl` by running
```
js1 build buckfiles
```

## Changelog:

[General] [Changed] - Upgrade embedded React DevTools backend from v4.0.6 to v4.6.0.

Reviewed By: cpojer, gaearon

Differential Revision: D20676091

fbshipit-source-id: 99865bdba9bce45e2a7d582d5fb550cfdbeeca3a
2020-03-26 16:45:29 -07:00
Timur Valiev
64bfc91ea6 websockets import fix
Summary: somehow normal require brings us non-expected version, so let's import from node_modules

Reviewed By: jknoxville

Differential Revision: D20625706

fbshipit-source-id: 4748bcbaa15d1e6d400fc6d2153bb541a3dd129e
2020-03-26 04:08:29 -07:00
Anton Nikolaev
9299198906 Fix adbkit-logcat resolution
Summary:
There is error written to console just after launch. It is related to wrong resolution of adbkit-logcat version. This diff forces resolution to the single version everywhere.

{F232416275}

Reviewed By: mweststrate

Differential Revision: D20632452

fbshipit-source-id: bf45bbd6d245dbb1093b093c20e808840689971b
2020-03-25 03:27:51 -07:00
Michael Bolin
37f0260116 Back out "Upgrade Prettier from 1.17 to 2.0.2."
Differential Revision: D20639755

fbshipit-source-id: 5028563f9cf0527a30b4259daac50cdc03934bfd
2020-03-24 21:48:09 -07:00
Michael Bolin
8658fca4dd Upgrade Prettier from 1.17 to 2.0.2.
Summary:
This gets us on the latest Prettier 2.x:
https://prettier.io/blog/2020/03/21/2.0.0.html

Notably, this adds support for TypeScript 3.8,
which introduces new syntax, such as `import type`.

Reviewed By: zertosh

Differential Revision: D20636268

fbshipit-source-id: fca5833d003804333a05ba16325bbbe0e06d6c8a
2020-03-24 20:24:52 -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
Michel Weststrate
0a8d8f44ff Make sure notication computation can't crash the dispatch
Summary:
Collecting notifications is done in the store.subscribe. If this throws however, the entire original dispatch throws (really Redux?!). So added a try catch around collecting notifications. This stops plugins from crashing while processing the queue (in fact this could happen during any Redux dispatch).

Will look into a more robust mechanism in the future

I suspect this also fixes the hanging graphQL issue

Reviewed By: jknoxville

Differential Revision: D20619226

fbshipit-source-id: 2f6b8e13a5c884dd63b6963d317474a2abf0725c
2020-03-24 06:45:46 -07:00
Timur Valiev
1bfb750467 dive into link
Summary:
Breaking down 'big' links and diving deeper into stack trace
each link is built from multiple events with same function on top of call stack
Now we can break that group and/or navigate one level  deeper in that stack

coloring links: according to the latest event timestamp: blue -> orange gradient

{F232164201}

Reviewed By: SimoneCasagranda

Differential Revision: D20596812

fbshipit-source-id: 9debbc55a716166e20c94f51989742bf40b95878
2020-03-23 10:32:31 -07:00
John Knox
043fcc354f Fix context menu caching bug
Summary:
The memoized callback didn't have any dependencies, so whenever a context menu was computed for a component, it was never changed again.

This broke the network plugin as the context menu should change depending on what element is selected.

Reviewed By: cekkaewnumchai

Differential Revision: D20596750

fbshipit-source-id: 275453d972079954e310fd3e97f2dd9f437bf748
2020-03-23 08:55:18 -07:00
Michel Weststrate
d01da8ef9a Stabilize Android connection handling
Summary:
A lack of correct chaining of promises, error handling and not explicitly dealing with the ADB state 'still connecting' causes errors to be shown in Flipper on the main thread, the browser console and in the debug error bar.

This diff fixes several of those issue, which gives a stabler much stabler experience when disconnecting and connecting emulators and physical devices a lot (it is a bit hard to capture in a movie, but more noticeable when doing it IRL)

Reviewed By: jknoxville

Differential Revision: D20559197

fbshipit-source-id: 643172d322aefe1be209741a48fa0e96358881eb
2020-03-23 06:45:59 -07:00
Michel Weststrate
f2da075acc Fixed circular dependencies
Summary: Fixed circular dependency warnings and removed some dead code while at it.

Reviewed By: jknoxville

Differential Revision: D20557313

fbshipit-source-id: 856c42113a9abe36d3e14f9d538eb40705ceb87f
2020-03-23 06:45:59 -07:00
Michel Weststrate
aa2879d6e8 Remove double async wrapping
Summary:
Our usage of requestIdleCallback (probably) causes more trouble than it solves:

1. It makes sure everything is processed asynchronously. But since everything is arriving over a network stack, that is already the case without wrapping it again to run on a separate event loop tick
2. The timeout we set before `500` forces the app to give _more_ priority to message processing instead of less
3. In a next diff (D20151700) in this stack we will make sure that messages are not processed immediately, but simple stored, which should not be significantly more expensive (probably even cheaper) than scheduling another tick on the event loop

Reviewed By: jknoxville

Differential Revision: D20557104

fbshipit-source-id: 6cc10ba537e3cb5f31e6c32e1fdeb57c20f06f17
2020-03-23 06:45:59 -07:00
Michel Weststrate
d103692883 Remove event_queue GK
Summary: Did run for 2 months stable now, time to remove some dead code.

Reviewed By: passy

Differential Revision: D20556785

fbshipit-source-id: 514673995212d62d21744f304286caa6e91007fb
2020-03-23 06:45:58 -07:00
Chaiwat Ekkaewnumchai
69fc5e8834 Set Line Height for ToggleSwitch (ToggleButton)
Summary:
Set line height to make space between lines look better in cramper space (See Test Plan).

This has direct side effect on:
- https://fburl.com/diffusion/0dtt1cgl
- ToggledSection component

In addition, this diff adds an offline cache.

Reviewed By: mweststrate

Differential Revision: D20574486

fbshipit-source-id: 8689bc95e2f18409e82c923fea361e033e77bc00
2020-03-23 04:42:57 -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