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
Summary: Script to list all plugins included into Flipper desktop workspaces.
Reviewed By: passy
Differential Revision: D22256917
fbshipit-source-id: a3d8a0f9faea6e462a2f22be155d99eb22eb59d8
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
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
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
Summary: This diff adds abilist and sdk version information in the AndroidDevice.
Reviewed By: mweststrate
Differential Revision: D22210225
fbshipit-source-id: cda3dea9d89fdaa62a08aa000c93e39177c67bdd
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
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
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
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
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
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
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
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
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
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 "[ci] Use GitHub Actions (<a href="https://github-redirect.dependabot.com/websockets/ws/issues/1644">#1644</a>)"</li>
<li><a href="82f05372ba"><code>82f0537</code></a> Revert "[ci] Test on node 14"</li>
<li><a href="b167d1cd45"><code>b167d1c</code></a> Revert "[ci] Update Coveralls GitHub Action to version 1.1.1"</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 />
[](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
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 "Revert changes to pre-3.9 behavior, update version to 1.13.0"</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 />
[](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
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
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/1224
Upgrade Electron-related dependencies to version 9.
Changes includes:
- force `fetch` to `no-cors` mode to get rid of CORS policy error while upgrading to version 9
- `keytar` returns promises so changes to reflect that ([reference](https://github.com/atom/node-keytar/blob/master/keytar.d.ts))
Reviewed By: passy
Differential Revision: D21862765
fbshipit-source-id: 25e236ee568934ee9c64dcc90f2fc9648c905b6a
Summary:
Had some horrible dev experience caused by VSCode and Jest not agreeing what snapshots should look like, every time saving a test in VSCode, it would break the jest snapshots. After investigating eslint and prettier, turned out VSCode itself was the culprit. Caused by a global user setting, but this makes sure nobody else runs into it :)
Also made sure Jest uses the correct prettier settings (it didn't before).
Reviewed By: passy
Differential Revision: D22114656
fbshipit-source-id: aef6c278a668bce049c96aba95c7a5101ca840ad
Summary: The constructor that accepts `context` is deprecated and in turn causes `React.ComponentProps<typeof ManagedDataInspector>` and other type signatures to fail.
Reviewed By: mweststrate
Differential Revision: D22111964
fbshipit-source-id: 71553d749d0d7de6ef34350faa55d04433a639d1
Summary: I'm working on an attribute inspector that has particular top-level special keys that should not be editable, while the rest can be. This enables the functionality to allow dynamic determinations of what can be made editable, and is an additive non-breaking change to the API.
Reviewed By: mweststrate
Differential Revision: D22111965
fbshipit-source-id: 4bc6df0f76cf1e2bf0590235dcf543c665c7d8d8
Summary: D22047276 introduced a new way to adding log data column depending on how one sorts by time. This diff adds unit test to test the logic
Reviewed By: passy
Differential Revision: D22068114
fbshipit-source-id: 3fe01beec69d45d96f2fc2a437c3f408686565a3
Summary:
Well this is embarassing. My iPhone is called iPhone, so I assumed instruments always outputs "iPhone" for iPhones, but it doesn't if they've got a different name.
Pointed out in https://github.com/facebook/flipper/issues/262
Reviewed By: nikoant
Differential Revision: D22066872
fbshipit-source-id: 847e1baf28103692dc9472d9730b6384ec719be0
Summary:
App Names can contain special characters. Escape them (and unescape later) so that device ID strings don't break.
Simpler is better - thanks to mweststrate for keeping me out of the rabbit hole
## Changelog
Escape app name to account for special characters in name
Pull Request resolved: https://github.com/facebook/flipper/pull/1268
Test Plan:
Added test to test character escaping: `cd desktop && yarn test -- -i app/src/utils/__tests__/clientUtils.node.tsx`
closes https://github.com/facebook/flipper/issues/1252
Reviewed By: passy
Differential Revision: D22066263
Pulled By: jknoxville
fbshipit-source-id: c820d055700ca6f55d35265528ce874eeb159216
Summary:
When running `flipper-pkg init path/plugin`, this allows to skip the `Do you wanna add this path to watching in Flipper config?`, if the path is direct first level subdirectory of any added path from Flipper `pluginPaths: []`
## Changelog
- Improve matching for watched pluginPaths when initialising new plugin
Pull Request resolved: https://github.com/facebook/flipper/pull/1269
Test Plan:
1. Create folder: `~/flipper-plugins`
2. Add this folder to Flipper config `pluginPaths: ['~/flipper-plugins']`
3. Create new subfolder `test-plugin`
4. Run `flipper-pkg init test-plugin`
5. It should not ask to add this folder to pluginPaths
To verify it only works for first level subdirectory, create another folder: `/deep/test-plugin2` and re-run steps with it.
This should also keep working if we specify exactly the path for the plugin itself.
Reviewed By: mweststrate
Differential Revision: D22065630
Pulled By: jknoxville
fbshipit-source-id: 9ef8d364e3815033b63579e37a6f2d19515ca902
Summary: Enabled selection of notification text + added a context menu item to copy the selected text only.
Reviewed By: passy
Differential Revision: D22065704
fbshipit-source-id: 510e68d50a54329aaeefb9b3097bc4283f884dc9
Summary:
Show notification if user has installed plugins packaged in the old format. Example text of notification:
***
Plugin "Example" will stop working after version 0.48 of Flipper released, because it is packaged using the deprecated format.
Please try to install a newer version of this plugin packaged using "Install Plugins" tab on "Manage Plugins" form.
If the latest version of the plugin is still packaged in the old format, please contact the author and consider raising a pull request for upgrading the plugin. You can find contact details on the package page https://www.npmjs.com/package/flipper-plugin-example.
If you are the author of this plugin, please migrate your plugin to the new format, and publish new version of it. See https://fbflipper.com/docs/extending/js-setup#migration-to-the-new-plugin-specification on how to migrate the plugin. See https://fbflipper.com/docs/extending/js-setup#package-format for details on plugin package format.
***
Reviewed By: passy
Differential Revision: D22065688
fbshipit-source-id: da9b9d8f62e7cdb8c926a81e24bdfb4ec67f9dff
Summary:
This is a discussion on Github about reversing log. This diff tries to do that.
Changelog: Add ability to reverse log by time
Reviewed By: mweststrate
Differential Revision: D22047276
fbshipit-source-id: 6100a5ca40db223d1989be2746c7190cce7ffc53
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/1267
Bumped versions of all plugins to match current Flipper version 0.46.0.
Reviewed By: mweststrate
Differential Revision: D22042959
fbshipit-source-id: 37c169bfd1b90debb8f94c9465a345a015524158
Summary:
Updated "bump-versions" script to also bump version of all plugins when we're releasing Flipper.
Changelog: Versions of bundled plugins will be matching Flipper core version.
Reviewed By: mweststrate
Differential Revision: D22042960
fbshipit-source-id: b2d361ce9cbfc8022e12aecbbf7c6101029844e5
Summary: There was a error on bundling plugins which references a shared lib, because of wrong check during babel transformation.
Reviewed By: passy
Differential Revision: D22041443
fbshipit-source-id: c157675c05e9d9653b65ed30293e3b8b09bae260
Summary: All the plugins migrated to spec v2 to allow packaging/publishing them independently from Flipper releases.
Reviewed By: passy
Differential Revision: D22041384
fbshipit-source-id: 23bfaf724f771a57bd628b9ea1c4d37846534a93
Summary:
This diff is not meant to land as-is, but instead to generate discussion on how to properly accomplish this.
The goal is to add a Layout plugin sidebar extension that displays the NT reduction trace when an NT component is selected.
Note this is a feature that exists today (when whitelisted on `reduction_trace_check` GK) via the `SKComponentLayoutDescriptor` API, where we'd include the entire JSON representation on every element and display that in a standard inspector in the sidebar. We have a new metadata system where we only include a metadata id and Flipper can separately request the metadata, which is much more performant. Also, we have an existing `NTReductionTracePanel` component we'd like to use that handles requesting and displaying that information in a much better way.
I'd still like to use the `SKComponentLayoutDescriptor` API (or something similar) to have access to that component's metadata id in order to decide whether the panel should appear and of course that id is needed for the panel. This works well right now (see test plan), but as you can see, it's less than ideal in that it needs to look into `Extra Sections` then `Native Templates` to get that information. This might be acceptable for the time being while we think this API through, but I wanted to get input on if we can do better before trying to land.
Additional questions:
- Why are `SidebarExtensions` exported from the "flipper" module, when they only work with and import from the Layout plugin?
- There are two `InspectorSidebar` components - one in the Layout plugin and one in main flipper module [here](https://fburl.com/diffusion/ecg8lhfq) that I don't think is being used?
Reviewed By: mweststrate
Differential Revision: D21887701
fbshipit-source-id: 23ed19c08b68b4b1115b8cc6af84af9e87e91128
Summary: When Flipper is running in dev mode we should always use bundled version of plugin (e.g. loaded from sources) even if a newer version is installed. Otherwise it could happen that Flipper will load installed version and it will not be possible to test your changes of plugin sources.
Reviewed By: passy
Differential Revision: D22016564
fbshipit-source-id: fbf63d5248b60034dc61688e4faa9b54890b744e
Summary:
JS/TS api:
- migrate to TS
- some refactoring (get rid of bridge, make client abstract)
Implementation isn't full yet, things to be implemented:
- let plugins connect on init command from Flipper
- implement Responder
Further plans:
- make fully compatible with react-native api without breaking changes
Reviewed By: mweststrate
Differential Revision: D21839377
fbshipit-source-id: 9e9fe4ad01632f958b59eb255c703c6cbc5fafe2
Summary:
Sign in form improvements:
1) Added context menu with "Paste" and "Reset" items
2) Added "Reset" button
3) When form is empty, simple click to it automatically pastes token from clipboard
4) Automatically sign-in after token is pasted into empty form
Reviewed By: mweststrate
Differential Revision: D21994724
fbshipit-source-id: 8605c7f9b96777036b1b20b69370fba499185911
Summary:
When the `Scrollable` component was introduced, this functionality regressed because the `ref` was no longer set on the right component.
changelog: Fix scrolling to inspected element in Layout plugin
Reviewed By: mweststrate
Differential Revision: D21979475
fbshipit-source-id: f84d515cb1593a33d1ae0e93a01681b6e11aa623