Summary:
Simplify how messages (state updates) are shown in Flipper UI.
This main change was introduced as a way to show the 'Start' server button whenever we were in a disconnected state. This is not as simple as the server may be restarting or the client may be even have reset the WS connection. Hence you the experience where this UI is shown and immediately dismissed.
This UI is only ever shown if at one point the server was alive, period. So, in this case, either the server becomes available again OR the user quits the PWA/tab/browser and launches again.
IMHO, this is a better experience that totally assuming the server is dead.
In a next iteration, we can be more clever and have a timeout such that if after a set period of time the server doesn't become online, then we show a button to start (or force kill) the server.
Reviewed By: aigoncharov
Differential Revision: D49915698
fbshipit-source-id: 03fcc150ed1f1303d1d727c82a71eb32616208e8
Summary: Also remove the suppress error usage as is it was never used.
Reviewed By: aigoncharov
Differential Revision: D49910876
fbshipit-source-id: 7267eaddadb73ab2b6e2aab0045157271ceed427
Summary: Let's keep it simple, do not reload. Just show/hide the right content.
Reviewed By: antonk52
Differential Revision: D49377316
fbshipit-source-id: 9b2a47374da3e72f17e2d55c9290960b703fd43e
Summary:
Whenever there was a connectivity error, we would show an error message and setup a retry mechanism as to refresh the page as to make it transparent for engineers to have a working workspace again.
The problem is that there are two different channels:
- HTTP server
- WS server
If the HTTP server is healthy but there is a WS error, it is not entirely correct to try to reload the page. If the error conditions for the WS remain, then we end up in a loop.
Reviewed By: passy, antonk52
Differential Revision: D49373335
fbshipit-source-id: 4e0a08fe2384860db0bf92a22edc87402d41651c
Summary:
If there server disconnects, we used to show a red box message on the lower left section of the screen. It didn't say much other than the server had disconnected.
If you are aware of what the server is, then you may try to manually restart it.
Instead of doing that, a much better experience is to show the no connection troubleshoot with the button to start the server or with instructions on how to achieve this.
Reviewed By: antonk52
Differential Revision: D48467308
fbshipit-source-id: 0ffded95789c7548d9f1e1a9127409e02e72ab8c
Summary: This change only adds the PWA as capable of handling files with the ".flipper" extension.
Reviewed By: aigoncharov
Differential Revision: D48353437
fbshipit-source-id: fd78942ac4dffb7d26d5ca5be826290018465b93
Summary: Add a check to prevent the odd error when the box is no longer available to display an error.
Reviewed By: antonk52
Differential Revision: D46763634
fbshipit-source-id: 6ac2c404c842ff989b037c991b5f085baacd2f9a
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: Relay message to the React app via postmessage. Later, we will subscribe to these messages and update the plugins
Reviewed By: lblasa
Differential Revision: D39539590
fbshipit-source-id: c6742e45330e71b63c135c0267e6e9c5817fc9ff
Summary: Using the built-in VSCode formatter to make them all a little more consistent before making changes to them.
Reviewed By: antonk52, nikoant
Differential Revision: D34897393
fbshipit-source-id: 270e575a4e8b15ff31887a356516af7409315618
Summary: Added a favicon so that Flipper tab is recognisable
Reviewed By: nikoant
Differential Revision: D33296434
fbshipit-source-id: 8801c6d0333db5dc9d38f2ff92c86f03386591c7
Summary: Per title, processed some pending review comments made earlier in this stack
Reviewed By: aigoncharov
Differential Revision: D32916920
fbshipit-source-id: 01db85883596b5c85b77efc9cddadeac23cc4ef5
Summary: This diff stubs all node modules when running in the browser, so that, albeit with a lot of errors and without plugins, the UI loads in a browser. To be continued in the rest of this diff
Reviewed By: antonk52
Differential Revision: D32665705
fbshipit-source-id: 4632e241f59c5b9712a41d01a26878afb01f69b5
Summary: Added a command to let a file be opened by the OS, and some other small bits and pieces to make Flipper browser compatible.
Reviewed By: lblasa
Differential Revision: D32721748
fbshipit-source-id: a4ad1c2f662f4651ddf6c20c57e5af1e123914a8
Summary:
This diff sets up the socket connection between flipper-browser and flipper-server, and verifies that the initial UI initialisation work (e.g. `get-config` command works). The initial RenderHost is initialised as well based on the config and browser APIs.
Note that flipper-ui-core itself isn't started yet, as that has still a plethora of node imports, so Metro will correctly refuse to bundle
Not in this diff
* remove Node usage from flipper-ui-core
* implement all RenderHost APIs
Reviewed By: aigoncharov
Differential Revision: D32644074
fbshipit-source-id: 2c8065caf0191771a3867b69a431ca50eeb7a5a3
Summary:
This sets up the metro bundler for flipper-server, to be able to serve the front end.
Note that this is a setup that is only relevant for development purposes
Done in this diff:
* setup metro
* setup fast refresh
* setup nodemon to be able to refresh on server changes
Not done in this diff
* Setup FlipperServerImpl in the flipper-server
* Load flipper-ui-core in flipper-ui-browser
* Load plugins
* Support options, env vars etc etc
* Make flipper-server stand alone (it is largely self contained, but still requires some static resources like theming)
Reviewed By: passy, aigoncharov
Differential Revision: D32626137
fbshipit-source-id: 47f580356ddf0993392d3b583082b187661727e9