You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Replace reactfire with custom hooks and upgrade firebase SDK 9 -> 12 #191
reactfire 4.2.x is dead (last publish Aug 2023) and pins firebase to ^9 — it is the blocker for upgrading the client Firebase SDK (currently 9.23) to 12.x. Both changes touch every data callsite, so they should land together.
There is also a React correctness bug in src/pages/MindMap/index.tsx to fix in the same pass: useState(rootNode) is called after two conditional throw statements (rules-of-hooks violation), and mindmap.nodes is dereferenced before the if (!mindmap) throw guard, so a missing/denied doc dies with a raw TypeError instead of the intended error message.
Proposed approach
Replace reactfire with 3–4 small custom hooks over the modular SDK (onSnapshot, onAuthStateChanged). Do not swap for react-firebase-hooks (even less maintained).
Bump firebase 9 -> 12 in the same PR, since the callsites are already being rewritten.
Fix the hooks-order bug and the pre-guard dereference in src/pages/MindMap/index.tsx while touching the file.
While in App.tsx, delete the unused Storage init (no emulator/rules/usage) and the unused Remote Config init (remoteconfig.template.json is {}).
Verify auth flows (Google, password, anonymous) and Firestore sync against emulators.
Acceptance criteria
reactfire removed from package.json; firebase at 12.x
Auth + Firestore live sync work against emulators and prod config
No rules-of-hooks lint errors in src/pages/MindMap/index.tsx; missing/denied doc shows the intended error
Unused Storage and Remote Config init removed
References
ROADMAP.md sections 3 (dependency table: reactfire, firebase rows; App.tsx dead weight) and 8 (hooks bug).
Landed on the revival branch (PR #199), commit d0597dd.
reactfire is gone, replaced by src/firebase/index.tsx: module-level singleton SDK init (app → App Check → auth/firestore/functions, emulator wiring) plus the hooks the app actually uses — useAuth/useFirestore/useFunctions, useUser/useSigninCheck (one app-wide onIdTokenChanged subscription behind FirebaseUserProvider), and useFirestoreDocData/useFirestoreCollection/useFirestoreCollectionData (onSnapshot, { status, data } shape, queryEqual-stable resubscription).
Also in this pass, per the issue scope: firebase 9 → 12, @firebase/rules-unit-testing 2 → 5, the unused Storage/Remote Config inits deleted (plus remoteconfig.template.json), and the MindMap rules-of-hooks bug fixed by splitting the component into loader + LoadedMindMap — missing/denied docs now surface the friendly error instead of a raw TypeError.
All 41 emulator tests, tsc, eslint, and the prod build are green. Closing when PR #199 merges.
Activity
Fix Firestore rules privilege escalation; add rules unit tests (#188)
Replace reactfire with custom firebase hooks; firebase 12 (#191)
Roadmap: record Wave 3 completion (#191 reactfire removal, #193 MUI 9…
epodol commentedon Jul 7, 2026
Landed on the
revivalbranch (PR #199), commit d0597dd.reactfire is gone, replaced by
src/firebase/index.tsx: module-level singleton SDK init (app → App Check → auth/firestore/functions, emulator wiring) plus the hooks the app actually uses —useAuth/useFirestore/useFunctions,useUser/useSigninCheck(one app-wideonIdTokenChangedsubscription behindFirebaseUserProvider), anduseFirestoreDocData/useFirestoreCollection/useFirestoreCollectionData(onSnapshot,{ status, data }shape,queryEqual-stable resubscription).Also in this pass, per the issue scope: firebase 9 → 12,
@firebase/rules-unit-testing2 → 5, the unused Storage/Remote Config inits deleted (plusremoteconfig.template.json), and the MindMap rules-of-hooks bug fixed by splitting the component into loader +LoadedMindMap— missing/denied docs now surface the friendly error instead of a raw TypeError.All 41 emulator tests, tsc, eslint, and the prod build are green. Closing when PR #199 merges.