chore: migrate from Firebase v9 compat to v12 modular API#56
Open
chore: migrate from Firebase v9 compat to v12 modular API#56
Conversation
Replace deprecated firebase/compat/* imports with modular API equivalents from firebase/app, firebase/database, and firebase/auth. This enables proper tree-shaking and keeps the library on supported Firebase APIs. - Bump firebase to ^12.0.0 in package.json and demo/package.json - Update tsconfig target to ES2020 for Firebase v12 compatibility - Delete firebase-init.ts compat singleton wrapper - Rewrite database.ts, document.ts, collection.ts to modular imports - Fix collection.ts bug: limitToFirst variable reference → props.limitToFirst - Change signOut from static to instance method (requires Auth instance) - Add firebase/auth to rollup and build.js externals - Update CI workflows to Node.js 20 and actions v4 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…n declaration Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR migrates the firebase-react-store library from Firebase v9 compat API to v12 modular API, addressing deprecated API usage and enabling proper tree-shaking. The migration includes comprehensive updates to imports, API calls, and infrastructure configurations while fixing a bug in the collection observer component.
Changes:
- Migrated all Firebase imports from
firebase/compat/*to modular equivalents (firebase/app,firebase/database,firebase/auth) - Fixed bug where
limitToFirstconstraint incorrectly referenced an undefined local variable instead ofprops.limitToFirst - Updated infrastructure: TypeScript target to ES2020, Node.js to v20, GitHub Actions to v4, and Firebase dependency to v12
Reviewed changes
Copilot reviewed 12 out of 29 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tsconfig.json | Updated TypeScript compilation target from ES2015 to ES2020 for Firebase v12 compatibility |
| src/firebase-init.ts | Deleted compat singleton wrapper (no longer needed with modular API) |
| src/document.ts | Migrated to modular database API imports, updated listener management with unsubscribe pattern |
| src/database.ts | Migrated to modular app/database/auth APIs, changed signOut from static to instance method |
| src/collection.ts | Migrated to modular query APIs, fixed limitToFirst bug, improved subscription cleanup |
| scripts/build.js | Added firebase/auth to external dependencies |
| rollup.config.js | Added firebase/auth to external dependencies |
| package.json | Bumped version to 0.4.0 and firebase dependency to ^12.0.0 |
| demo/package.json | Updated firebase dependency to ^12.0.0 |
| dist/*.d.ts | Updated type definitions to reflect modular API changes |
| dist/*.js | Regenerated distribution files with modular API |
| CHANGELOG.md | Documented breaking changes, fixes, and updates |
| .github/workflows/*.yml | Updated to Node.js 20 and actions v4 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ytallosilva
reviewed
Feb 24, 2026
ytallosilva
approved these changes
Feb 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace deprecated firebase/compat/* imports with modular API equivalents from firebase/app, firebase/database, and firebase/auth. This enables proper tree-shaking and keeps the library on supported Firebase APIs.