From 7a8cda542c894ed07481af5539671ae6405050af Mon Sep 17 00:00:00 2001 From: Alex-Gilbert Date: Tue, 17 Feb 2026 08:18:35 -0600 Subject: [PATCH] docs: add frontend modularization design Split app.js into ES modules with JSDoc types, no build step. Co-Authored-By: Claude Opus 4.6 --- ...26-02-17-frontend-modularization-design.md | 132 ++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 docs/plans/2026-02-17-frontend-modularization-design.md diff --git a/docs/plans/2026-02-17-frontend-modularization-design.md b/docs/plans/2026-02-17-frontend-modularization-design.md new file mode 100644 index 0000000..7489b79 --- /dev/null +++ b/docs/plans/2026-02-17-frontend-modularization-design.md @@ -0,0 +1,132 @@ +# Frontend Modularization Design + +## Problem + +The frontend is a single 1,436-line `app.js` file handling state, canvas rendering, zoom/pan, SSE streaming, solver control, associate matching, and UI interactions. As the project grows and attracts contributors, this monolith becomes hard to navigate, refactor, and reason about — both for humans and code agents. + +## Approach + +Split `app.js` into ES modules with JSDoc type annotations. No build step — browsers natively support ` + + + +``` + +## Backend Changes + +None. FastAPI's `StaticFiles` mount serves all `.js` files. ES module imports resolve via HTTP requests automatically. + +## Verification + +- All existing functionality works identically after the split +- No new dependencies, no `package.json`, no `node_modules` +- VS Code shows type errors via `@ts-check` without any build command