Page MenuHomePhabricator

[native] Patch @expo/cli to support debug-only scheme
ClosedPublic

Authored by bartek on Jan 21 2023, 9:30 AM.
Tags
None
Referenced Files
F3506993: D6328.diff
Fri, Dec 20, 6:55 PM
Unknown Object (File)
Nov 8 2024, 2:55 AM
Unknown Object (File)
Nov 8 2024, 2:55 AM
Unknown Object (File)
Nov 8 2024, 2:55 AM
Unknown Object (File)
Nov 8 2024, 2:55 AM
Unknown Object (File)
Nov 4 2024, 1:51 PM
Unknown Object (File)
Oct 31 2024, 7:26 PM
Unknown Object (File)
Oct 26 2024, 9:37 PM
Subscribers

Details

Summary

Following up https://phab.comm.dev/D6320#189520

Decided to patch Expo CLI, because:

  • this gives more flexibility - works in every scenario, no need to remember that some commands don't support --scheme flag (e.g. expo run)
  • restores behavior that Expo should have from the beginning.

This patch should be maintainable, I added comments to each patched snippet. If it ever fails, we can always fall back to using --scheme flag in yarn dev. I also linked the discussion in expo/expo repo that describes this patch in-depth.

Also, because now the URL under the QR code is a deep link, it became less readable, so the local dev IP is displayed explicitly in addition to the deep link:

Screenshot 2023-01-21 at 18.31.24.png (206×640 px, 68 KB)

Depends on D6319, D6320

Test Plan

Note: The EXPO_DEBUG=1 env var displays additional info, in some scenarios it gives more insight what's going on under the hood

Run EXPO_DEBUG=1 yarn dev.
You should see the following lines somewhere at the beginning:

expo:utils:scheme ios application Info.plist path: Comm/Info.debug.plist +0ms
expo:utils:scheme ios application schemes: [ 'comm' ] +4ms
expo:utils:scheme android application schemes: [ 'comm' ] +18ms

Additional things that can be checked:

  • Both URLs should be displayed under the QR code
  • When app is built on this branch, the QR code should be scannable (this one applies more to parent diffs' test plan, though)

Diff Detail

Repository
rCOMM Comm
Branch
barthap/uri-scheme
Lint
No Lint Coverage
Unit
No Test Coverage