Build configuration and binary optimization #8322

Closed
opened 2026-02-16 18:09:41 -05:00 by yindo · 1 comment
Owner

Originally created by @randomm on GitHub (Feb 2, 2026).

Originally assigned to: @thdxr on GitHub.

Parent Epic

Part of #11762 (Ink-based TUI Rewrite)

Objective

Configure the build system for the Ink-based TUI, optimize bundle size, and create distribution binary.

Tasks

Build Configuration

  • Create/update src/cli/ink/index.tsx as entry point
  • Update script/build-lite.ts for Ink build (or create new script)
  • Configure TypeScript for JSX/TSX
  • Ensure React JSX transform is configured
  • Tree-shaking configuration for minimal bundle

Bundle Size Analysis

  • Measure baseline bundle size (before Ink)
  • Measure after adding Ink + React
  • Identify large dependencies
  • Consider dynamic imports for optional features

Binary Creation

  • Verify bun build --compile works with Ink
  • Test binary on clean system
  • Measure final binary size (target: < 15MB)

Configuration

// tsconfig additions for JSX
{
  "compilerOptions": {
    "jsx": "react-jsx",
    "jsxImportSource": "react"
  }
}

Build Script

// script/build-ink.ts
await Bun.build({
  entrypoints: ['./src/cli/ink/index.tsx'],
  outdir: './dist',
  target: 'bun',
  minify: true,
  // ...
})

Size Targets

Component Target Notes
Ink + React < 500KB After tree-shaking
Yoga (layout) ~200KB Core of Ink
Application code < 100KB Our components
Total bundle < 1MB Before Bun compile
Final binary < 15MB After Bun compile

Acceptance Criteria

  • Build completes without errors
  • Binary runs on target platforms
  • Binary size < 15MB
  • No runtime dependency issues
  • Build time reasonable (< 30s)

Estimated Effort

1 day

Risk

Medium - Bun compile with React/Ink may have quirks

Dependencies

  • #11763 (Setup Ink dependencies)
  • All component implementation complete
Originally created by @randomm on GitHub (Feb 2, 2026). Originally assigned to: @thdxr on GitHub. ## Parent Epic Part of #11762 (Ink-based TUI Rewrite) ## Objective Configure the build system for the Ink-based TUI, optimize bundle size, and create distribution binary. ## Tasks ### Build Configuration - [ ] Create/update `src/cli/ink/index.tsx` as entry point - [ ] Update `script/build-lite.ts` for Ink build (or create new script) - [ ] Configure TypeScript for JSX/TSX - [ ] Ensure React JSX transform is configured - [ ] Tree-shaking configuration for minimal bundle ### Bundle Size Analysis - [ ] Measure baseline bundle size (before Ink) - [ ] Measure after adding Ink + React - [ ] Identify large dependencies - [ ] Consider dynamic imports for optional features ### Binary Creation - [ ] Verify `bun build --compile` works with Ink - [ ] Test binary on clean system - [ ] Measure final binary size (target: < 15MB) ### Configuration ```typescript // tsconfig additions for JSX { "compilerOptions": { "jsx": "react-jsx", "jsxImportSource": "react" } } ``` ### Build Script ```typescript // script/build-ink.ts await Bun.build({ entrypoints: ['./src/cli/ink/index.tsx'], outdir: './dist', target: 'bun', minify: true, // ... }) ``` ## Size Targets | Component | Target | Notes | |-----------|--------|-------| | Ink + React | < 500KB | After tree-shaking | | Yoga (layout) | ~200KB | Core of Ink | | Application code | < 100KB | Our components | | **Total bundle** | < 1MB | Before Bun compile | | **Final binary** | < 15MB | After Bun compile | ## Acceptance Criteria - [ ] Build completes without errors - [ ] Binary runs on target platforms - [ ] Binary size < 15MB - [ ] No runtime dependency issues - [ ] Build time reasonable (< 30s) ## Estimated Effort 1 day ## Risk Medium - Bun compile with React/Ink may have quirks ## Dependencies - #11763 (Setup Ink dependencies) - All component implementation complete
yindo added the opentui label 2026-02-16 18:09:41 -05:00
yindo closed this issue 2026-02-16 18:09:41 -05:00
Author
Owner

@randomm commented on GitHub (Feb 3, 2026):

Reopening - Phase 1 & 2 components merged successfully. Proceeding with build optimization.

@randomm commented on GitHub (Feb 3, 2026): Reopening - Phase 1 & 2 components merged successfully. Proceeding with build optimization.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8322