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

Use websocket /message endpoint to deliver reload request #667

Merged
merged 3 commits into from
Oct 30, 2024

Conversation

kmagiera
Copy link
Member

In Expo 52, the metro /reload endpoint has been moved to a new location. As a consequence we couldn't perform JS reloads which resulted in the app being stuck in "reloading" state.

This PR updates the way we trigger reload action. A while ago, we switched the mechanism for triggering devMenu to use /message endpoint. This endpoint is also capable of handling reload command. Here, we are swapping out the reload implementation to use the /message websocket endpoint to deliver it. This method is more portable and work across older version while also being supported by expo SDK 52 (given expo/expo#32399 is published)

Fixes #664

How Has This Been Tested:

  1. Use reloads and dev menu across different projects, specifically older ones like RN 73, expo-go and on Expo 52 (not yet added here as test project)

Copy link

vercel bot commented Oct 28, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
radon-ide ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 29, 2024 9:16pm

Copy link
Collaborator

@filip131311 filip131311 left a comment

Choose a reason for hiding this comment

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

I tested expo-go and RN76 apps and it worked well, but after installing the newest expo template app with npx create-expo-app --template default@beta reloading app caused problems:

Screen.Recording.2024-10-29.at.19.33.57.mov

Also left some inline comments

packages/vscode-extension/src/project/metro.ts Outdated Show resolved Hide resolved
packages/vscode-extension/src/project/metro.ts Outdated Show resolved Hide resolved
kmagiera and others added 2 commits October 29, 2024 22:15
Co-authored-by: filip131311 <159789821+filip131311@users.noreply.github.com>
Co-authored-by: filip131311 <159789821+filip131311@users.noreply.github.com>
Copy link
Collaborator

@filip131311 filip131311 left a comment

Choose a reason for hiding this comment

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

It seems that problems are not related to this PR and Expo 52 template app works on IOS.

@kmagiera kmagiera merged commit d3a3417 into main Oct 30, 2024
4 checks passed
@kmagiera kmagiera deleted the kmagiera/fix-expo52-reload branch October 30, 2024 06:21
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.

Reloads are broken on Expo 52-beta app
2 participants