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
Summary:
Hooked up metadata to the stream inteceptor, enhanced error handling to deal with:
1. Recording subsequent metadata messaages that came in while in error state such that all of them are processed
2. Recording any frames that came in while in error state such that after recovering from error we have the latest state
3. Splitting out recoverable and non recoverable errors more explicitly
Reviewed By: lblasa
Differential Revision: D45079137
fbshipit-source-id: 67a2ffef72d94d2b1492f201a2228659720e306b
Summary:
Added stream interecptor which gets a chance to augment the messages off the wire. Stream interceptor transformations are async and can fail due to network errors so added error state with a retry button. The retry button will just call the function again.
I am also handling errors better generally when this method fails unexpectedly, logging more clearly what went wrong and communicating it to the user
Did some refactoring of subtree update event to support this
Reviewed By: lblasa
Differential Revision: D44415260
fbshipit-source-id: a5a5542b318775b641d53941808399a8fa4634d3
Summary: Type is any as it can be litterally anything, using json is a bit of pain as we have to do a lot of type checks to access anything
Reviewed By: lblasa
Differential Revision: D45079133
fbshipit-source-id: bcce93a1fce48d2779a648576f12df6392a0938e
Summary: These replace tags, and are KV instead. They allow us to send framework specific data that arent common enough to be promoted to the top level, similar to hidden attributes. They will be needed for bloks
Reviewed By: lblasa
Differential Revision: D45079134
fbshipit-source-id: e4962bd56f0c24608504367f50cd796fd3d79fcd
Summary: This is no longer needed or sent by the client given our new approach to frames
Reviewed By: antonk52
Differential Revision: D44872566
fbshipit-source-id: 9ec340a5cc68605f730cf6677fb89778bf77a3a1
Summary:
^
There's no references to this anywhere, so delete.
Reviewed By: antonk52
Differential Revision: D45309041
fbshipit-source-id: e62e94b089eee30b82b05f64c8e7b31dd03597b6