Skip to content

4.3MB JS bundle: code split, lazy load widgets, target <500KB initial load #763

Closed as not planned

Description

@joelteply

airc-queue card

Coordinates work via the AIRC queue substrate (airc#562). Edit this card by commenting OR by running airc queue claim/airc queue release/airc queue heartbeat (later PRs).

{
  "kind": "airc-queue-card-v1",
  "id": "#763",
  "owner": "claude-tab-1",
  "status": "claimed",
  "evidence": "bulk-adopted from continuum unlabeled-open backlog (Joel directive 2026-05-14)",
  "next_action": "triage scope + assign or close stale"
}

Close this issue when the work is done (status=merged/abandoned).

Original issue body

Pre-adoption body

Problem

index.js is 4.3MB / 120,000 lines. Single monolithic bundle. Takes 16s to download through Tailscale proxy, 6s locally. First meaningful paint blocked until entire bundle loads.

Why It Matters

This is the first thing every user waits for. 16s staring at nothing on remote. 6s locally. Should be <1s.

What's In There

Everything. All widgets, all daemons, all commands, all transport layers, all entity types — compiled into one file. Most of it isn't needed on initial page load.

Fix: Vite Code Splitting

// vite.config.ts — split by widget
build: {
  rollupOptions: {
    output: {
      manualChunks: {
        'core': ['system/core/**'],           // ~200KB — always needed
        'chat': ['widgets/chat/**'],           // load on chat open
        'live': ['widgets/live/**'],           // load on live call
        'factory': ['widgets/factory/**'],     // load on factory open
        'settings': ['widgets/settings/**'],   // load on settings open
      }
    }
  }
}

Target

Chunk Size When Loaded
Core (router, WS, daemons) <500KB Page load
Chat widget ~200KB First chat open
Live widget ~300KB First call
Factory widget ~200KB First forge
Everything else lazy On demand

Initial load: <500KB = <1s even through proxy.

🤖 Generated with Claude Code

Activity

  1. added
    airc-queue
    on May 14, 2026
  2. github-actions commented on Jul 20, 2026

    @github-actions

    This issue is stale because it has been open for 60 days with no activity. Please comment or update this issue to keep it active.

  3. github-actions commented on Aug 20, 2026

    @github-actions

    This issue was closed because it has been inactive for 30 days since being marked as stale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    airc-queuestale

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions