With metro, React Native will proxy console.logs to the HMR server that then gets logged to the terminal, a functionality currently lacking in this library.
This PR implements a basic HMR endpoint simply for log forwarding purposes. When that is established we can also hack the HMR update API to inject arbitrary code to force a reload of the application. Currently that is done via the message socket that is primarily intended for user interaction with the terminal process and therefore would often throw warnings when no clients are connected (for example because they are loading the bundle). This approach also sucks because there is no way to opt out of it. With the HMR hack we get ability to opt out via the dev menu just like with metro.
With metro, React Native will proxy console.logs to the HMR server that then gets logged to the terminal, a functionality currently lacking in this library.
This PR implements a basic HMR endpoint simply for log forwarding purposes. When that is established we can also hack the HMR
update
API to inject arbitrary code to force a reload of the application. Currently that is done via the message socket that is primarily intended for user interaction with the terminal process and therefore would often throw warnings when no clients are connected (for example because they are loading the bundle). This approach also sucks because there is no way to opt out of it. With the HMR hack we get ability to opt out via the dev menu just like with metro.