Commit Graph

2746 Commits

Author SHA1 Message Date
Michel Weststrate
0fa0899299 Create React Native example project
Summary:
This diff creates a sample React Native project (based on the 0.62-rc.0 template).

This example is created like:
(Documenting this here as in the future this might be easier than upgrading the project itself)

1. Run `npx react-native init ReactNativeFlipperExample --version 0.62.0-rc.0`
2. Follow the installation steps to enable Flipper, that is, call `initializeFlipper(this, getReactNativeHost().getReactInstanceManager());` at the end of the `onCreate` method in `MainApplication.java`
3. Put `FlipperTicTacToe` in the root of the project, and call it from `App.js` as a component
4. install `react-native-flipper` as dependency
5. install `relative-deps` as dev dependency, and set it up as shown in `package.json`. This tool make sure that we build and test this project against the version of react-native-flipper in this repository, rather than against the one on NPM.
6. removed some stuff, like tests and linting, which is just in the way in this repo

This PR does not support iOS, as Flipper + RN iOS is still broken in 0.62.0-rc.0, and the current version of react-native-flipper doesn't support iOS yet either.

Documentation on how to set up Flipper in general is not part of this Diff

_N.B. since this is a **public** project, to be visible and runnable by our OSS community, the build setup is kept plain, vanilla, react-native, and **not** wired up to our normal / internal build processes. This is also the reason that lint suggestions beyond the license headers have been ignored. If any others should be applied, it is probably the official react native template that requires updating_

Reviewed By: passy

Differential Revision: D19449295

fbshipit-source-id: 2aeb6044f8dd01f09a95350c84fff2419d685a65
2020-01-23 04:47:52 -08:00
Michel Weststrate
a9f2b67874 Fix background plugin stats
Summary: Discovered that all gathered plugin stats where empty due to mis-using Object.entries. Fixed that. Also added a accumulated cpuTime metric, which should be great for a uniform trend line.

Reviewed By: jknoxville

Differential Revision: D19517279

fbshipit-source-id: a6df83eea000a5d59fe692a3795fd58ae6457821
2020-01-23 02:04:06 -08:00
Pritesh Nandgaonkar
d31ea742f5 Fix broken URL export
Summary:
Fixes broken export through URL.
Also fixes an issue where we suppress an exception

Reviewed By: mweststrate

Differential Revision: D19517066

fbshipit-source-id: c68b6a1bcbc8b0588e0db9032268033a42b43c61
2020-01-22 10:07:59 -08:00
John Knox
5a19004732 Only show outdated SDK warning for android devices
Summary: This exists to warn people about an incompatibility with old android sdk's, there's no need for the warning on other OS's even if the sdk is old.

Reviewed By: mweststrate

Differential Revision: D19499587

fbshipit-source-id: 5468fffcc0265bb122cf149f49b9af86ddd3c84e
2020-01-22 07:49:48 -08:00
John Knox
e47f6a4ebe Remove duplicated "total" time logging
Summary: This is useless as it's logged as key: total anyway.

Reviewed By: mweststrate

Differential Revision: D19501099

fbshipit-source-id: 08dcf76fbab8065356b34c6ed1524ef83703c46c
2020-01-22 07:46:58 -08:00
John Knox
06218b13f8 Remove NEW_CLIENT_SANITY_CHECK
Summary: This isn't needed anymore as it's taken care of by the Client class when it fails to find it's own matching device.

Reviewed By: mweststrate

Differential Revision: D19499929

fbshipit-source-id: e54dea6e680a9fa3cd3572cdd65434922d51c4ea
2020-01-22 07:46:58 -08:00
Michel Weststrate
a3a3db5363 Improve stats collection for plugins in the background
Summary:
This diff improves two things:
1. Stats are now gathered on every `trackUsage` tick, rather than only when there is a selection
2. The stats now include a delta to compare it with the previous tick

Reviewed By: passy

Differential Revision: D19514231

fbshipit-source-id: 1854c1dc03c63a03db8c7040c185d2629e1b9ea2
2020-01-22 07:10:52 -08:00
Chun-Ho Ng
c8b9dd949b Fix Opening FB4A Database Plugin
Summary:
The FB4A SQLite database plugin has to be opened 4-5 times before it shows a list of databases. This is because some databases are encrypted and can't be opened. In this case the code throws and exception and we do not catch that, causing the whole load process to crash.

Now catching the exception and returning an empty list.

Reviewed By: jknoxville

Differential Revision: D19463876

fbshipit-source-id: af8c9a70dc2761e62088d90ce89f8d16057e8745
2020-01-21 15:58:29 -08:00
Anton Nikolaev
7c03366136 Setitngs: button to reset Android SDK path to default
Summary: Added button to reset Android SDK path to default + fixed default SDK path on Windows which I introduced in a previous diff and which before might be wrongly resolved to roaming data instead of local data folder

Reviewed By: jknoxville

Differential Revision: D19498899

fbshipit-source-id: e10865b528f55ea6b56873bdf9369c4b60dca89f
2020-01-21 10:28:38 -08:00
Timur Valiev
4f63d6435f JS app launcher ui bugfix
Summary: JS App launcher wasn't appearing when no android emulators are installed

Reviewed By: nikoant

Differential Revision: D19499107

fbshipit-source-id: d062d4781747b77b708306b592ea66a1a67b93e4
2020-01-21 09:03:35 -08:00
Mateo Silguero
b0caaa7254 persist favorites queries at localStorage. show parsed values from databases. (#738)
Summary:
on databases section, queries marked as "favorite", are not persisted. With this changes,  they will be saved at localStorage and persist from refresh.

Improves on parse json values from databases.

## Changelog
Pull Request resolved: https://github.com/facebook/flipper/pull/738

Reviewed By: mweststrate

Differential Revision: D19330218

Pulled By: passy

fbshipit-source-id: 673b2d0bbee9b3ef4544defaca0e3c5547a992a2
2020-01-21 08:37:53 -08:00
Hugo Cuvillier
7047354f94 Removal of unused protocol CKRenderWithChildrenComponentProtocol
Summary: Ditto

Reviewed By: kfirapps

Differential Revision: D19496643

fbshipit-source-id: ab6777acb68122f2395919a5afbb30a1ccfafe06
2020-01-21 08:26:19 -08:00
Anton Nikolaev
e178221f44 Default path to Android SDK is wrong on Windows
Summary:
Default path for Android SDK was set to "/opt/android_sdk" disregard the current OS.
On Windows it should be set to "%localappdata%\android\sdk" instead.

Reviewed By: passy

Differential Revision: D19496646

fbshipit-source-id: 86ce7df74b98eef5b7b0a556a5359bec8cb0dbc4
2020-01-21 08:04:50 -08:00
Anton Nikolaev
35d62e70cb Analytics: log both shown and suppressed warnings
Summary: A small enhancement for the Doctor usage report

Reviewed By: passy

Differential Revision: D19496887

fbshipit-source-id: 1f0efb0eb29e2efce60ba4fca3bd6fdc062406ea
2020-01-21 06:41:47 -08:00
Michel Weststrate
94e2230583 Animated chevrons in sidebar
Summary: Sidebar collapsing finally feels right! Also made the sidebar a little bit less cramped by widening it.

Reviewed By: passy

Differential Revision: D19496743

fbshipit-source-id: 8dd93afc8ef542781b1c1598623d1c9cef9b6b66
2020-01-21 06:29:41 -08:00
Michel Weststrate
02e02338e8 Fix Mac plugins not showing up
Summary:
Fixed a bunch of issue in the new sidebar navigation
1) Stop filtering out the host device (collapse it by default instead)
2) Show offline status in title for more clarity
3) Stop sorting devices by name, so that they are sorted in connection order, which feels more consistent
4) Group uninitialised clients together, rather than showing them under every device
5) Rename "device" section to "device plugins", and hide it if there are none
6) some minor margin fixes

Reviewed By: jknoxville

Differential Revision: D19495950

fbshipit-source-id: 513d0a1171016bd3077641f614a6554a132f8180
2020-01-21 04:54:25 -08:00
Anton Nikolaev
0f5556dcf0 Flipper Bump: v0.30.3-SNAPSHOT
Reviewed By: jknoxville

Differential Revision: D19494144

fbshipit-source-id: f4cc98afb0ce10fc65f508dd8a11cf408f01e027
2020-01-21 04:30:33 -08:00
Anton Nikolaev
4d91f6eb60 Flipper Release: v0.30.2
Reviewed By: passy

Differential Revision: D19494145

fbshipit-source-id: d5d0bdf6a033c3de286029adec3e0f6245864a62
2020-01-21 03:56:46 -08:00
Timur Valiev
ff26deedd7 Add default search term in Searchable
Summary: Add a way to provide default search term; similar to default filters

Reviewed By: mweststrate

Differential Revision: D19449561

fbshipit-source-id: 6845ae5d2e058fe68974ac7aa8fd7b45814c2002
2020-01-20 10:19:38 -08:00
Anton Nikolaev
f94446310d ~10% of healthcheck runs failed with error "Cannot fine property length of undefned"
Summary: According to dashboard, ~10% of healthcheck runs failed with error "Cannot find property length of undefned". So here I'm fixing the only place where length property is used by doctor.

Reviewed By: passy

Differential Revision: D19470886

fbshipit-source-id: 3ad88370e5cb652c6f20034ebf5f38fadc46bf53
2020-01-20 09:54:24 -08:00
greenkeeper[bot]
fd83a751c7 Update jsdom in group plugins to the latest version � (#753)
Summary:
## The devDependency [jsdom](https://github.com/jsdom/jsdom) was updated from `15.2.1` to `16.0.1`.
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:** [domenic](https://www.npmjs.com/~domenic)
**License:** MIT

<details>
<summary>Release Notes for Version 16.0.1</summary>

<ul>
<li>Fixed Node v10 and v11 support when <code>runScripts</code> was set.</li>
<li>Fixed the behavior when changing an <code>&lt;input&gt;</code>'s <code>type=""</code> attribute.</li>
<li>Fixed input validation behavior for <code>&lt;input type="range"&gt;</code> when <code>max=""</code> is less than <code>min=""</code>.</li>
</ul>
</details>

<details>
<summary>Commits</summary>
<p>The new version differs by 52 commits.</p>
<ul>
<li><a href="afc85c80df"><code>afc85c8</code></a> <code>Version 16.0.1</code></li>
<li><a href="6472db466a"><code>6472db4</code></a> <code>Fix Node v10 and Node v11 support</code></li>
<li><a href="16c9856649"><code>16c9856</code></a> <code>Improved "expected fail" messages for web platform tests</code></li>
<li><a href="e2dbad8183"><code>e2dbad8</code></a> <code>Add support for  reverse range validation</code></li>
<li><a href="94b40d3ebf"><code>94b40d3</code></a> <code>Implement  type state switch logic</code></li>
<li><a href="c292572cd7"><code>c292572</code></a> <code>Add comment about radio button activation muddiness</code></li>
<li><a href="52109d5b23"><code>52109d5</code></a> <code>Clean up  typeMismatch constraint validation</code></li>
<li><a href="4a374e5b99"><code>4a374e5</code></a> <code>Clean up _defaultStepBase in </code></li>
<li><a href="92e9adbf41"><code>92e9adb</code></a> <code>Consistently use ._value for constraint validation</code></li>
<li><a href="11664cabd4"><code>11664ca</code></a> <code>More consistent applicability checking for  attributes</code></li>
<li><a href="b097c0a000"><code>b097c0a</code></a> <code>Roll Web Platform Tests</code></li>
<li><a href="d240291edb"><code>d240291</code></a> <code>Remove unnecessary dependencies</code></li>
<li><a href="902b69e15a"><code>902b69e</code></a> <code>Version 16.0.0</code></li>
<li><a href="020539ed3f"><code>020539e</code></a> <code>Remove document.origin and add window.origin</code></li>
<li><a href="678141f58e"><code>678141f</code></a> <code>Use mutability as a measure for valueMissing constraint</code></li>
</ul>
<p>There are 52 commits in total.</p>
<p>See the <a href="c3f0f2756b...afc85c80df">full diff</a></p>
</details>

 ---

<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/753

Reviewed By: nikoant

Differential Revision: D19469099

Pulled By: passy

fbshipit-source-id: 78de63ebb15843b27818dcbcbbe78ce5d5964ae9
2020-01-20 07:55:37 -08:00
greenkeeper[bot]
161ba23bae Update metro in group website to the latest version � (#752)
Summary:
## The dependency [metro](https://github.com/facebook/metro) was updated from `0.57.0` to `0.58.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:** [metro-bot](https://www.npmjs.com/~metro-bot)
**License:** MIT

[Find out more about this release](https://github.com/facebook/metro).

 ---

<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/752

Reviewed By: nikoant

Differential Revision: D19469348

Pulled By: passy

fbshipit-source-id: 89c805bef852ca8ee7d181ae8cc1c8f6e0ff351b
2020-01-20 07:53:17 -08:00
Pascal Hartig
83c15219da Add gradle validation (#748)
Summary:
Copied from here: https://github.com/facebook/fresco/pull/2457

Our version is too old to have checksums available, so we first need to merge
https://github.com/facebook/flipper/pull/749.
Pull Request resolved: https://github.com/facebook/flipper/pull/748

Test Plan: GitHub

Reviewed By: mweststrate

Differential Revision: D19447711

Pulled By: passy

fbshipit-source-id: acd1752fa84c14804f0e1012e56763635127d926
2020-01-20 06:04:25 -08:00
Alexander Oprisnik
ad720b1f63 Fix CloseableReference leaks in Flipper plugin
Summary:
When debugging closeable reference leaks, I found that the Flipper plugin doesn't properly close one:

```
2020-01-17 10:45:29.346 27038-27053/com.facebook.wakizashi D/YOLO: LEAK!!:
    java.lang.Throwable
        at com.facebook.common.references.CloseableReference.<init>(CloseableReference.java:158)
        at com.facebook.common.references.DefaultCloseableReference.<init>(DefaultCloseableReference.java:29)
        at com.facebook.common.references.CloseableReference.of(CloseableReference.java:237)
        at com.facebook.common.references.CloseableReference.of(CloseableReference.java:203)
        at com.facebook.common.references.CloseableReference.of(CloseableReference.java:176)
        at com.facebook.imagepipeline.cache.CountingMemoryCache.newClientReference(CountingMemoryCache.java:221)
        at com.facebook.imagepipeline.cache.CountingMemoryCache.get(CountingMemoryCache.java:209)
        at com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin$4.onReceive(FrescoFlipperPlugin.java:204)
        at com.facebook.flipper.android.EventBase.loopForever(Native Method)
        at com.facebook.flipper.android.FlipperThread.run(FlipperThread.java:31)
```

Second leak:
```
2020-01-17 11:04:16.503 28855-28869/com.facebook.wakizashi D/YOLO: LEAK!!:
    java.lang.Throwable
        at com.facebook.common.references.CloseableReference.<init>(CloseableReference.java:147)
        at com.facebook.common.references.DefaultCloseableReference.<init>(DefaultCloseableReference.java:21)
        at com.facebook.common.references.DefaultCloseableReference.clone(DefaultCloseableReference.java:35)
        at com.facebook.common.references.CloseableReference.cloneOrNull(CloseableReference.java:258)
        at com.facebook.common.references.CloseableReference.cloneOrNull(CloseableReference.java:326)
        at com.facebook.imagepipeline.cache.CountingMemoryCacheInspector$DumpInfoEntry.<init>(CountingMemoryCacheInspector.java:32)
        at com.facebook.imagepipeline.cache.CountingMemoryCacheInspector.dumpCacheContent(CountingMemoryCacheInspector.java:101)
        at com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin$3.onReceive(FrescoFlipperPlugin.java:171)
        at com.facebook.flipper.android.EventBase.loopForever(Native Method)
        at com.facebook.flipper.android.FlipperThread.run(FlipperThread.java:31)
```

Reviewed By: passy

Differential Revision: D19445902

fbshipit-source-id: 12a513d9e34fcac0d546a4eac55932956e4e4d5b
2020-01-17 12:32:01 -08:00
Michel Weststrate
1b7a30ae6c Publish react-native-flipper as NPM package
Summary:
This Diff makes the react-native-flipper package available on NPM.

For simplicity and traceability purposes, this package is released every time Flipper is released, under the same version number. Even though there will be often no changes.

Reviewed By: passy

Differential Revision: D19446815

fbshipit-source-id: 485930e57beac42a2f36dc34a8ac82eed2abe785
2020-01-17 08:21:05 -08:00
Rick Hanlon
3b24e41258 Fix hermes chrome debugger for Flipper
Summary: When Flipper upgraded Electron it broke the iframe sandboxing for devtools, the fix is to use a webview (which requires some CSS fixes to render full screen).

Reviewed By: ArchDev

Differential Revision: D19446243

fbshipit-source-id: 7fd0b0fc922aa6c05c24efc20adce1cb61f24c99
2020-01-17 06:33:02 -08:00
Michel Weststrate
c8ebb7caaf Fix layout of clear icon
Summary:
Flipper clear icon was hidden, this fixes it

Also fixed a null pointer exception that would occur when clearing search with the keyboard, and no filters were active

Reviewed By: passy

Differential Revision: D19445833

fbshipit-source-id: 213c28dc8c1e295018e6318f86604d96d2a9b75c
2020-01-17 06:30:10 -08:00
Pascal Hartig
ef0cf87448 Remove custom react-virtualized type overlay
Summary:
This takes presendence over the official types and
masked a bunch of errors we had in the codebase.

Reviewed By: mweststrate

Differential Revision: D19374741

fbshipit-source-id: 2fd5074f42381dd552b9cc2d460769766ab67b85
2020-01-17 03:58:33 -08:00
Eric O'Connell
b24c2e0b52 Limit request/response body to 100kb to address #457 (#617)
Summary:
As previously reported in https://github.com/facebook/flipper/issues/457, I immediately started to see crashes with Flipper integrated due to large responses (e.g., >= 100MB). This will only write the first 100KB of the response or request body into `RequestInfo` objects.

## Changelog

- Limits request/response body in network request info to 100KB max.
Pull Request resolved: https://github.com/facebook/flipper/pull/617

Test Plan:
- Make a network request which has a response size of < 100kb, verify that it is visible in its entirety
- Make a network request w/ response size > 100kb, verify that it is truncated
- Ideally, use your application with the Network plugin running, and do not see OOMs

Reviewed By: mweststrate

Differential Revision: D19412075

Pulled By: passy

fbshipit-source-id: c93662dba7a5f24820287e56e889576b5bcb5a72
2020-01-17 03:55:51 -08:00
Anton Nikolaev
73e0f9035a Pass plugins via ipc instead of env to fix loading of plugins on Windows
Summary: Fixed the issue with empty plugin list on Windows because of env var length limit

Reviewed By: passy

Differential Revision: D19411466

fbshipit-source-id: 7fa390f7dd342e23e965b2135fbeb8e88e5857ef
2020-01-17 03:50:13 -08:00
John Knox
2f3b9e1be9 Increase line height of markdown text
Summary: Lines were a bit squashed together. Taken the value from workplace, as that's the style we've been copying so far.

Reviewed By: priteshrnandgaonkar

Differential Revision: D19430279

fbshipit-source-id: 52cc8167d6acaa6af42caaa67a693b5fda492701
2020-01-16 09:39:52 -08:00
John Knox
ce96e5efc2 Use chevron-right for collapsed state
Summary: I find this much more intuitive that it's unexpanded, than a down arrow.

Reviewed By: mweststrate

Differential Revision: D19429007

fbshipit-source-id: 7b414aeee846a864641941b6837770252cb298de
2020-01-16 08:15:55 -08:00
John Knox
c17cd0f11e Add isForeground to ping events
Summary:
I want to make ping events fire when in background or foreground.
But doing that now could mess with some stats.
Setting this up so we have the data. If it comes to it, after this has been going a while,
we can add a filter to the existing queries for "isForeground=true" to preserve their behaviour.

Reviewed By: mweststrate

Differential Revision: D19428926

fbshipit-source-id: 7c175e9936dce52a59d17995dae61a82d23687f8
2020-01-16 08:15:54 -08:00
Michel Weststrate
e7780530df Fixed #647, urls are not editable in shared preferences
Summary:
As reported in https://github.com/facebook/flipper/issues/647 urls are not editable in our generic data inspector, as clicking an url will immediately open it, rather than going to edit mode.

This diff fixes that by appending an edit icon to URL previews.

Reviewed By: jknoxville

Differential Revision: D19428925

fbshipit-source-id: 428e8e4c10fb472792b61986d915658f7581c38d
2020-01-16 06:53:15 -08:00
Michel Weststrate
df753ffa06 Fixed error in RN iOS setup guide. Should fix #723
Summary: Small fix in docs to address https://github.com/facebook/flipper/issues/723

Reviewed By: jknoxville

Differential Revision: D19428560

fbshipit-source-id: 38c189fbca015196c0dd74a243b4f3ee281f0452
2020-01-16 06:32:09 -08:00
Pascal Hartig
e84f62d5d5 Upgrade Gradle wrapper (#749)
Summary:
Ran this:
```
./gradlew wrapper --gradle-version=5.6.4 --distribution-type=bin
```

I tried to get us to 6.1, but that causes some type errors within
the Android plugin. I hope it's actually there stuff and not ours
so we can upgrade once they've sorted their stuff.
Pull Request resolved: https://github.com/facebook/flipper/pull/749

Test Plan:
./gradlew tasks
./gradlew :sample:installDebug

Reviewed By: jknoxville

Differential Revision: D19428496

Pulled By: passy

fbshipit-source-id: a910f5a269688f7ec5fc020fe1af99a75fc7b574
2020-01-16 06:18:37 -08:00
Michel Weststrate
28fd95589f Made flipper plugins a little more robust
Summary: Added some assertions and string casts to make plugins a bit more robust

Reviewed By: passy

Differential Revision: D19427909

fbshipit-source-id: 46a3138805db865b538f745fae25ce1897e35736
2020-01-16 05:06:22 -08:00
Michel Weststrate
db9c41303d Introduce Flipper Tic Tac Toe example
Summary:
This Diff introduces an example for how to develop a React Native pure JS plugin and will be used in the docs. See the attached project as demo. The RN sources for the plugin component are:

```
import React, {useState, useEffect} from "react";
import {
  StyleSheet,
  View,
  Text,
  Button,
} from 'react-native';

import {addPlugin} from "react-native-flipper";

const initialState = {
  cells: [" ", " ", " "," ", " ", " "," ", " ", " ",],
  turn: ' ',
  winner: ' ',
}

export default function FlipperTicTacToe() {
  const [status, setStatus] = useState("Waiting for Flipper Desktop Player...")
  const [gameState, setGameState] = useState(initialState);
  const [connection, setConnection] = useState(null);

  useEffect(() => {
    addPlugin({
      getId() {
        return 'ReactNativeTicTacToe';
      },
      onConnect(connection) {
        setStatus("Desktop player present");
        setConnection(connection);

        // listen to updates
        connection.receive('SetState', (gameState, responder) => {
          if (gameState.winner !== " ") {
            setStatus(`Winner is ${gameState.winner}! Waiting for a new game...`);
          } else {
            setStatus(gameState.turn === "X" ? "Your turn...": "Awaiting desktop players turn...");
          }
          setGameState(gameState);
          responder.success();
        })

        // request initial state
        connection.send('GetState');
      },
      onDisconnect() {
        setConnection(null);
        setStatus("Desktop player gone...");
      }
    })
  }, []);

  return (
    <View style={styles.container}>
      <Text style={styles.title}>Flipper Tic-Tac-Toe</Text>
      <Text>{status}</Text>
      <View style={styles.board}>
        {gameState.cells.map((state, idx) =>
          <View
            key={idx}
            style={styles.cell}>
            <Button
              title={state}
              disabled={gameState.turn !== 'X' || state !== ' '}
              onPress={() => {
                connection.send('XMove', { move: idx });
              }}
            />
          </View>
        )}
      </View>
    </View>
  )
}

// Omitted styling

```

Reviewed By: passy

Differential Revision: D19410138

fbshipit-source-id: 93266a1ef7b86dcf043a744c3563dab0c585c8fd
2020-01-16 05:06:22 -08:00
Michel Weststrate
08e2d54f62 Make sure callbacks are not reused and reloading works
Summary:
This diff is part of the bigger task T60496135

This diff changes the RN support from crude to decent citizen, making sure we don't recycle callbacks over the bridge, use subscriptions were possible, and making sure connecting, disconnecting, etc works correctly

For example, connect and disconnect hooks should work.

Finally, throw in hot reloading into the mix, which causes the registerPlugin to be triggered another time, without the old one every been unloaded.
This should trigger a new 'onConnect' on the client, to make sure it can restore any state / subscriptions necessary, even though the never disappeared in the Java world.

These cases should all be handled well.

Reviewed By: jknoxville

Differential Revision: D19347330

fbshipit-source-id: de64a08f4043f01528c794430ccc3c717abf0180
2020-01-16 05:06:22 -08:00
Michel Weststrate
c7158f4517 Make it possible to write JS only plugins
Summary:
This diff is part of the bigger task T60496135

This diff is based on D18706643, extracting only the react native module parts

It implements the entire Android client api for JavaScript, so that there is feature parity. However this implementation is happy path only, and edge cases will be handled in separate diffs

Reviewed By: jknoxville

Differential Revision: D19310265

fbshipit-source-id: 589716fe059952bdde98df84ed250c5c6feaa118
2020-01-16 05:06:22 -08:00
Chaiwat Ekkaewnumchai
3fab1f8fd6 Upgrade Babel
Summary: Update babel related dependency to 7.8.3

Reviewed By: passy

Differential Revision: D19408069

fbshipit-source-id: cc9beca6bb9c8d2102332dac3812f52ca7275ec0
2020-01-16 03:58:32 -08:00
John Knox
ce0d038420 Regularly report currently starred plugins
Summary: Gives us visibility on how many / which plugins, people are starring.

Reviewed By: mweststrate

Differential Revision: D19408420

fbshipit-source-id: cb08e2a5f9d1b31ea03e6f7df8fa61db26611e91
2020-01-15 08:07:30 -08:00
dependabot[bot]
1a1c5ca988 Bump handlebars from 4.1.2 to 4.5.3 in /headless-tests (#726)
Summary:
Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.1.2 to 4.5.3.
<details>
<summary>Changelog</summary>

*Sourced from [handlebars's changelog](https://github.com/wycats/handlebars.js/blob/master/release-notes.md).*

> ## v4.5.3 - November 18th, 2019
> Bugfixes:
>
> - fix: add "no-prototype-builtins" eslint-rule and fix all occurences - f7f05d7
> - fix: add more properties required to be enumerable - 1988878
>
> Chores / Build:
> - fix: use !== 0 instead of != 0 - c02b05f
> - add chai and dirty-chai and sinon, for cleaner test-assertions and spies,
>   deprecate old assertion-methods  - 93e284e, 886ba86, 0817dad, 93516a0
>
> Security:
>
> - The properties `__proto__`, `__defineGetter__`, `__defineSetter__` and `__lookupGetter__`
>   have been added to the list of "properties that must be enumerable".
>   If a property by that name is found and not enumerable on its parent,
>   it will silently evaluate to `undefined`. This is done in both the compiled template and the "lookup"-helper.
>   This will prevent new Remote-Code-Execution exploits that have been
>   published recently.
>
> Compatibility notes:
>
> - Due to the security-fixes. The semantics of the templates using
>   `__proto__`, `__defineGetter__`, `__defineSetter__` and `__lookupGetter__` in the respect that those expression now return
>   `undefined` rather than their actual value from the proto.
> - The semantics have not changed in cases where the properties are  enumerable, as in:
>
> ```js
> {
>   __proto__: 'some string'
> }
> ```
>
> - The change may be breaking in that respect, but we still only
>   increase the patch-version, because the incompatible use-cases
>   are not intended, undocumented and far less important than fixing
>   Remote-Code-Execution exploits on existing systems.
>
>
>
> [Commits](https://github.com/wycats/handlebars.js/compare/v4.5.2...v4.5.3)
>
> ## v4.5.2 - November 13th, 2019
> # Bugfixes
>
> - fix: use String(field) in lookup when checking for "constructor" - d541378
> - test: add fluent API for testing Handlebars - c2ac79c
>
> Compatibility notes:
> - no incompatibility are to be expected
></tr></table> ... (truncated)
</details>
<details>
<summary>Commits</summary>

- [`c819c8b`](c819c8b533) v4.5.3
- [`827c9d0`](827c9d0747) Update release notes
- [`f7f05d7`](f7f05d7558) fix: add "no-prototype-builtins" eslint-rule and fix all occurences
- [`1988878`](1988878087) fix: add more properties required to be enumerable
- [`886ba86`](886ba86c2f) test/chore: add chai/expect and sinon to "runtime"-environment
- [`0817dad`](0817dad7e7) test: add sinon as global variable to eslint in the specs
- [`93516a0`](93516a0b07) test: add sinon.js for spies, deprecate current assertions
- [`93e284e`](93e284ed9b) chore: add chai and dirty-chai for better test assertions
- [`c02b05f`](c02b05fa81) fix: use !== 0 instead of != 0
- [`8de121d`](8de121d21c) v4.5.2
- Additional commits viewable in [compare view](https://github.com/wycats/handlebars.js/compare/v4.1.2...v4.5.3)
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=handlebars&package-manager=npm_and_yarn&previous-version=4.1.2&new-version=4.5.3)](https://help.github.com/articles/configuring-automated-security-fixes)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

 ---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `dependabot rebase` will rebase this PR
- `dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `dependabot merge` will merge this PR after your CI passes on it
- `dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `dependabot cancel merge` will cancel a previously requested merge and block automerging
- `dependabot reopen` will reopen this PR if it is closed
- `dependabot ignore this [patch|minor|major] version` will close this PR and stop Dependabot creating any more for this minor/major version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language

You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/facebook/flipper/network/alerts).

</details>
Pull Request resolved: https://github.com/facebook/flipper/pull/726

Reviewed By: mweststrate

Differential Revision: D19407963

Pulled By: passy

fbshipit-source-id: 215ca75306f0ff7c2f839627b39581fc432443b3
2020-01-15 06:00:53 -08:00
greenkeeper[bot]
d1ec9797bf Greenkeeper/@types/react 16.9.17 (#745)
Summary:
Close https://github.com/facebook/flipper/issues/669
Pull Request resolved: https://github.com/facebook/flipper/pull/745

Reviewed By: mweststrate

Differential Revision: D19408457

Pulled By: passy

fbshipit-source-id: 2cf380b48d80e719a36c6f9ea8c10410185eebb1
2020-01-15 05:05:28 -08:00
Michel Weststrate
03c1bcad11 Log users out if tokens have expired, force FB users to login on startup
Summary:
Currently there are several issues caused by internal users not being logged in. E.g. the rating button doesn't work, flipper traces can't be uploaded etc.

However, the fact that the user is not logged in, is not reflected in the UI if the user has an API key, which is outdated.

See also the scuba query in the linked tasks; this happens for quite some users.

This diff fixes two things:
1. If auth tokens are invalid, this is properly reflected in the UI
2. If at startup the profile can't be loaded, a popup will be shown to log in.

Differential Revision: D19392735

fbshipit-source-id: 2be7c577ead671df16c626c0636e89245cebab14
2020-01-15 04:34:35 -08:00
0xd-cc
f6831e837a iOS/Sample : UI need to be updated on Main Thread (#740)
Summary:
### iOSSample:
Fix iOS Sample App crash: UI need to be updated on Main Thread

### SampleSwift:
* Upgrade swift version
* Fix force unwrapping
* UI need to be updated on Main Thread

## Changelog
Pull Request resolved: https://github.com/facebook/flipper/pull/740

Differential Revision: D19397414

Pulled By: passy

fbshipit-source-id: 7af84c0fe43861aff6a18c36bf81a940baec5147
2020-01-15 03:57:53 -08:00
Pritesh Nandgaonkar
4530eb9235 Release glog and DoubleConversion with different names
Summary: This releases glog and DoubleConversion under "Flipper" preappended name as it solves the issues with Flipper integration with RN under use_frameworks!  keyword.

Reviewed By: passy

Differential Revision: D19392941

fbshipit-source-id: ebdcdc23fcce45cec9bfc6d4f18c14a734caf24f
2020-01-14 10:55:16 -08:00
John Knox
a96931c43f Enhance time-spent tracking
Summary:
Previously, at 1-minute intervals, if the flipper window was focused on, it would report the currently active plugin.
We'd sum all those "ping" events and that would approximate the number of full minutes spent in total across all users.
It's quite coarse grained, if you're focused on the window for 30 seconds, there's a 50% change your ping will get used.
While being reasonable across many users, it doesn't allow analysis like how many plugins do people typically use in a session, because we probably won't see all the plugins they use.

New approach, for every minute flipper is open, report the focused and unfocused time spent in each plugin, as well as the total across all plugins.
This should give us the previous data but with much more precision.

Should be especially helpful for plugins with low numbers of users, you typically interact with emulators while using a plugin, so it's not continually in focus, so you miss a lot of usage events.

enhance_bladerunner

Reviewed By: nikoant

Differential Revision: D19392796

fbshipit-source-id: af9244e993edff9b381144ca587c3a77fdf8c98a
2020-01-14 10:27:17 -08:00
Pascal Hartig
84302f109b Revert D19389776: fix(flipper-static): show default warning message on firing in unknown flags
Differential Revision:
D19389776

Original commit changeset: 2f844e38c8be

fbshipit-source-id: cbd3fa7032082fc7e445bd2dfdbdfcc4ed0d2562
2020-01-14 09:22:55 -08:00
Michel Weststrate
7513d36689 Make sure sidebar detects fresh plugins
Summary: New plugins are not detected because the available plugins are stored in the mutable Client class, so we have to subscribe to the event emitter

Reviewed By: passy

Differential Revision: D19347654

fbshipit-source-id: 68af63bf9bbe6319b2994dc8d07ca5eb27bb33b4
2020-01-14 09:17:24 -08:00