Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standalone DevTools Profiler should work with no connected clients #22127

Closed
mrkev opened this issue Aug 18, 2021 · 10 comments
Closed

Standalone DevTools Profiler should work with no connected clients #22127

mrkev opened this issue Aug 18, 2021 · 10 comments

Comments

@mrkev
Copy link
Contributor

mrkev commented Aug 18, 2021

When the standalone DevTools are opened without a running React application, this is what's currently shown:

Screen Shot 2021-08-18 at 1 47 49 PM

Being able to use the standalone app without any connected clients, just to inspect saved profiles, would be a nice to have though. We should move the greeting message / instructions into the Components tab (when there's no connected apps) and let the Profiler be used to import previous profiles.

Note that doing this will likely require a new prop being passed to the outer DevTools component.

@mrkev mrkev added the Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug label Aug 18, 2021
@bvaughn bvaughn added Component: Developer Tools Type: Discussion and removed Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug labels Aug 18, 2021
@bvaughn
Copy link
Contributor

bvaughn commented Aug 18, 2021

The messaging on this splash page is pretty important. Maybe we could keep it, but somehow show it inside of the Components tab– and the Profiler tab could be functional in a read-only (import only) form.

@mrkev
Copy link
Contributor Author

mrkev commented Aug 18, 2021

That sounds like a good idea, yeah. If the components tab is the one that shows first by default too, people wouldn't miss this information.

@bvaughn bvaughn changed the title DevTools: Standalone should support no connected clients Standalone DevTools Profiler should work with no connected clients Oct 12, 2021
@hristo-kanchev
Copy link
Contributor

Hey, @bvaughn I can take a look at this during this weekend. 👍

@bvaughn
Copy link
Contributor

bvaughn commented Oct 12, 2021

Hey @hristo-kanchev. Sure, that'd be fine!

I'm going to take a pass at updating the description to match my thinking.

@hristo-kanchev
Copy link
Contributor

I'm going to take a pass at updating the description to match my thinking.

Sure thing. Thanks!

@gabrieltrompiz
Copy link
Contributor

Hi @bvaughn, I was taking a look at this issue yesterday and didn't notice @hristo-kanchev asked to take it and forgot to ask myself, sorry for any inconvenience and would understand if my solution is not considered.

I think an alternative solution would be to add a "Profiler" section in the greeting/instructions page, that contains a button/link that redirects to the DevTools with the "Profiler" tab opened by default. I think it requires less changes (if any) directly to the DevTools component and can be made by just changing some things in the splash page and in the devtools-core.

I took the time to quickly change the HTML of the splash page and it would look like this (might need some rewording):
Screen Shot 2021-10-12 at 8 44 04 PM
The other thing I wanted to mention was that, as far as I understand it (correct me if I'm wrong), the DevTools component depends on the connection with the client to be made, since it makes use of the Store and the Bridge, which are created when the connection is established. So, in order to render the DevTools before the connection is made, that dependency has to be resolved or a "fake" Bridge and Store would be necessary (while the "real" Bridge and Store would be created upon the connection being established). My solution in this case was to instantiate a "fake" Bridge and Store in the devtools-core, and that would be the one used by the component while in "read-only" or "Profiler" mode, and when the real Bridge and Store are created it just updates and starts showing the Component tree and everything as usual, but I'm not sure if that's the most appropriate solution.

@bvaughn
Copy link
Contributor

bvaughn commented Oct 13, 2021

Hey @gabrieltrompiz. That's an interesting alternative proposal. Would be happy to review a proof of concept.

@hristo-kanchev
Copy link
Contributor

hristo-kanchev commented Oct 13, 2021

Hiya @gabrieltrompiz! If you need help or want me to take over feel free to ping me. ^^

@bvaughn
Copy link
Contributor

bvaughn commented Oct 13, 2021

Going to mark this task as owned by the three of us so it will at least be clearly taken. We can coordinate the details going forward. Really appreciate the help!

@gabrieltrompiz
Copy link
Contributor

Thanks @bvaughn and @hristo-kanchev, I just submitted the PR for further discussion of the changes!

@bvaughn bvaughn closed this as completed Oct 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants