Conversation
#45804) # Why The dev server resolves deep links for `expo start` interactively via the terminal (`i`/`a` keystrokes) and the `/_expo/link` disambiguation page used by QR codes. There is no programmatic surface for external tooling (preview systems, IDE integrations, distributed dev environments) to ask the running dev server "what URL should I use to open this project on iOS/Android/web?" without scraping the disambiguation HTML. This adds a documented `/_expo/open` endpoint that returns structured info about how to open the project, mirroring the CLI's existing resolution behavior. # How - New `OpenMiddleware` registered at `/_expo/open` supporting `GET` (discovery / per-platform info) and `POST` (action — actually opens the project). - New `createOpenMiddlewareOptions` factory that wires the middleware to the same runtime resolution and platform-launch logic used by the keyboard shortcuts. - Per-platform responses include `runtime` (`expo` | `custom` | `web`, omitted when disambiguation is required), `url`, and `appId` (bundle identifier / package name) so callers can check install state before deep linking. - `runtime` request parameter accepts `default` (mirrors `i`/`a`), `expo` / `custom` (force a direct link), and `unknown` (force the disambiguation page). - Response cache disabled; no host machine info leaked in responses. # Test Plan - Unit tests for the middleware and option factory covering discovery, per-platform GET, POST actions, runtime disambiguation, missing scheme, missing app ID, and the `unknown` runtime override (~736 lines of new tests). - `yarn lint`, `yarn tsc --noEmit`, and `yarn prepare` all clean in `packages/@expo/cli`. --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )