Skip to content

Add devtool support for self-hosted - #2888

Merged
nezaj merged 2 commits into
mainfrom
self-host-devtool
Aug 31, 2026
Merged

Add devtool support for self-hosted#2888
nezaj merged 2 commits into
mainfrom
self-host-devtool

Conversation

@nezaj

@nezaj nezaj commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Got a report that devtool doesn't play nice with self-hosted Instant. This PR makes it so!

We introduce an optional dashURI to the existing devtool config. When this is set we'll connect the devtool to the provided dash url instead of localhost or production instant.

Updated create-instant-app to inject this config too when invoked with INSTANT_CLI_DASH_URI so you don't need to manually edit init each time you create an app.

@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 62b8b1ad-55e0-42f0-a0be-13787fa56e08

📥 Commits

Reviewing files that changed from the base of the PR and between fc94034 and 2a2a1f3.

📒 Files selected for processing (1)
  • client/packages/version/src/version.ts

📝 Walkthrough

Walkthrough

The 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.

Changes

Self-hosted dashboard support

Layer / File(s) Summary
Configurable devtool URL
client/packages/core/src/coreTypes.ts, client/packages/core/src/devtool.ts, client/packages/core/__tests__/src/devtool.test.ts
DevtoolConfig and StrictDevtoolConfig support dashURI. getDevtoolSrc builds the dashboard devtool URL and uses the configured URI when present. Tests cover default and configured URLs.
Generated backend configuration
client/packages/create-instant-app/src/projectBase.ts, client/packages/create-instant-app/src/backendConfig.ts, client/packages/create-instant-app/src/backendConfig.test.ts
Generated Init projects can inject devtool.dashURI. Admin and Expo configurations disable injection, and tests validate client and admin output.
Self-hosted documentation and routing
client/www/app/docs/devtool/page.md, client/www/app/docs/init/page.md, client/www/app/docs/self-hosting/..., client/www/next.config.js
Documentation describes dashboard URI configuration. Self-hosted routing excludes _devtool paths from the catch-all dashboard redirect.
Package version update
client/packages/version/src/version.ts
The shared package version changes from v1.0.66 to v1.0.67.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Merge Risk: 🔵 Low · up to fc940

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
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning 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 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding devtool support for self-hosted deployments.
Description check ✅ Passed The description directly explains the new dashURI configuration and create-instant-app support for self-hosted dashboards.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

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.)

  • Fix all pre-merge checks with AI

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@dwwoelfel dwwoelfel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@github-actions

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@nezaj
nezaj merged commit 6f6b56a into main Aug 31, 2026
23 of 24 checks passed
@nezaj
nezaj deleted the self-host-devtool branch August 31, 2026 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants