Skip to content

chore: dead-code sweep 2026-07-27 — drop unused export modifier on SubscribeSourceFactory - #155

Open
mbret wants to merge 1 commit into
mainfrom
chore/dead-code-sweep-2026-07-27
Open

chore: dead-code sweep 2026-07-27 — drop unused export modifier on SubscribeSourceFactory#155
mbret wants to merge 1 commit into
mainfrom
chore/dead-code-sweep-2026-07-27

Conversation

@mbret

@mbret mbret commented Jul 27, 2026

Copy link
Copy Markdown
Owner

Automated strict dead-code sweep (knip over library + dev entries, plus a production-entries-only pass, every candidate verified by repo-wide grep).

Removed

  • export modifier on SubscribeSourceFactory (src/lib/binding/useSubscribe/types.ts) — the type itself is live (used by SubscribeSource in the same file), but the export was dead surface. Evidence: repo-wide grep for SubscribeSourceFactory matches only its own declaration and the same-file SubscribeSource reference; src/lib/binding/useSubscribe/index.ts re-exports only ./useSubscribe, not ./types, so the type never reaches the package's public API via src/index.ts.

Candidates investigated and kept

  • src/lib/state/persistence/adapters/MockAdapter.ts — flagged unused in production-only analysis, but it is live test infrastructure imported by persistSignals.test.ts.
  • src/lib/utils/filterObjectByKey.ts — same situation: imported by useObserve.selector.test.tsx as a test helper.

No unused files, no unused package dependencies found. Public API exported through src/index.ts was treated as off-limits (published npm package).

Gates

Baseline on clean main and after the change, both fully green:

  • npm run check (biome) ✓
  • npm run build (tsc + vite) ✓
  • npm run test:ci — 23 files, 134 tests ✓

🤖 Generated with Claude Code

https://claude.ai/code/session_01R9ch8GmdfsE2RPy8adBGPo


Generated by Claude Code

The type is only referenced by SubscribeSource within the same file;
nothing imports it and the useSubscribe barrel does not re-export
types.ts, so the export was dead surface.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R9ch8GmdfsE2RPy8adBGPo

mbret commented Jul 27, 2026

Copy link
Copy Markdown
Owner Author

CI is red on Check, but the failure is a pre-existing flaky test, not this PR: useQuery$.test.tsx > should return consecutive results (the interval(5) variant at line 74) intermittently sees emissions 3 and 4 coalesce into a single render, so states[4] gets data: 4 instead of data: 3.

Evidence it's unrelated to this diff:

  • This PR only removes an export modifier on a type — erased at compile time, no runtime effect, and useQuery$ is untouched.
  • The failure reproduces on a clean origin/main checkout: 1 failure in 4 full-suite runs locally, with the identical assertion diff.
  • On this branch the suite passes most runs too (flaked 1 in 3 locally, and the pre-push run was green).

I've re-run the failed job; given the observed ~25–30% failure rate it should go green within a retry or two. The test's own comment ("interval big enough so react does not skip some render") hints at the hazard — it may be worth deflaking separately, but that's out of scope for a dead-code sweep.


Generated by Claude Code

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants