| 847c099d | 15-Aug-2023 |
Cedric van Putten <[email protected]> |
fix(cli): avoid creating dev client urls containing `_` in protocol (#23519)
# Why
Fixes #23440
Unfortunately, due to Node's limitation in URL, we can't use `_` in
protocols. Even when we do
fix(cli): avoid creating dev client urls containing `_` in protocol (#23519)
# Why
Fixes #23440
Unfortunately, due to Node's limitation in URL, we can't use `_` in
protocols. Even when we do fix it, we run into URL parsing issues in
Expo Router (that's also using Node's URL). Instead, this change makes
protocols containing `_` fully invalid as any dev client URL.
# How
- Prohibited dev client URLs with `_` characters in the protocol
- This will trigger the
[`_resolveAlternativeLaunchUrl`](https://github.com/expo/expo/blob/main/packages/%40expo/cli/src/start/platforms/android/AndroidPlatformManager.ts#L48-L53)
on Android and create `com.example.some_package/.MainActivity` instead
# Test Plan
- `$ yarn create expo ./fix-23440 --template tabs@49`
- `$ cd ./fix-23440`
- Update `app.json` with `expo.android.package =
"com.example.protocol_underscore"`
- `$ yarn expo run:android`
- Should fall back to `com.example.protocol_underscore/.MainActivity`
URL and open the app properly
# Checklist
<!--
Please check the appropriate items below if they apply to your diff.
This is required for changes to Expo modules.
-->
- [x] 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).
show more ...
|