Skip to content

fix: break circular dependency via dispatch registry#20

Merged
flyon merged 2 commits intodevfrom
flyon/fix-circular-deps
Mar 4, 2026
Merged

fix: break circular dependency via dispatch registry#20
flyon merged 2 commits intodevfrom
flyon/fix-circular-deps

Conversation

@flyon
Copy link
Member

@flyon flyon commented Mar 4, 2026

Summary

  • Breaks the circular import Shape → QueryParser → LinkedStorage → Shape by introducing a leaf dispatch module (queryDispatch.ts)
  • Shape and SelectQuery call getQueryDispatch() to execute queries; LinkedStorage registers itself as the dispatch provider in setDefaultStore()
  • Removes QueryParser entirely (was a 79-line pass-through with no logic)
  • LinkedStorage no longer imports Shape — uses Function prototype-chain walking for store resolution

Test plan

  • tsc --noEmit passes
  • All 18 test suites pass (477 tests green)
  • Zero circular imports between Shape, LinkedStorage, and query modules
  • Store routing tests verify prototype-chain walk terminates correctly

🤖 Generated with Claude Code

Introduce a dispatch registry (`queryDispatch.ts`) as a leaf module that
both Shape and LinkedStorage import without importing each other. Remove
QueryParser (was a pass-through with no logic). LinkedStorage registers
as the dispatch provider in `setDefaultStore()`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

⚠️ No changeset found. If this PR should trigger a release, run npx changeset and commit the generated file.

If this change doesn't need a release (docs, CI config, etc.), you can ignore this message.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@flyon flyon force-pushed the flyon/fix-circular-deps branch from 5ffbde4 to 33e9fb0 Compare March 4, 2026 04:03
@flyon flyon changed the base branch from main to dev March 4, 2026 06:12
@flyon flyon merged commit 47263f9 into dev Mar 4, 2026
3 checks passed
@flyon flyon deleted the flyon/fix-circular-deps branch March 4, 2026 06:13
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.

1 participant