Summary: If Flipper server is not running, the offline landing site will offer an option to start it by trying to open 'start-server' under the `flipper-launcher://` scheme.
Reviewed By: mweststrate
Differential Revision: D45950872
fbshipit-source-id: 0d4e22c8474413e914c3c7b4fc9154ae628a8b42
Summary:
The PWA manifest is very unlikely to change at the same frequency that tokens get generated and injected here.
Add it to .gitignore so that these changes are, well, ignored.
Reviewed By: antonk52
Differential Revision: D45950055
fbshipit-source-id: bd082f3bf005c7746c7dd3682b4ebde039633398
Summary:
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.160 to 1.0.163.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/serde-rs/serde/releases">serde's releases</a>.</em></p>
<blockquote>
<h2>v1.0.163</h2>
<ul>
<li>Eliminate build script from serde_derive crate to slightly reduce build time (<a href="https://redirect.github.com/serde-rs/serde/issues/2442">https://github.com/facebook/flipper/issues/2442</a>, thanks <a href="https://github.com/taiki-e"><code>@taiki-e</code></a>)</li>
</ul>
<h2>v1.0.162</h2>
<ul>
<li>
<p>Support deserializing flattened adjacently tagged enums from data formats which represent fields as bytes, such as the <code>csv</code> crate (<a href="https://redirect.github.com/serde-rs/serde/issues/2377">https://github.com/facebook/flipper/issues/2377</a>, thanks <a href="https://github.com/mfro"><code>@mfro</code></a>)</p>
<pre lang="rust"><code>#[derive(Deserialize)]
pub struct Record {
common: u64,
#[serde(flatten)]
kind: Kind,
}
<p>#[derive(Deserialize)]
#[serde(tag = "kind", content = "parameter", rename_all = "lowercase")]
enum Kind {
Foo(u64),
Bar(bool),
}
</code></pre></p>
<pre lang="csv"><code>common,kind,parameter
1,foo,42
2,bar,true
</code></pre>
</li>
</ul>
<h2>v1.0.161</h2>
<ul>
<li>Improve error messages produced by serde_test on test failure (<a href="https://redirect.github.com/serde-rs/serde/issues/2435">https://github.com/facebook/flipper/issues/2435</a>, thanks <a href="https://github.com/Mingun"><code>@Mingun</code></a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="fccb9499bc"><code>fccb949</code></a> Release 1.0.163</li>
<li><a href="a139ab2572"><code>a139ab2</code></a> Adjust PR 2446 with less overgeneralized name</li>
<li><a href="1d910a484c"><code>1d910a4</code></a> Format with rustfmt 1.5.2-nightly</li>
<li><a href="ee9166ec97"><code>ee9166e</code></a> Revise comments on the FlatMapDeserializer entry taker</li>
<li><a href="b5a9eff32e"><code>b5a9eff</code></a> Resolve while_let_on_iterator clippy lint</li>
<li><a href="9441a29663"><code>9441a29</code></a> Merge pull request <a href="https://redirect.github.com/serde-rs/serde/issues/2446">https://github.com/facebook/flipper/issues/2446</a> from Mingun/dedup2</li>
<li><a href="ab6588ef74"><code>ab6588e</code></a> Extract duplicated code into a function</li>
<li><a href="1d11f03449"><code>1d11f03</code></a> Extract logic of taking flattened fields into a function</li>
<li><a href="e11d01fe1d"><code>e11d01f</code></a> Remove constructors for FlatMapAccess and FlatStructAccess</li>
<li><a href="a901f50850"><code>a901f50</code></a> FlatMapAccess and FlatStructAccess does not need to be public</li>
<li>Additional commits viewable in <a href="https://github.com/serde-rs/serde/compare/v1.0.160...v1.0.163">compare view</a></li>
</ul>
</details>
<br />
[](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
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/4736
Reviewed By: ivanmisuno
Differential Revision: D45917748
Pulled By: passy
fbshipit-source-id: 86fbf6ffa9a52f6af3c1e5e2ce39aca04e23a788
Summary: Replacing global static varaibles with local static. No cost at startup time, and also fixes any potential static initialization order fiasco.
Differential Revision: D45900844
fbshipit-source-id: 4ff05cbefe2f0c00199f40b9127e28c355d1819e
Summary: Replacing global static varaibles with local static. No cost at startup time, and also fixes any potential static initialization order fiasco.
Differential Revision: D45900297
fbshipit-source-id: 80e3ffb6527f7f7b6b08de4a6209f0f8298f7bf5
Summary: Get some metrics from the PWA installation wizard.
Reviewed By: antonk52
Differential Revision: D45863352
fbshipit-source-id: 1cf8912a47c749b3b2c2e573796ee1935ea172c9
Summary:
Setting the background to red for error logs has a lot of implications for all text colouring inside of its container.
Instead, set the error border to red, which gives a clear error indication whilst making things easier to read.
changelog: Improve console error logs readability
Reviewed By: mweststrate
Differential Revision: D45861604
fbshipit-source-id: 51f557451ac16269b69ff830a26328552e134ee5
Summary:
Previously we used an overlay to indicated selected but this was kind of hard to see due to <1 opacity. I think this approach where we enchance the border is clearer.
Also we used border colour earlier to indicate type of node which i think was never obvious to the user. Given that nodes heavily overlap we should remove this design language
changelog: UIDebugger, improve selected and hover state of the visualiser
Reviewed By: antonk52
Differential Revision: D45737758
fbshipit-source-id: 5299043656787d6479cff6ec2b38cebe8417fd53
Summary: Fixes a regression from D45394048. It "sortable" as a nullable column prop. When it is undefined it should be treated as true.
Reviewed By: LukeDefeo
Differential Revision: D45776216
fbshipit-source-id: dcd8ce97217086deab7b2b1852837fbfa7437d13
Summary:
I accidentally used vscode. I acctidentally used an await keyword in a sync funciton. typescript has an codeaction to add an async to the function which was out of my screen. This changed the function return type to promise which caused other errors around the codebase and it took me a while to figure out where the error was coming from.
All eslint code actions are safe to apply which is not the case with typescript. Thus making this change.
Reviewed By: lblasa
Differential Revision: D45773531
fbshipit-source-id: 1f8835c442d7703644b1af729ab55fcef7d5be73
Summary:
Let's ban the non null assertion syntax `maybeNull!` as it is unsafe and can cause unexpected behavior. Ideally this should be an error or require a comment explaining why the value cannot be nullish. Though, there are 468 occurrences around the codebase and it is not worth it to manually go around fixing it now. Thus I used a warn to still warn developers to avoid the use where possible.
Last week I spend over an hour on debugging something where the code was null-asserted as the developer thought the value could never be null while in reallity it could. Adding a runtime check in this case sounds reasonable.
rule docs
https://typescript-eslint.io/rules/no-non-null-assertion/
Reviewed By: nikoant
Differential Revision: D45773327
fbshipit-source-id: 9e8a40af353ce979f469ffaedd8e777d72500dab
Summary:
Clean initialisation by passing down the environment info to start server.
(Also rename dir to path as that's the name used in other places)
Reviewed By: passy
Differential Revision: D45731751
fbshipit-source-id: a60fdd49c567fc312d1f8da72db3a46a0828c140
Summary: This feature is annoying and useless
Reviewed By: antonk52
Differential Revision: D45696921
fbshipit-source-id: 01c007d3e196a7511b940b7973bb8e6a880e27e5
Summary: various tests failing due to this dep
Reviewed By: antonk52
Differential Revision: D45731274
fbshipit-source-id: cb79199c15a8973f50e5075dab16605d0120b30c
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/4732
This diff adds a `language` field into `CreatePasteArgs` type to potentially specify programming language in the paste service
Reviewed By: mweststrate
Differential Revision: D45701098
fbshipit-source-id: 080d76e5ff332518881e9c6b84aa47aaea680309
Summary:
Previously we would only generate debug wrapper for render core layout result when uidebugger was currently connected.
This meant if you navigate to a bloks screen *before* having the ui debugger open at render time it would read ui debugger as disconnected since the ui debugger is not a background plugin. The result is the user would see the native nodes instead of the bound tree, it was extra confusing since the layout result was cached so going forward and back doesnt solve it.
The ideal solution would be to have a global flipper is connected on the client but this isnt available yet, lorenzo said he would work on it later.
As a work around we use the fact that the uidebugger has ever been connected in this session.
It can still be confusing since the initial load of a bloks screen migt not generate the debug nodes until you navigate to the plugin once. I will add a note to the docs so say that you need to have open the uidebugger once before nodes will appear
Reviewed By: mweststrate
Differential Revision: D45605120
fbshipit-source-id: 970943b9f8f98221b7fc5e20bb1caf18c2266474
Summary:
For Electron builds, use the same directory as certificates and keys.
For headless builds, then use the static directory.
Reviewed By: antonk52
Differential Revision: D45728515
fbshipit-source-id: 55a3b143a9289fed23e57cbf6b701a5e48d27332
Summary: The isHeadlessBuild flag was not properly set.
Reviewed By: antonk52
Differential Revision: D45728435
fbshipit-source-id: 3616c4358114d4f3d96372766dabf48b27b44333
Summary:
Bit annoying if everytime we run it we have to manually delete/discard file.
So, add to gitignore.
Reviewed By: LukeDefeo, passy
Differential Revision: D45688164
fbshipit-source-id: 6ae2b570f571a3d44b0c75bb3d614887e4943e5b
Summary:
Until now, launching flipper-server with TCP would accept any incoming connection as long as it comes from the same origin (localhost) using web socket host origin verification.
This is not entirely secure as origin can be spoofed with tools like curl.
Our team created a security review and a proposal was written:
https://docs.google.com/document/d/16iXypCQibPiner061SoaQUFUY9tLVAEpkKfV_hUXI7c/
Effectively, Flipper can generate a token which is then used by the client to authenticate.
This diff contains the changes required to generate, obtain, and validate authentication tokens from clients connecting to flipper over TCP connections.
The token itself is a JWT token. JWT was chosen because it is a simple industry standard which offers three features which can immediately benefit us:
- Expiration handling. No need for Flipper to store this information anywhere.
- Payload. Payload can be used to push any data we deem relevant i.e. unix username.
- Signing. Signed and verified using the same server key pair which is already in place for certificate exchange.
Additionally, the token is stored in the Flipper static folder. This ensures that the browser and PWA clients have access to it.
Reviewed By: mweststrate
Differential Revision: D45179654
fbshipit-source-id: 6761bcb24f4ba30b67d1511cde8fe875158d78af
Summary: Cosmetic change to make the events more inline with what they are
Reviewed By: lblasa
Differential Revision: D42999134
fbshipit-source-id: e026e38da7e50e8f5520271246f9627eb22e8965
Summary:
This adds the base infra for the UIDebugger bloks integration as well as an implementation for the Layout result wrapper for bloks. When theUIDebugger is connected we wrap the original layout result with a debug varient that delegates all methods to the original layout result but also provides access to the bloks model.
This allows the UIDebugger to inspect the Layout result and bloks model together
Reviewed By: pasqualeanatriello
Differential Revision: D43444444
fbshipit-source-id: ac531a0c7491c05db1d6f7671e3ab09c73c213b9
Summary:
The logic was a little outdated to when we were accumulating subtrees, now its much simpler, if the previously focused id is not in the new frame, remove focus
Changelog: UIDebugger, fix focus mode behaviour
Reviewed By: mweststrate
Differential Revision: D45523026
fbshipit-source-id: 894a85df21cc27eb57dbef411ae57743d0c4f753
Summary:
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.70 to 1.0.71.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/dtolnay/anyhow/releases">anyhow's releases</a>.</em></p>
<blockquote>
<h2>1.0.71</h2>
<ul>
<li>Documentation improvements</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="8b4fc43429"><code>8b4fc43</code></a> Release 1.0.71</li>
<li><a href="3c33b4b072"><code>3c33b4b</code></a> Merge pull request <a href="https://redirect.github.com/dtolnay/anyhow/issues/306">#306</a> from dtolnay/noinline</li>
<li><a href="d491b88840"><code>d491b88</code></a> Mark format_err macro as doc(no_inline)</li>
<li>See full diff in <a href="https://github.com/dtolnay/anyhow/compare/1.0.70...1.0.71">compare view</a></li>
</ul>
</details>
<br />
[](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
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/4707
Reviewed By: antonk52
Differential Revision: D45484397
Pulled By: passy
fbshipit-source-id: 4c960ef862e882789a6a1ff94aafb5b62ffb5058
Summary: People complained about barely noticeable filtered state indication multiple times
Reviewed By: antonk52
Differential Revision: D45394233
fbshipit-source-id: 60a3531b1808ae8f95ce8cd405a20b74bad0ed46
Summary:
Just to make sure that nobody injects something in our build chain. Checksum taken from the official website: https://gradle.org/release-checksums/
Pull Request resolved: https://github.com/facebook/flipper/pull/4704
Reviewed By: antonk52
Differential Revision: D45320680
fbshipit-source-id: 2a489264f3c377ef2c6bb4557cb788b4ab19bcc5
Summary:
Given that stream interceptor is async the folling race conditino could occur.
Frame at time t=0 comes in, we yeild to the event loop while fetching metadata, fetch takes 5 ticks
Frame at time t=1 comes in, we yeild to the event loop but fetch takes 1 tick
At time t=2 the second frame is augmented and display
At time t=5 the first fetch returns and we display and older frame
This is a simple check to avoid this.
Reviewed By: aigoncharov
Differential Revision: D45314013
fbshipit-source-id: 054e7e6beb52dfbfd94bc9f8ee3d0a758a669f66
Summary:
In order to support this the stream inceptor transform nodes now is able to return a list of new meta enties, since these are new attributes we try to mimic what would have happened if they were generated on the client. This makes the rest of the logic downstream simpler
Introduced metadata register, same idea as on the clients.
The attributes available are a mixed bag, will work with blok server to imporove
Reviewed By: antonk52
Differential Revision: D45177781
fbshipit-source-id: 9d761b2f682e7e0fd4710f5b2e9d9d6ff26741fc
Summary: This is purely a cosmetic change but more accurately reflects the nature of how we send data from device to desktop. Ie its always an entire frame rather than subtrees. This helps with correctness great Both ios and android are like this and have been for a while.
Reviewed By: lblasa
Differential Revision: D45080088
fbshipit-source-id: 8f68047056c4825b0b1dd89f26c7fa462e2ecb1b
Summary: We were memoizing the reduction trace fetch in the stream interceptor but this was redundant. We let the library handle that. Also pulled the calls into the uidebugger so we have more control over the retry behaviour
Reviewed By: mweststrate
Differential Revision: D45079132
fbshipit-source-id: 7354fce0fddbebdb0b027dade03398a36adc5e9a
Summary:
* Added line number as an attribute to node, in theory we could get it from the device in the case of compose
* dont need to use miles as have the file already
* cleaned up naming in ide file resolver so its clear its the qualified name we are talking about
Reviewed By: lblasa
Differential Revision: D45079135
fbshipit-source-id: 24f2d5814800a4a404b680599d307cc750758fcd
Summary:
1. Need to unminify the names from something call the minification map
2. Bloks attributes themselves are already minified. However the uidebugger also has a similar concept in its own metadata so the data we get off the device has been minified twice. To fix this we remap the metadata off the device using the minification map. In order to find the correct entry we need to get the style id of the bloks model parent. this is sent as a metadata custom attribute
Reviewed By: lblasa
Differential Revision: D45079136
fbshipit-source-id: bb448d81918c0b8c9e8ac87c4390b46a8a374d78