Skip to content

Phase 0 — Modularize the renderer #15

Description

@ozgesolidkey

Part of #14. Ref: docs/ARCHITECTURE_V2.md §6.

Carve src/renderer/renderer.ts (~7000 lines) into ES modules by feature, behavior-preserving. This is the gating step — features can't be extracted until the monolith has seams.

Tasks

  • Add a renderer bundler (esbuild) so the renderer can use import/export while still loading as one renderer.js; keep tsc --noEmit for typechecking; main/preload stay CommonJS.
  • Verify the bundled renderer is behavior-identical (build + 340 tests green + app smoke-test).
  • Extract shared primitives into modules: state, elements, dom utils (escapeHtml, showToast), navigation (goToLine/jumpToTrendLine).
  • Vertical-slice proof: extract the Investigate feature into its own module importing the shared primitives.
  • Carve remaining features into modules incrementally (viewer, search, filter, analysis, trends, live, bookmarks, highlights, annotations, baselines, notes…).

Done when: renderer is a thin shell wiring feature modules; no single file > ~1500 lines; tests green.

Risk: low–medium (mechanical). Do NOT start L2/L3 extraction (other phases) before this lands.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions