Commit Graph

21 Commits

Author SHA1 Message Date
Lorenzo Blasa
f1b35ca592 Make HTML entry points identical
Summary: Make both prod and dev HTML entry points identical.

Reviewed By: aigoncharov

Differential Revision: D51307116

fbshipit-source-id: 5aea8e455d623aba260e3e37a2c549ebc67dd3b0
2023-11-14 10:53:09 -08:00
Lorenzo Blasa
7de92cb34a Config set from server
Summary: Instead of having duplicate configs defined on our HTML. Move the config definition to the server.

Reviewed By: aigoncharov

Differential Revision: D51307092

fbshipit-source-id: 68f4afc918cf191b3a15b3981429c5a05d5df8df
2023-11-14 10:53:09 -08:00
Lorenzo Blasa
9166939214 Rename constants
Summary: After the move, let's rename the constants to make them match our code standards.

Reviewed By: aigoncharov

Differential Revision: D51307087

fbshipit-source-id: 4e44e956fd88abd3e8359fe94fa4e31d17f61a55
2023-11-14 10:53:09 -08:00
Lorenzo Blasa
49abb4dd41 Move constants to flipperConfig
Summary: Recently we have added a few constants to be used by our main entry point. This change moves them to a central place: flipperConfig.

Reviewed By: aigoncharov

Differential Revision: D51307088

fbshipit-source-id: 09f0ef0e69e2067ce5c8501367629eeec7523858
2023-11-14 10:53:09 -08:00
Andrey Goncharov
4b3f572205 Preserve previous error messages
Reviewed By: passy

Differential Revision: D51197113

fbshipit-source-id: 237c6f1f894cb4d758150ff2bddf14c104d3b381
2023-11-10 03:39:32 -08:00
Andrey Goncharov
8ef29c8160 Embed auth token into HTML
Summary:
Auth token used be injected in the manifest file. Instead, have the server injected into the main HTML page.

The main driver to this change are:
- Simplify
- There are instances in which for some reason reading/writing the token from the manifest fails. This will address that problem.

Reviewed By: lblasa

Differential Revision: D51160521

fbshipit-source-id: 4626fd8f56bc8b61182a53a5d9cf5acad1e723bc
2023-11-09 14:05:43 -08:00
Lorenzo Blasa
34bbd41547 If unable to load main bundle, retry after 3 seconds
Summary: If we fail to load the main js bundle, retry after 3 seconds.

Reviewed By: aigoncharov

Differential Revision: D50732857

fbshipit-source-id: b19ea165776f8105d724e586b1bed20bf1f5178c
2023-10-27 10:19:33 -07:00
Andrey Goncharov
cc76a21d80 Add more tracking data for UI startup
Reviewed By: lblasa

Differential Revision: D50365803

fbshipit-source-id: b6a601e7bf987738400a86be6814de7cafd50d3d
2023-10-17 08:28:02 -07:00
Andrey Goncharov
ee7736caee Add a more complex logger to Flipper UI Browser
Reviewed By: passy, lblasa

Differential Revision: D50223987

fbshipit-source-id: 108e1753b555c7d7b32d3fc2408c2f8efcbadb4d
2023-10-16 09:27:50 -07:00
Lorenzo Blasa
d9ad2a8932 Remove troubleshoot from here
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
2023-10-05 04:37:16 -07:00
Lorenzo Blasa
80fc8eb4ed Hide troubleshoot if a message needs to be shown
Summary: Also remove the suppress error usage as is it was never used.

Reviewed By: aigoncharov

Differential Revision: D49910876

fbshipit-source-id: 7267eaddadb73ab2b6e2aab0045157271ceed427
2023-10-05 04:37:16 -07:00
Lorenzo Blasa
f897203a32 Better name for showing troubleshooting steps
Summary: Better name for toggling troubleshoot/main UI

Reviewed By: antonk52

Differential Revision: D49411916

fbshipit-source-id: 1e5bd4e3e5742abef1fca41349bc8b16cf1229bf
2023-09-20 04:10:39 -07:00
Lorenzo Blasa
f1c88a464b Do not use window reload
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
2023-09-18 12:03:09 -07:00
Lorenzo Blasa
342ef42114 Break connection loop
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
2023-09-18 08:57:15 -07:00
Lorenzo Blasa
4ff9279a0b Offline troubleshoot when server disconnects
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
2023-08-18 07:59:51 -07:00
Lorenzo Blasa
ce13ee426f Open file import
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
2023-08-17 13:46:08 -07:00
Lorenzo Blasa
c6d5eb3334 Flipper as PWA
Summary:
^

Reference: https://docs.google.com/document/d/1flQJUzTe4AuQz3QCpvbloQycenHsu7ZxbKScov7K7ao

Reviewed By: passy

Differential Revision: D45693382

fbshipit-source-id: 5a2e6c213a7e7e2cf9cd5f3033cff3e5291a2a92
2023-05-16 04:32:47 -07:00
Pascal Hartig
af924b1c6a Format html files
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
2022-03-16 09:41:36 -07:00
Michel Weststrate
b1162a47c5 Set favicon
Summary: Added a favicon so that Flipper tab is recognisable

Reviewed By: nikoant

Differential Revision: D33296434

fbshipit-source-id: 8801c6d0333db5dc9d38f2ff92c86f03386591c7
2021-12-24 02:16:48 -08:00
Michel Weststrate
b1d960e4c4 Make sure plugin loading works in NPX builds
Summary: Make sure non-bundled plugins load correctly . Note that sourcemaps don't load yet

Reviewed By: nikoant

Differential Revision: D33278639

fbshipit-source-id: 9951286ec6df65f33149e4687261a43e6c072c31
2021-12-24 02:16:48 -08:00
Michel Weststrate
6ff4abbc67 Make flipper-server stand-alone servable
Summary:
This diff makes flipper-server stand-alone servable as a single package.

It basically works as follows:

- (default) plugins are build as usually into static folder
- static folder is copied into flipper-server/static (as far as relevant)
- `flipper-server/src/index.tsx` is bundled into `flipper-server/dist/index.js`
- `flipper-ui-browser/src/index.tsx` is bundled into `flipper-server/static/bundle.js`

If flipper-server is started without the `--bundler` config, the `bundle.js` will be served statically, rather than starting up the Metro bundler with all the typical transforms (in a distributed version of the package those all wouldn't resolve)

Things to be done in next diffs:

* make sure plugins actually load in the non bundled setup
* make sure flipper-server gets published properly
* make sure build is created as part of CI

At the end of this stack, running `npx flipper-server` on any machine should basically be a viable approach to get flipper up and running locally :)

Reviewed By: nikoant

Differential Revision: D33171107

fbshipit-source-id: 4af8ac2699467a0b55283fe084640482700744c2
2021-12-24 02:16:48 -08:00