Repository navigation
fix(ci): model every Solid lazy named-export loader in the UI for Knip - #204389
Conversation
Co-authored-by: obviyus <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR extends Knip’s existing consumer model to discover Solid named-export lazy loaders throughout UI TypeScript sources. Example: The chat bubble lazily loads RecordingApiKeyNotice from chat-read-aloud-status.tsx.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR provides a focused repair for a real dependency-audit false positive; no actionable patch defects were found, but the failing required lint check remains unattributed. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherKnip’s custom compiler reads UI loader source and supplies synthetic named imports to the repository’s dependency and unused-export audits. flowchart LR
A[UI source files] --> B[Existing consumer compiler]
B --> C[Derived named imports]
C --> D[Knip analysis]
D --> E[Deadcode reports]
E --> F[Dependency CI gate]
Technical reviewBest possible solution: Keep the generalized source-derived edges in the existing compiler and land after the required CI failure is resolved or established as inherited. Do we have a high-confidence way to reproduce the issue? Current-main source establishes the missing consumer edge, and the body supplies the precise Knip diagnostic; no target code was executed during this read-only review. Is this the best way to solve the issue? This is a small, complete repair in the existing consumer owner: it generalizes discovery without adding ignore entries, runtime imports, registrations, or another implementation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0956e14e6814. Provenance checked
TestingProof path: unit tests only. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests +27, Other +9. Total +36 across 2 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 23, 2026, 11:47 PM ET / November 24, 2026, 04:47 UTC. |
|
Maintainer override: the one red check on 77b6480 is not caused by this change.
|
openclaw#204389) ## Result The `check-dependencies` job on `main` passes again. It has been red since openclaw#204200 (first red: scheduled run 45319833099 on 1461dee). Knip reported a false unused export: ``` Unused exports are not allowed: ui/src/pages/chat/components/chat-read-aloud-status.tsx: RecordingApiKeyNotice ``` ## Cause `RecordingApiKeyNotice` has one real production consumer: `chat-message-bubble-view.tsx` loads it with `lazy(() => import("./chat-read-aloud-status.tsx"), { export: "RecordingApiKeyNotice" })`. Solid selects the export by a string, which Knip cannot see. `config/knip-vite-consumers.mjs` modeled that pattern for exactly one hard-coded loader (`settings-sidebar-lazy.tsx`). Every other lazy named-export loader either had an ignore entry or broke the gate, as this one did. ## Change The consumer model now derives a named import edge from every non-test UI source file that contains a `lazy(() => import("…"), { export: "…" })` loader. A new loader needs no registration, and deleting a loader still removes its edge, so a truly unused export is still reported. ## Evidence - `check-deadcode-exports.test.ts`: 36 passed. The updated case (two loaders in different directories, test files excluded, deleted loader dropped) fails on `main`. - `pnpm deadcode:report` on this head: script, production and full-tree Knip reports all pass. On `main`, the production and full-tree reports fail with the error above. Co-authored-by: Ayaan Zaidi <[email protected]>
Result
The
check-dependenciesjob onmainpasses again. It has been red since #204200 (first red: scheduled run 45319833099 on a21974c). Knip reported a false unused export:Cause
RecordingApiKeyNoticehas one real production consumer:chat-message-bubble-view.tsxloads it withlazy(() => import("./chat-read-aloud-status.tsx"), { export: "RecordingApiKeyNotice" }). Solid selects the export by a string, which Knip cannot see.config/knip-vite-consumers.mjsmodeled that pattern for exactly one hard-coded loader (settings-sidebar-lazy.tsx). Every other lazy named-export loader either had an ignore entry or broke the gate, as this one did.Change
The consumer model now derives a named import edge from every non-test UI source file that contains a
lazy(() => import("…"), { export: "…" })loader. A new loader needs no registration, and deleting a loader still removes its edge, so a truly unused export is still reported.Evidence
check-deadcode-exports.test.ts: 36 passed. The updated case (two loaders in different directories, test files excluded, deleted loader dropped) fails onmain.pnpm deadcode:reporton this head: script, production and full-tree Knip reports all pass. Onmain, the production and full-tree reports fail with the error above.