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

Add ability to reload all connected devices and simulators #574

Merged
merged 1 commit into from
Jul 23, 2019

Conversation

elicwhite
Copy link
Contributor

Summary:

At Facebook we have a hotkey hooked up to the ability to reload all connected devices and simulators. This is incredibly useful! However, we make this work by deploying an app to everyone's laptop that listens for a global hotkey to tell metro to reload. Since it isn't feasible to do that in open source, this seems like a reasonable approach.

This PR adds the ability to hit the server host /reload, for example: http://localhost:8081/reload and metro will send a command to reload all connected apps.

Personally, I plan on wiring up a hotkey with better touch tool to curl this endpoint. I imagine people can set up alfred workflows or wire it into other apps too.

Test Plan:

reloadall

Copy link
Member

@thymikee thymikee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Let's add some documentation later :)

@thymikee
Copy link
Member

FYI @Esemesek has an idea to put a "Reload" button into the debugger UI, which would be a good starter to overhaul it :)

@thymikee thymikee merged commit 57fc8eb into react-native-community:master Jul 23, 2019
@elicwhite
Copy link
Contributor Author

elicwhite commented Jul 23, 2019

It looks like I might need some help on the iOS side to fix the reliability of the socket connection from the app to metro which makes this work. As it is today it seems like this doesn’t work reliably in open source, at least not for me. Let’s hold off a bit on being loud about this maybe. Once we have a release with this I can hopefully ask for some help in discord

Edit, cool 2.8.0 was published with this

@elicwhite
Copy link
Contributor Author

The connection reliability was fixed in this commit facebook/react-native@4ab9da1

We can talk about this as loudly as we'd like now. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants