-
Notifications
You must be signed in to change notification settings - Fork 902
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
Fix Web Debugging and Other Websocket Endpoints with Metro 0.67 #1560
Fix Web Debugging and Other Websocket Endpoints with Metro 0.67 #1560
Conversation
Metro 0.67 included facebook/metro@38a200e which changed the way external applications should interface with it to add new WebSocket endpoints. This materializes as failures when web debugging RN 0.68 apps. This change applies the reccomended fix, of passing a list of non-server endpoints to Metro when starting the server. I verified that web debugging works correctly after making the fix, for the same app where it previously did not work. `ws` is updated as part of the change, along with removing tpe-checker suppressions, of which one was resulting in a runtime error.
That number seems to not actually be controlled by us, looking at |
I tried running Metro, then web debugging, a few times, even after resetting the cache, and haven't seen the issue since. Not sure if I had some stale sate, or if there's a real issue here... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this is great <3! I've moved the creation of the sockets and debugger proxy up and removed the stubs for isDebuggerConnected
and broadcast
, since now they're eagerly and always (I think?) created.
Tested various cases, disconnecting the debugger and app and server many times, and it seem to work as expected every time. Going to merge this in and release asap
* Fix Web Debugging and Other Websocket Endpoints with Metro 0.67 Metro 0.67 included facebook/metro@38a200e which changed the way external applications should interface with it to add new WebSocket endpoints. This materializes as failures when web debugging RN 0.68 apps. This change applies the reccomended fix, of passing a list of non-server endpoints to Metro when starting the server. I verified that web debugging works correctly after making the fix, for the same app where it previously did not work. `ws` is updated as part of the change, along with removing tpe-checker suppressions, of which one was resulting in a runtime error. * Remove session number * chore: stop using stubs for isDebuggerConnected and broadcast Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
…#33156) Summary: Doing this patch level bump to ensure that all packages consuming `react-native` will get `7.0.3` and not lower 7.x versions. This is because this new patch contains this fix: react-native-community/cli#1560 (thanks NickGerleman & thymikee for your work!) We'll have to cherry-pick this into the 0.68 branch. While at it, I've also done a cheeky `npx yarn-deduplicate` to clean up the `yarn.lock` a bit. ## Changelog <!-- Help reviewers and the release process by writing your own changelog entry. For an example, see: https://github.com/facebook/react-native/wiki/Changelog --> [General] [Changed] - Bump RN CLI to v7.0.3 to address web debugging issue Pull Request resolved: #33156 Test Plan: CI + some local testing via `test-manual-e2e`: <img width="1779" alt="Screenshot 2022-02-21 at 11 40 54" src="https://user-images.githubusercontent.com/16104054/154948695-8c40bb56-87eb-4326-a740-49930994c08b.png"> Reviewed By: cortinico Differential Revision: D34385503 Pulled By: motiz88 fbshipit-source-id: f0d8c4e0e92f83c0d819eeaa0fbec27820145968
…#33156) Summary: Doing this patch level bump to ensure that all packages consuming `react-native` will get `7.0.3` and not lower 7.x versions. This is because this new patch contains this fix: react-native-community/cli#1560 (thanks NickGerleman & thymikee for your work!) We'll have to cherry-pick this into the 0.68 branch. While at it, I've also done a cheeky `npx yarn-deduplicate` to clean up the `yarn.lock` a bit. <!-- Help reviewers and the release process by writing your own changelog entry. For an example, see: https://github.com/facebook/react-native/wiki/Changelog --> [General] [Changed] - Bump RN CLI to v7.0.3 to address web debugging issue Pull Request resolved: #33156 Test Plan: CI + some local testing via `test-manual-e2e`: <img width="1779" alt="Screenshot 2022-02-21 at 11 40 54" src="https://user-images.githubusercontent.com/16104054/154948695-8c40bb56-87eb-4326-a740-49930994c08b.png"> Reviewed By: cortinico Differential Revision: D34385503 Pulled By: motiz88 fbshipit-source-id: f0d8c4e0e92f83c0d819eeaa0fbec27820145968
…#33156) Summary: Doing this patch level bump to ensure that all packages consuming `react-native` will get `7.0.3` and not lower 7.x versions. This is because this new patch contains this fix: react-native-community/cli#1560 (thanks NickGerleman & thymikee for your work!) We'll have to cherry-pick this into the 0.68 branch. While at it, I've also done a cheeky `npx yarn-deduplicate` to clean up the `yarn.lock` a bit. <!-- Help reviewers and the release process by writing your own changelog entry. For an example, see: https://github.com/facebook/react-native/wiki/Changelog --> [General] [Changed] - Bump RN CLI to v7.0.3 to address web debugging issue Pull Request resolved: #33156 Test Plan: CI + some local testing via `test-manual-e2e`: <img width="1779" alt="Screenshot 2022-02-21 at 11 40 54" src="https://user-images.githubusercontent.com/16104054/154948695-8c40bb56-87eb-4326-a740-49930994c08b.png"> Reviewed By: cortinico Differential Revision: D34385503 Pulled By: motiz88 fbshipit-source-id: f0d8c4e0e92f83c0d819eeaa0fbec27820145968
Sorry for being late here, but why e4b7805#diff-419c2d522450d9ec89f017caa5152add5b0fa81d97b476fe461404aafad5e1dfL52 was removed? Any particular reason? |
…facebook#33156) Summary: Doing this patch level bump to ensure that all packages consuming `react-native` will get `7.0.3` and not lower 7.x versions. This is because this new patch contains this fix: react-native-community/cli#1560 (thanks NickGerleman & thymikee for your work!) We'll have to cherry-pick this into the 0.68 branch. While at it, I've also done a cheeky `npx yarn-deduplicate` to clean up the `yarn.lock` a bit. <!-- Help reviewers and the release process by writing your own changelog entry. For an example, see: https://github.com/facebook/react-native/wiki/Changelog --> [General] [Changed] - Bump RN CLI to v7.0.3 to address web debugging issue Pull Request resolved: facebook#33156 Test Plan: CI + some local testing via `test-manual-e2e`: <img width="1779" alt="Screenshot 2022-02-21 at 11 40 54" src="https://user-images.githubusercontent.com/16104054/154948695-8c40bb56-87eb-4326-a740-49930994c08b.png"> Reviewed By: cortinico Differential Revision: D34385503 Pulled By: motiz88 fbshipit-source-id: f0d8c4e0e92f83c0d819eeaa0fbec27820145968
Summary:
Metro 0.67 included facebook/metro@38a200e which changed the way external applications should interface with it to add new WebSocket endpoints. This materializes as failures when web debugging RN 0.68 apps.
This change applies the recommended fix, of passing a list of non-server endpoints to Metro when starting the server.
ws
is updated as part of the change, along with removing type-checker suppressions, of which one was resulting in a runtime error.Test Plan:
Tested web debugging after replacing the relevant CLI packages in
node_modules
, with the edited ones.