Add devtool support for self-hosted - #2888
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe devtool now accepts a configurable dashboard URI. Generated self-hosted Init projects receive this URI, while admin, Expo, and Python configurations retain their existing injection behavior. Documentation and self-hosted routing now cover dashboard-specific devtool paths. ChangesSelf-hosted dashboard support
Estimated code review effort: 3 (Moderate) | ~25 minutes Merge Risk: 🔵 Low · up to The PR lets self-hosted projects point the embedded devtool at a configured dashboard URL, including carrying the application ID to that destination. Existing browser isolation limits the impact, but the destination is not restricted to trusted HTTP(S) dashboard origins, so the change is mergeable with explicit owner awareness of that trust boundary. Sequence Diagram(s)sequenceDiagram
participant CreateInstantApp
participant GeneratedInit
participant GetDevtoolSrc
participant SelfHostedDashboard
CreateInstantApp->>GeneratedInit: write devtool.dashURI
GeneratedInit->>GetDevtoolSrc: pass appId and devtool config
GetDevtoolSrc->>SelfHostedDashboard: construct /_devtool/appId URL
SelfHostedDashboard-->>GeneratedInit: serve the devtool iframe
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 7 files. (4 skipped: 4 unsupported.)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
View Vercel preview at instant-www-js-self-host-devtool-jsv.vercel.app. |
| npx instant-cli@latest login | ||
| ``` | ||
|
|
||
| After authenticating, you can use the auth token associated with your self-hosted |
There was a problem hiding this comment.
Simplified documentation here. You will most likely want to supply both INSTANT_CLI_API_URI and INSTANT_CLI_DASH_URI when using create-instant-app with self-hosted. So we should just talk about that
Got a report that devtool doesn't play nice with self-hosted Instant. This PR makes it so!
We introduce an optional
dashURIto the existingdevtoolconfig. When this is set we'll connect the devtool to the provided dash url instead of localhost or production instant.Updated
create-instant-appto inject this config too when invoked withINSTANT_CLI_DASH_URIso you don't need to manually editiniteach time you create an app.