Skip to content

feat: embed WebUI in binary with proxy flags#19299

Merged
thdxr merged 3 commits intodevfrom
feat/embdeded-webui
Mar 26, 2026
Merged

feat: embed WebUI in binary with proxy flags#19299
thdxr merged 3 commits intodevfrom
feat/embdeded-webui

Conversation

@thdxr
Copy link
Copy Markdown
Member

@thdxr thdxr commented Mar 26, 2026

Summary

This PR embeds the WebUI directly into the binary and adds flags to control proxy behavior.

Changes

  • Embed WebUI in the application binary
  • Add flags to configure proxy usage for the embedded UI
  • Clean up related configuration handling

Commits

  • e6ced51 feat(app): embed web ui in binary with flags to use proxy
  • 65c92b1 chore: some cleanups

Copy link
Copy Markdown

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@thdxr thdxr enabled auto-merge (squash) March 26, 2026 14:40
@thdxr thdxr merged commit ec20efc into dev Mar 26, 2026
11 checks passed
@thdxr thdxr deleted the feat/embdeded-webui branch March 26, 2026 14:43
BYK added a commit to BYK/opencode that referenced this pull request Mar 26, 2026
Build on anomalyco#19299 by @thdxr with several production hardening improvements:

- Filter optional fonts during embedding (~27MB savings) — only core fonts
  (Inter + IBM Plex Mono) are embedded, the rest fall through to CDN proxy
- Add pre-bootstrap static middleware before Instance.provide() to avoid
  DB migration checks on every asset request
- Add SPA fallback routing — return index.html for page routes but not for
  asset requests (which fall through to CDN proxy for excluded fonts)
- Add OPENCODE_APP_DIR env var for dev override
- Auto-detect packages/app/dist in monorepo dev mode
- Use explicit MIME type map instead of Bun.file().type for consistent typing
- CDN proxy fallback for any asset not found locally
BYK added a commit to BYK/opencode that referenced this pull request Mar 26, 2026
Build on anomalyco#19299 by @thdxr with several production hardening improvements:

- Filter optional fonts during embedding (~27MB savings) — only core fonts
  (Inter + IBM Plex Mono) are embedded, the rest fall through to CDN proxy
- Add pre-bootstrap static middleware before Instance.provide() to avoid
  DB migration checks on every asset request
- Add SPA fallback routing — return index.html for page routes but not for
  asset requests (which fall through to CDN proxy for excluded fonts)
- Add OPENCODE_APP_DIR env var for dev override
- Auto-detect packages/app/dist in monorepo dev mode
- Use explicit MIME type map instead of Bun.file().type for consistent typing
- CDN proxy fallback for any asset not found locally
@stenci
Copy link
Copy Markdown

stenci commented Mar 26, 2026

This appears to have introduced a Windows regression in desktop dev startup.

Tracked in: #19332
Fix in: #19333

The generated opencode-web-ui.gen.ts used Windows backslashes in generated string literals, which caused Bun to fail parsing the file on Windows.

Andres77872 pushed a commit to Andres77872/opencode that referenced this pull request Mar 26, 2026
BYK added a commit to BYK/opencode that referenced this pull request Mar 27, 2026
Build on anomalyco#19299 by @thdxr with several production hardening improvements:

- Filter optional fonts during embedding (~27MB savings) — only core fonts
  (Inter + IBM Plex Mono) are embedded, the rest fall through to CDN proxy
- Add pre-bootstrap static middleware before Instance.provide() to avoid
  DB migration checks on every asset request
- Add SPA fallback routing — return index.html for page routes but not for
  asset requests (which fall through to CDN proxy for excluded fonts)
- Add OPENCODE_APP_DIR env var for dev override
- Auto-detect packages/app/dist in monorepo dev mode
- Use explicit MIME type map instead of Bun.file().type for consistent typing
- CDN proxy fallback for any asset not found locally
uve pushed a commit to uve/opencode that referenced this pull request Mar 28, 2026
BYK added a commit to BYK/opencode that referenced this pull request Mar 29, 2026
Build on anomalyco#19299 by @thdxr with production hardening for the new
server architecture (anomalyco#19335):

- Add pre-bootstrap static middleware in server.ts before
  WorkspaceRouterMiddleware to avoid Instance.provide() + DB migration
  checks on every CSS/JS/image/font request
- Add SPA fallback routing — page routes (no extension) get index.html,
  asset requests (.js, .woff2) fall through to CDN proxy
- Add OPENCODE_APP_DIR env var for explicit dev override
- Auto-detect packages/app/dist in monorepo dev mode
- Use explicit MIME type map for consistent content-type headers
- CDN proxy fallback for assets not found locally/embedded
BYK added a commit to BYK/opencode that referenced this pull request Mar 29, 2026
Build on anomalyco#19299 by @thdxr with production hardening for the new
server architecture (anomalyco#19335):

- Add pre-bootstrap static middleware in server.ts before
  WorkspaceRouterMiddleware to avoid Instance.provide() + DB migration
  checks on every CSS/JS/image/font request
- Add SPA fallback routing — page routes (no extension) get index.html,
  asset requests (.js, .woff2) fall through to CDN proxy
- Add OPENCODE_APP_DIR env var for explicit dev override
- Auto-detect packages/app/dist in monorepo dev mode
- Use explicit MIME type map for consistent content-type headers
- CDN proxy fallback for assets not found locally/embedded
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants