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

fix(cli): only show web ready in expo start when enabled #26694

Merged
merged 2 commits into from Jan 25, 2024

Conversation

byCedric
Copy link
Member

Why

Fixes #26519

With Metro being the default (web) bundler, the "Web is waiting on ..." message incorrectly popped up (before web dependencies are installed, and opt-in through expo.platforms: [..., 'web'].

When opening the link, without actually enabling web support, users received the Expo Go manifest.

How

  • Check if platform web is explicitly enabled in DevServerManagerActions (by checking this.options.platforms?.includes('web')

Test Plan

  • $ bun create expo ./test --template blank@50
  • $ cd ./test
  • $ expod start
Before after
before after
  • Press w

Should see:
image

  • $ bun expo install react-native-web react-dom @expo/metro-runtime
  • $ expod start
  • This should now show "Web is waiting on ..."

Checklist

@expo-bot expo-bot added the bot: suggestions ExpoBot has some suggestions label Jan 25, 2024
@expo-bot expo-bot added bot: passed checks ExpoBot has nothing to complain about and removed bot: suggestions ExpoBot has some suggestions labels Jan 25, 2024
@byCedric byCedric merged commit 79d3d42 into main Jan 25, 2024
6 checks passed
@byCedric byCedric deleted the @bycedric/cli/show-web-ready-when-enabled branch January 25, 2024 17:35
byCedric added a commit that referenced this pull request Jan 25, 2024
# Why

Fixes #26519

With Metro being the default (web) bundler, the "Web is waiting on ..."
message incorrectly popped up (before web dependencies are installed,
and opt-in through `expo.platforms: [..., 'web']`.

When opening the link, without actually enabling web support, users
received the Expo Go manifest.

# How

- Check if platform web is explicitly enabled in
`DevServerManagerActions` (by checking
`this.options.platforms?.includes('web')`

# Test Plan

- `$ bun create expo ./test --template blank@50`
- `$ cd ./test`
- `$ expod start`

Before | after
--- | ---

![before](https://github.com/expo/expo/assets/1203991/5338589b-d81a-4160-bb20-40ab7244f24c)
|
![after](https://github.com/expo/expo/assets/1203991/06f5a204-10fc-4217-9550-2b157190faa3)

- Press <kbd>w</kbd>

Should see: 
<img width="860" alt="image"
src="https://github.com/expo/expo/assets/1203991/ce01bda2-703b-4a0c-bcdf-487a1bce1817">

- `$ bun expo install react-native-web react-dom @expo/metro-runtime`
- `$ expod start`
- This should now show "Web is waiting on ..."


# Checklist

<!--
Please check the appropriate items below if they apply to your diff.
This is required for changes to Expo modules.
-->

- [ ] Documentation is up to date to reflect these changes (eg:
https://docs.expo.dev and README.md).
- [ ] Conforms with the [Documentation Writing Style
Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)
- [ ] This diff will work correctly for `npx expo prebuild` & EAS Build
(eg: updated a module plugin).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: fingerprint compatible bot: passed checks ExpoBot has nothing to complain about
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[SDK 50] Newly created app shows "Web is waiting on http://localhost:8081", but that returns JSON
2 participants