Commit Graph

3673 Commits

Author SHA1 Message Date
Michel Weststrate
83e6968fa1 cleaner test API
Summary: The test mock utilities now return a promise, rather than taking a callback, which makes tests slightly nicer to read (similar to react-testing-library). No semantic changes.

Reviewed By: jknoxville

Differential Revision: D22186278

fbshipit-source-id: ec5b9f4e6bfeee9160e331f8c20a1d4fdcbfeede
2020-07-01 09:12:35 -07:00
Michel Weststrate
12ac29685d make sure plugins can be loaded into Flipper
Summary: Make sure Sandy plugins are loaded properly from disk

Reviewed By: jknoxville

Differential Revision: D22186275

fbshipit-source-id: fd2f560a7bed959b18e05db2a087909ad876ab9d
2020-07-01 09:12:35 -07:00
Michel Weststrate
1029a6c97c Introduce types for Sandy plugins through code base
Summary:
So far there were 2 types of plugins: `FlipperPlugin` and `FlipperDevicePlugin`. This introduces a third kind: `SandyPluginDefinition`.

Unlike with the old plugins, the export of the module is not directly exposed as the plugin definition. Rather, we use class `SandyPluginDefinition` (instance) that holds a loaded definition and its meta data separately (`PluginDetails`). This means that we don't have to mix in and mutate loaded definitions, and that for unit tests we can avoid needing to provide a bunch of meta data. This also prevents a bunch of meta data existing on two places: on the loaded classes as static fields, and in the meta data field of the loaded class as well. Finally, we can now freely extends the `PluginDetails` interface in flipper, without needing to store it on the loaded classes and we are sure that no naming conflicts are caused by this in the future.

For compatibility with the existing code base, common fields are delegated from the `SandyPluginDefinition` class to the meta data.

Also cleaned up types around plugins a little bit and removed some unnecessary casts.

For all features that reason about plugins in general (such as exports), sandy plugins are ignored for now.

`SandyPluginInstance` is worked out in further diffs

The `instanceof` calls are replaced by a utility function in later diffs.

{F241363645}

Reviewed By: jknoxville

Differential Revision: D22091432

fbshipit-source-id: 3aa6b12fda5925268913779f3c3c9e84494438f8
2020-07-01 09:12:35 -07:00
Michel Weststrate
845c9b67f5 Read flipper-plugin from peer deps
Summary:
To know whether plugins should be mounted with the old setup or new setup (with a Provided / context based api), we need to be able to recognize whether a plugin is written with the old or new setup.

We do this by checking if the flipper-plugin dependency is declared as peer dependency. This we can to check for SDK compatibility as well.

Reviewed By: jknoxville

Differential Revision: D22043085

fbshipit-source-id: 21afabb6e58d86253a464470f4690c51cced87ab
2020-07-01 09:12:35 -07:00
Michel Weststrate
2383dc85f8 Initialized flipper-plugin library
Summary: Set up an initial library which can (should) be used by plugins in the future.

Reviewed By: jknoxville

Differential Revision: D22019554

fbshipit-source-id: 502b14b34b2c9c117cea377ab6ebbf150e6faee9
2020-07-01 09:12:35 -07:00
Adam Ernst
993dbef7b8 Remove expensive operator== from CKViewConfiguration & AccessibilityContext
Summary:
`CKComponentAccessibilityContext::operator==` can be extremely expensive; it may invoke the `accessibilityLazyTextBlock` for its `CKComponentAccessibilityTextAttribute` members, and that can do a lot of string construction.

I could refactor this to make it cheaper, e.g. by migrating to a function-pointer-and-context-object approach. But the easiest thing to do is to simply remove it; I don't think it's meaningfully used.

Reviewed By: kevin0571

Differential Revision: D22322108

fbshipit-source-id: 82a0548d6dd28ec4adf2f3ba85705eabf665d100
2020-07-01 08:26:04 -07:00
dependabot[bot]
7e7f431c66 Bump electron-devtools-installer from 3.0.0 to 3.1.0 in /desktop (#1317)
Summary:
Bumps [electron-devtools-installer](https://github.com/MarshallOfSound/electron-devtools-installer) from 3.0.0 to 3.1.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/MarshallOfSound/electron-devtools-installer/releases">electron-devtools-installer's releases</a>.</em></p>
<blockquote>
<h2>v3.1.0</h2>
<h1><a href="https://github.com/MarshallOfSound/electron-devtools-installer/compare/v3.0.0...v3.1.0">3.1.0</a> (2020-06-27)</h1>
<h3>Features</h3>
<ul>
<li>add electron 9 support (<a href="https://github-redirect.dependabot.com/MarshallOfSound/electron-devtools-installer/issues/131">https://github.com/facebook/flipper/issues/131</a>) (<a href="ab713a639c">ab713a6</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="f6932ad87d"><code>f6932ad</code></a> chore: fix tests</li>
<li><a href="ab713a639c"><code>ab713a6</code></a> feat: add electron 9 support (<a href="https://github-redirect.dependabot.com/MarshallOfSound/electron-devtools-installer/issues/131">https://github.com/facebook/flipper/issues/131</a>)</li>
<li>See full diff in <a href="https://github.com/MarshallOfSound/electron-devtools-installer/compare/v3.0.0...v3.1.0">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=electron-devtools-installer&package-manager=npm_and_yarn&previous-version=3.0.0&new-version=3.1.0)](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 close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor 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)

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

Reviewed By: mweststrate

Differential Revision: D22310350

Pulled By: passy

fbshipit-source-id: d043248ebd57976c5cfde267741977846c77c065
2020-07-01 06:11:35 -07:00
pyricau@users.noreply.github.com
cfd8662c12 Fix ApplicationWrapper activity weakRef leak (#1301)
Summary:
Fix for https://github.com/facebook/flipper/issues/1300

The weak refs were not being cleared in two cases:

- On config changes, isFinishing() would be false in onPause()
- When calling finish() from Activity.onCreate(), onPause() isn't guaranteed to be called.

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

Reviewed By: mweststrate

Differential Revision: D22286182

Pulled By: passy

fbshipit-source-id: 948d1d9b2145b6526c0030cf537330409ff7f8c4
2020-06-30 09:46:00 -07:00
Chaiwat Ekkaewnumchai
c8af6da236 Disable Web Security in Command Line
Summary:
We've disabled web security in `BrowserWindow` (https://fburl.com/diffusion/0l0q669m). However, there is a bug in Electron 9 that makes this doesn't work as expected (https://github.com/electron/electron/issues/23664). Earlier, we've resolved this problem by specifying `no-cors` mode in requests. This strikes again in other plugin.

This diff applies a workaround commented inside the issue to allow to make CORS requests.

Reviewed By: nikoant

Differential Revision: D22306977

fbshipit-source-id: ea0f5e3f1c4080037df258a6c5ce1fc89d433c3b
2020-06-30 06:52:07 -07:00
generatedunixname89002005306973
b943d215e0 Flipper Snapshot Bump: v0.49.1-SNAPSHOT
Summary: Releasing snapshot version 0.49.1-SNAPSHOT

Reviewed By: cekkaewnumchai

Differential Revision: D22307631

fbshipit-source-id: 9e3dab58e3f8117401f01eea2c05979f9efb82ad
2020-06-30 06:33:04 -07:00
generatedunixname89002005306973
8000090eac Flipper Release: v0.49.0
Summary: Releasing version 0.49.0

Reviewed By: cekkaewnumchai

Differential Revision: D22307632

fbshipit-source-id: 105fc71f07a4827a5d6e54cf3200b22f800a5f1e
2020-06-30 06:33:04 -07:00
Pascal Hartig
ba0a706bc8 Small fixes
Summary: Some small perf improvements, remove unnecessary cloning, etc.

Reviewed By: jknoxville

Differential Revision: D22307521

fbshipit-source-id: 91cfd16b0b05a24ec9639c2a2e26d504a6b01de4
2020-06-30 06:20:11 -07:00
Pascal Hartig
ceb9c942dc Back out "Bump sha2 from 0.8.1 to 0.9.1 in /packer"
Summary: Original commit changeset: 300f53aa1b69

Reviewed By: mweststrate

Differential Revision: D22288114

fbshipit-source-id: bc492dc633d66c993cddef49650818012cd0c9a1
2020-06-30 04:44:29 -07:00
Pascal Hartig
2f807880f4 Update dependabot.yml (#1299)
Summary:
Ewww, dependabot for GitHub is incompatible with the file format documented on dependabot.com.
So the current file is invalid:

![Screenshot 2020-06-26 15 04 59](https://user-images.githubusercontent.com/9906/85865837-6b4b7d00-b7be-11ea-9e5c-49007733a0e1.png)
Pull Request resolved: https://github.com/facebook/flipper/pull/1299

Test Plan: hopeitwork

Reviewed By: jknoxville, mweststrate

Differential Revision: D22286456

Pulled By: passy

fbshipit-source-id: bd783264b188fb5ce6e0e990bf269bca20d8d43b
2020-06-30 03:49:00 -07:00
Pascal Hartig
729549bc9f Set up GitHub test workflow for Packer (#1306)
Summary:
Per title.
Pull Request resolved: https://github.com/facebook/flipper/pull/1306

Test Plan: CI

Reviewed By: mweststrate

Differential Revision: D22285900

Pulled By: passy

fbshipit-source-id: 094cab21cc0f646495e9166435fb6563d50ee2a8
2020-06-29 10:10:39 -07:00
dependabot[bot]
39afce7ceb Bump sha2 from 0.8.1 to 0.9.1 in /packer (#1304)
Summary:
Bumps [sha2](https://github.com/RustCrypto/hashes) from 0.8.1 to 0.9.1.
<details>
<summary>Commits</summary>
<ul>
<li><a href="fb7186fb83"><code>fb7186f</code></a> Release sha-1 v0.9.1 and sha2 v0.9.1 (<a href="https://github-redirect.dependabot.com/RustCrypto/hashes/issues/177">https://github.com/facebook/flipper/issues/177</a>)</li>
<li><a href="f4f6ed5304"><code>f4f6ed5</code></a> Add build status links (<a href="https://github-redirect.dependabot.com/RustCrypto/hashes/issues/176">https://github.com/facebook/flipper/issues/176</a>)</li>
<li><a href="a380194a69"><code>a380194</code></a> Add x86 intrinsics support for sha1 and sha2 (<a href="https://github-redirect.dependabot.com/RustCrypto/hashes/issues/167">https://github.com/facebook/flipper/issues/167</a>)</li>
<li><a href="570a200160"><code>570a200</code></a> Fix build links (<a href="https://github-redirect.dependabot.com/RustCrypto/hashes/issues/174">https://github.com/facebook/flipper/issues/174</a>)</li>
<li><a href="feea49ec7e"><code>feea49e</code></a> update README examples (<a href="https://github-redirect.dependabot.com/RustCrypto/hashes/issues/173">https://github.com/facebook/flipper/issues/173</a>)</li>
<li><a href="fcb7516192"><code>fcb7516</code></a> Release <code>gost94</code> and <code>streebog</code> (<a href="https://github-redirect.dependabot.com/RustCrypto/hashes/issues/172">https://github.com/facebook/flipper/issues/172</a>)</li>
<li><a href="5fdcd03d5f"><code>5fdcd03</code></a> shabal v0.3.0 (<a href="https://github-redirect.dependabot.com/RustCrypto/hashes/issues/171">https://github.com/facebook/flipper/issues/171</a>)</li>
<li><a href="f427563094"><code>f427563</code></a> Release <code>groestl</code>, <code>md2</code>, <code>md4</code>, <code>ripemd320</code>, <code>whirlpool</code> v0.9.0 (<a href="https://github-redirect.dependabot.com/RustCrypto/hashes/issues/169">https://github.com/facebook/flipper/issues/169</a>)</li>
<li><a href="15c3060629"><code>15c3060</code></a> Bump opaque-debug to v0.3.0 (<a href="https://github-redirect.dependabot.com/RustCrypto/hashes/issues/168">https://github.com/facebook/flipper/issues/168</a>)</li>
<li><a href="d24f26b165"><code>d24f26b</code></a> Update block-buffer to v0.9 (<a href="https://github-redirect.dependabot.com/RustCrypto/hashes/issues/164">https://github.com/facebook/flipper/issues/164</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/RustCrypto/hashes/compare/sha2-v0.8.1...sha2-v0.9.1">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=sha2&package-manager=cargo&previous-version=0.8.1&new-version=0.9.1)](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 close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually

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

Reviewed By: jknoxville

Differential Revision: D22284220

Pulled By: passy

fbshipit-source-id: 300f53aa1b69e53d13e1095eb7755c2383a73e35
2020-06-29 07:35:52 -07:00
Pascal Hartig
8ff1411f91 Fix screen recording on Android 11
Summary:
Instead of relying on system blocks used, we use the file size reported by ls.
Android 11 seems to be more lazy when it comes to fsync'ing so there's a pretty
good chance that if we just check for with `du` or `ls -ls` we will see an "empty" file
because it hasn't been written to disk yet. By the normal `ls` output instead, we'll
just read the file and see how many bytes it's long, which should be more
accurate in all cases.

Changelog: Fix screen recording for Android 11 beta

Reviewed By: jknoxville

Differential Revision: D22283092

fbshipit-source-id: 6d33ca297f1c0734ab4ffc466d9e483aa1a1bdb5
2020-06-29 07:20:40 -07:00
Anton Nikolaev
dcd909779b Script to list all plugins included into Flipper desktop workspaces
Summary: Script to list all plugins included into Flipper desktop workspaces.

Reviewed By: passy

Differential Revision: D22256917

fbshipit-source-id: a3d8a0f9faea6e462a2f22be155d99eb22eb59d8
2020-06-26 09:07:12 -07:00
Pascal Hartig
5d033204e8 Update dmg-release.yml (#1296)
Summary:
The second publish job actually works, so let's remove the first one.
Pull Request resolved: https://github.com/facebook/flipper/pull/1296

Test Plan: https://github.com/facebook/flipper/runs/806859866?check_suite_focus=true

Reviewed By: jknoxville

Differential Revision: D22257369

Pulled By: passy

fbshipit-source-id: 72acc2e8ee10ad4514e315d57f4fa44656fce4e3
2020-06-26 07:52:25 -07:00
Pascal Hartig
b2e8070af2 Fix relative links
Summary: Translated all cases where we had a parent-relative link to use the base URL instead.

Reviewed By: jknoxville

Differential Revision: D22256229

fbshipit-source-id: 81ee6fecb77dbaa19d112cb319771c22ff66d02a
2020-06-26 05:13:48 -07:00
Anton Nikolaev
419691da97 Added command "flipper-pkg checksum"
Summary: Changelog: Added command `flipper-pkg checksum` for computing the total checksum of all the files included into plugin package.

Reviewed By: passy

Differential Revision: D22255125

fbshipit-source-id: a4f91370b4ab16ea4ce4a60e29f9d20fdd5f4331
2020-06-26 03:25:27 -07:00
Chaiwat Ekkaewnumchai
56c9435bd5 Fix Always Scrolling to Selected Element
Summary: `forwardedRef` was always triggered, so it forced the container to scroll to the selected element. This diff stores element id so that it scrolls only once.

Reviewed By: mweststrate

Differential Revision: D22235284

fbshipit-source-id: 0eb7aaf2b484d345865db4da66d0f555dc314710
2020-06-26 02:19:11 -07:00
GitHub
534a6186c1 Automated: Update Podfile.lock (#1295)
Summary:
This is an automated PR to update the Podfile.lock.
- Make sure that the Podfile.lock contains latest FlipperKit and Flipper pod versions.
- Also make sure that all the dependencies are updated to the latest one.
- This is auto-generated by [create-pull-request](https://github.com/peter-evans/create-pull-request)
Pull Request resolved: https://github.com/facebook/flipper/pull/1295

Reviewed By: mweststrate

Differential Revision: D22233104

Pulled By: passy

fbshipit-source-id: b98e49249b9783fe4170232eadba9060b7686743
2020-06-25 08:14:15 -07:00
Pascal Hartig
2af309d476 Resolve security deps
Summary: Still got four warnings up for this on GitHub. Let's do the same we do in the rest of the repo.

Reviewed By: mweststrate

Differential Revision: D22233188

fbshipit-source-id: eb76409b1e5ff5735e354bdbd93f875d22f2add2
2020-06-25 07:12:20 -07:00
Anton Nikolaev
226bbae14b Plugin Marketplace: Check engine field and avoid downloading incompatible updates
Summary: Only download plugins with "engine" version less or equal to the current Flipper version

Reviewed By: mweststrate

Differential Revision: D22211546

fbshipit-source-id: 52cf51badcd1e7041214d2a09ba6b6fc9c331b8f
2020-06-25 05:24:26 -07:00
Pritesh Nandgaonkar
dafe493930 Add architecture and sdk version information
Summary: This diff adds abilist and sdk version information in the AndroidDevice.

Reviewed By: mweststrate

Differential Revision: D22210225

fbshipit-source-id: cda3dea9d89fdaa62a08aa000c93e39177c67bdd
2020-06-25 04:25:19 -07:00
Pascal Hartig
ca64e2455a Dedupe yarn lock
Summary: Should saved some bytes. Wanted to do this after seeing Christoph's talk. Used Atlassian's yarn-dedupe. Sadly, didn't find much.

Reviewed By: mweststrate

Differential Revision: D22207392

fbshipit-source-id: b2f7700f738c054af5e64b030e48185d3789ae12
2020-06-25 02:32:47 -07:00
Pascal Hartig
d3f0643451 Flipper Snapshot Bump: v0.48.1-SNAPSHOT
Summary: Releasing snapshot version 0.48.1-SNAPSHOT

Reviewed By: mweststrate

Differential Revision: D22207961

fbshipit-source-id: 117f48dda700f6df050e51f258829c51bb825a0c
2020-06-25 02:32:47 -07:00
Pascal Hartig
011952d73c Flipper Release: v0.48.0
Summary: Releasing version 0.48.0

Reviewed By: mweststrate

Differential Revision: D22207960

fbshipit-source-id: 7f21ff151c4e5750646a6dd3e39690229a2e73a5
2020-06-25 02:32:47 -07:00
Pascal Hartig
f088d7ceec Update jest
Summary: Getting some warnings from ts-jest being potentially incompatible.

Reviewed By: nikoant

Differential Revision: D22184492

fbshipit-source-id: b0ff36bd63f45ca71957f882a08dcbedfdd5de87
2020-06-24 05:34:23 -07:00
Pascal Hartig
03b231703b Update react-native dependency @allow-large-files
Summary:
This should fix https://github.com/facebook/flipper/issues/1274

I had some cleaning up to do to get to this point.

Changelog:
Fix `react-native-flipper` dependency pulling in debug-only artifacts into release builds.

Reviewed By: mweststrate

Differential Revision: D22160304

fbshipit-source-id: 0ebc0ed942427f2966bccd721bf01aafa38ba400
2020-06-23 07:49:01 -07:00
Anton Nikolaev
e545a50045 Rolled back removing inline source map for plugins build
Summary: After some testing I found file source map does not work as expected when prod version of Flipper is used to debug plugin. So returning back inline source maps. Note that this only affects debug builds, for production builds no source maps will be produced anyway.

Reviewed By: passy

Differential Revision: D22161927

fbshipit-source-id: 068b9da09da4dcb6c31aff4e5a15bd6438f686b3
2020-06-23 03:55:41 -07:00
Anton Nikolaev
f436f192eb Fix getWatchFolder script to resolve workspaces transitive dependencies (#1289)
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/1289

getWatchFolder script updated to resolve symlinked transitive dependencies. Before this change the script only resolved 1st direct symlinked dependencies.

Reviewed By: mweststrate

Differential Revision: D22161469

fbshipit-source-id: c30802a413259021aaca99c08743dc762ed877eb
2020-06-23 03:55:41 -07:00
Pritesh Nandgaonkar
d4680eead9 Support Installation for physical device
Summary: This diff enables the installation for iOS simulators. This also fixes the error view created when there is an error. Right now there is a bug on my machine where idb doesn't detect my physical device. But once it is detected, it will work.

Reviewed By: mweststrate

Differential Revision: D22137831

fbshipit-source-id: b6d6f77318c6baef78c35af73db3969b7dd1b907
2020-06-22 15:58:31 -07:00
Pascal Hartig
2d9d2d4b1a Upgrade flow
Summary:
Close https://github.com/facebook/flipper/pull/1286

Changelog:
Upgrade Flow to 0.127

Reviewed By: jknoxville

Differential Revision: D22160443

fbshipit-source-id: 4f810f2a0adaf87e632a6bc11d4271d57b6f9709
2020-06-22 09:50:42 -07:00
Anton Nikolaev
666032fa46 "yarn build-plugin" command added
Summary: Added "build-plugin" command. Can be used like this: `yarn build-plugin fresco` which produces package to 'sonar/dist/plugins/fresco.tgz'

Reviewed By: mweststrate

Differential Revision: D22160253

fbshipit-source-id: 48b202984b0f515bf253b595be1f59953a9ce411
2020-06-22 08:15:56 -07:00
Anton Nikolaev
4219df6a93 Remove prepack script from each plugin
Summary: Removed back "prepack" script from every plugin package to keep it simple. Instead we will use `build-plugin` command defined in the root package.json (see next diff in the stack).

Reviewed By: mweststrate

Differential Revision: D22160252

fbshipit-source-id: cffb5df65b89df3fe390c051da0df797b3d16d2d
2020-06-22 08:15:56 -07:00
Anton Nikolaev
b69996ca50 Remove inlined source maps from debug builds
Summary: Disabled producing inline source maps for debug builds. Source maps are already writte to "map" files, so this does not make sense to also inline them to the js bundle. Passing "sourceMapUrl" parameter to Metro fixed this.

Reviewed By: mweststrate

Differential Revision: D22159501

fbshipit-source-id: f06225cd43f44a7f93afcc32bb0501323b35d0c3
2020-06-22 06:11:29 -07:00
Michel Weststrate
f373872b5c Add infra to test a plugin
Summary:
There were several reports that it is hard to test an entire plugin, and send updates.

This should address that and help with avoiding plugin regressions in the future.

Added a `renderMockFlipperWithPlugin` utility and demo test.

Reviewed By: passy

Differential Revision: D22114217

fbshipit-source-id: ceefd954abc4ea47c336eab495fb50f161993df9
2020-06-22 06:05:25 -07:00
John Knox
5dd6edc533 Bump docusaurus-plugin-internaldocs-fb
Summary:
I found out that when I fixed the nginx caching issue a few weeks ago, the nginx config was deployed but not all hosts using it were restarted, so I manually restarted them and verified that all three pods are now using the "cache-control: -1" settings.

This is a bump to the plugin so we can detect any versions that are older than this, and refresh the page. I never shipped the [previous diff that tells the user to force refresh](https://www.internalfb.com/intern/diff/D21906069/) because I didn't fully understand what was going on, but now I do.

So I'll make a new one to refresh transparently without the user needing to know.

Reviewed By: nikoant

Differential Revision: D22159282

fbshipit-source-id: 0b7a9e21ea3ad04f99b84eedd585985c8aae232c
2020-06-22 05:48:26 -07:00
Anton Nikolaev
496f97a1ba Disable source maps for Flipper release builds
Summary:
Disabled source maps for Flipper release builds.
1) I found that source maps was not only written to the "bundle.map" file, but also inlined into "bundle.js" in base64 format which hugely affected the total bundle size.
2) In addition to the size, these inlined source maps were also one of 2 causes that Flipper package size was not deterministic and changed so significantly in every diff even when Flipper was not touched at all.

Changelog: Disabled source maps in Flipper release builds thus reducing size by ~20%.

Reviewed By: mweststrate

Differential Revision: D22158898

fbshipit-source-id: b35cfba80553d01aec256983c3ba772ed0534d8f
2020-06-22 05:37:29 -07:00
Anton Nikolaev
c359d666c5 Use default Metro implementation of source module ID mappings for "flipper-pkg bundle"
Summary: Use default Metro implementation of source module ID mappings for "flipper-pkg bundle". The problem with the custom implementation we used before is that it is not deterministic, i.e. produced bundles are different on different machines. We need deterministic bundles to reliably detect if the version changed from the last deployment to Marketplace.

Reviewed By: mweststrate

Differential Revision: D22158794

fbshipit-source-id: ae4b4b05e020489c0900423107a938a5b670e7d8
2020-06-22 02:40:59 -07:00
Anton Nikolaev
21ab8dc25c "flipper-pkg" option for creating production bundle
Summary:
Development bundle: NODE_ENV=development, disabled minification, enabled source maps.

Production bundle: NODE_ENV=production, enabled minification, disabled source maps.

Changelog: Added "--production" option for "flipper-pkg bundle" command to produce minified plugin packages without source maps.

Reviewed By: mweststrate

Differential Revision: D22158791

fbshipit-source-id: 0f9ac84ca39ac3fb86f0c0b0a3c1be866445a305
2020-06-22 02:40:59 -07:00
dependabot[bot]
163f3982f7 Bump ws from 7.2.3 to 7.3.0 in /desktop (#1266)
Summary:
Bumps [ws](https://github.com/websockets/ws) from 7.2.3 to 7.3.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/websockets/ws/releases">ws's releases</a>.</em></p>
<blockquote>
<h2>7.3.0</h2>
<h1>Features</h1>
<ul>
<li><code>WebSocket.prototype.addEventListener()</code> now supports the <code>once</code> option (<a href="https://github-redirect.dependabot.com/websockets/ws/issues/1754">#1754</a>).</li>
</ul>
<h2>7.2.5</h2>
<h1>Bug fixes</h1>
<ul>
<li>Fixed compatibility with Node.js master (651d6627).</li>
</ul>
<h2>7.2.4</h2>
<h1>Bug fixes</h1>
<ul>
<li>The <a href="https://nodejs.org/api/http.html#http_http_request_options_callback"><code>http.request()</code></a> <code>auth</code> option is now supported (<a href="https://github-redirect.dependabot.com/websockets/ws/issues/1734">#1734</a>).</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="41f5e4ff11"><code>41f5e4f</code></a> [dist] 7.3.0</li>
<li><a href="2e5c01f5b5"><code>2e5c01f</code></a> [feature] Make <code>addEventListener()</code> support the <code>once</code> option (<a href="https://github-redirect.dependabot.com/websockets/ws/issues/1754">#1754</a>)</li>
<li><a href="97ddfce983"><code>97ddfce</code></a> [ci] Test on node 14</li>
<li><a href="2b49c4821f"><code>2b49c48</code></a> Revert &quot;[ci] Use GitHub Actions (<a href="https://github-redirect.dependabot.com/websockets/ws/issues/1644">#1644</a>)&quot;</li>
<li><a href="82f05372ba"><code>82f0537</code></a> Revert &quot;[ci] Test on node 14&quot;</li>
<li><a href="b167d1cd45"><code>b167d1c</code></a> Revert &quot;[ci] Update Coveralls GitHub Action to version 1.1.1&quot;</li>
<li><a href="78e1c01959"><code>78e1c01</code></a> [ci] Update Coveralls GitHub Action to version 1.1.1</li>
<li><a href="e6949791fa"><code>e694979</code></a> [doc] Fix badge URL</li>
<li><a href="67983cbba4"><code>67983cb</code></a> [dist] 7.2.5</li>
<li><a href="18d773d1f5"><code>18d773d</code></a> [test] Fix failing tests</li>
<li>Additional commits viewable in <a href="https://github.com/websockets/ws/compare/7.2.3...7.3.0">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=ws&package-manager=npm_and_yarn&previous-version=7.2.3&new-version=7.3.0)](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 close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually

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

Reviewed By: nikoant

Differential Revision: D22118507

Pulled By: passy

fbshipit-source-id: 700f098e5c7b6ddb1dda27ef50974af5b73fe88c
2020-06-22 02:17: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
dependabot[bot]
4ac9dc9eda Bump tslib from 1.11.1 to 2.0.0 in /desktop (#1258)
Summary:
Bumps [tslib](https://github.com/Microsoft/tslib) from 1.11.1 to 2.0.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/Microsoft/tslib/releases">tslib's releases</a>.</em></p>
<blockquote>
<h2>tslib 2.0.0</h2>
<p>This release changes <code>__exportStar</code> and <code>__importStar</code> to use <code>__createBinding</code> which is incompatible with versions of TypeScript older than 3.9 (i.e. 3.8 and below).</p>
<h2>tslib 1.13.0</h2>
<p>This release reverts breaking changes in tslib that were not compatible with versions of TypeScript prior to 3.9. The behavior slightly diverges from that of TypeScript 3.9, but generally is compatible with previous versions of TypeScript-authored code.</p>
<p>The new behavior of TypeScript 3.9 will be available in tslib 2.0.0.</p>
<p><a href="https://github-redirect.dependabot.com/microsoft/tslib/pull/109">See this pull request</a> for more details.</p>
<h2>tslib 1.12.0</h2>
<p>This release adds the <code>__createBinding</code> helper function which is used by non-ECMAScript module emit in TypeScript 3.9.</p>
<h2>tslib 1.11.2</h2>
<p>This release <a href="https://github-redirect.dependabot.com/microsoft/tslib/pull/96">relicenses tslib to the 0BSD license</a> which should allow projects that embed or bundle tslib to omit its license header.</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="2d120146f6"><code>2d12014</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/Microsoft/tslib/issues/112">https://github.com/facebook/flipper/issues/112</a> from microsoft/revert-109-revert3.9Changes</li>
<li><a href="19e3f35015"><code>19e3f35</code></a> Switch to 2.0.0</li>
<li><a href="fa5c8a0b76"><code>fa5c8a0</code></a> Switch from const to var</li>
<li><a href="1a9d7477f3"><code>1a9d747</code></a> Revert &quot;Revert changes to pre-3.9 behavior, update version to 1.13.0&quot;</li>
<li><a href="b7e9c51bf7"><code>b7e9c51</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/Microsoft/tslib/issues/109">https://github.com/facebook/flipper/issues/109</a> from microsoft/revert3.9Changes</li>
<li><a href="7b69d91f43"><code>7b69d91</code></a> Semicolon</li>
<li><a href="0587b2af68"><code>0587b2a</code></a> Add back 'p !== default'</li>
<li><a href="ce3462e9da"><code>ce3462e</code></a> Re-add '__createBinding'.</li>
<li><a href="e6dc41c6d7"><code>e6dc41c</code></a> Update version number.</li>
<li><a href="12fca3bb5a"><code>12fca3b</code></a> Revert changes to pre-3.9 behavior.</li>
<li>Additional commits viewable in <a href="https://github.com/Microsoft/tslib/compare/1.11.1...2.0.0">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=tslib&package-manager=npm_and_yarn&previous-version=1.11.1&new-version=2.0.0)](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 close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually

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

Reviewed By: nikoant

Differential Revision: D22118750

Pulled By: passy

fbshipit-source-id: b9413bda5a1f0df98374cc114e36358a6b168c67
2020-06-19 11:28:15 -07:00
Pascal Hartig
b1ca674171 Update dependabot.yml (#1277)
Summary:
Move to `versioning-strategy: increase-if-necessary`. I'm not sure if that's what we want, but it's really annoying right now where if you include a lockfile, it will update every single patch release, whether or not it's covered by your version range right now.

Let's try this and revert if it doesn't do what I think it does.

Config description here: https://help.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates#versioning-strategy
Pull Request resolved: https://github.com/facebook/flipper/pull/1277

Reviewed By: nikoant

Differential Revision: D22118718

Pulled By: passy

fbshipit-source-id: 450c022fb2a17b68561bb2d9796976dddec002e2
2020-06-19 10:33:19 -07:00
Anton Nikolaev
2085d4e362 Fix layout plugin source import violation
Summary: Fixed direct source import of Flipper code from layout plugin which broke its packaging

Reviewed By: cekkaewnumchai

Differential Revision: D22135716

fbshipit-source-id: 8f67a21ed94c13dd73d24ef8692d37ae51963319
2020-06-19 08:44:51 -07:00
John Knox
40a5721d45 Fix link to diagnostic screen setup
Summary: Was pointed out to be broken in https://github.com/facebook/flipper/issues/1254

Reviewed By: mweststrate

Differential Revision: D22117270

fbshipit-source-id: 15947f9e0373b4324165de7d1a2a6be70a8e652c
2020-06-19 07:58:50 -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