-
Notifications
You must be signed in to change notification settings - Fork 13k
chore: Invert store/collection injection #37412
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
It allows to have stores that follow a common interface for both Minimongo collections and cached stores, making it easier to switch between them.
|
Looks like this PR is ready to merge! 🎉 |
|
WalkthroughThe changes refactor the store and collection injection pattern across the caching system. CachedStore's watchReady method is removed in favor of reactive watch-based readiness checking. MinimongoCollection is converted to accept injected stores via constructor parameters. DocumentMapStore is introduced with a typed interface for invalidation callbacks, and Users store is updated to use DocumentMapStore instead of Minimongo. Changes
Sequence DiagramsequenceDiagram
participant App as Application
participant Users as Users Store
participant DMS as DocumentMapStore
participant MC as MinimongoCollection
participant MM as Meteor.users
App->>Users: Initialize Users.create()
Users->>DMS: createDocumentMapStore(hooks)
DMS->>Users: Return store with use + hooks
Users->>MC: new MinimongoCollection(Users.use)
MC-->>Users: Initialized with injected store
rect rgb(200, 220, 255)
Note over DMS,MC: Invalidation Flow
DMS->>Users: onInvalidate(docs)
Users->>MC: scheduleRecomputationsFor(docs)
MC-->>MM: Updated collection
end
rect rgb(220, 200, 255)
Note over DMS,MC: Full Invalidation Flow
DMS->>Users: onInvalidateAll()
Users->>MC: recomputeAll()
MC-->>MM: Full refresh
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (6)
💤 Files with no reviewable changes (1)
🧰 Additional context used🧠 Learnings (4)📓 Common learnings📚 Learning: 2025-11-05T20:53:57.761ZApplied to files:
📚 Learning: 2025-09-25T09:59:26.461ZApplied to files:
📚 Learning: 2025-09-25T09:59:26.461ZApplied to files:
🧬 Code graph analysis (4)apps/meteor/client/meteor/overrides/userAndUsers.ts (4)
apps/meteor/client/meteor/minimongo/MinimongoCollection.ts (1)
apps/meteor/app/authorization/client/hasPermission.ts (2)
apps/meteor/client/stores/Users.ts (2)
🔇 Additional comments (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #37412 +/- ##
===========================================
- Coverage 68.13% 68.09% -0.04%
===========================================
Files 3364 3364
Lines 115814 115749 -65
Branches 20909 20904 -5
===========================================
- Hits 78909 78824 -85
- Misses 34213 34232 +19
- Partials 2692 2693 +1 🚀 New features to boost your workflow:
|
Proposed changes (including videos or screenshots)
It allows to have stores that follow a common interface for both Minimongo collections and cached stores, making it easier to switch between them.
Issue(s)
ARCH-1867
Steps to test or reproduce
Further comments
Summary by CodeRabbit
Release Notes