Skip to content

chore: migrate from Firebase v9 compat to v12 modular API#56

Open
jay-cox wants to merge 4 commits intomasterfrom
feature/firebase-v12-modular-api
Open

chore: migrate from Firebase v9 compat to v12 modular API#56
jay-cox wants to merge 4 commits intomasterfrom
feature/firebase-v12-modular-api

Conversation

@jay-cox
Copy link

@jay-cox jay-cox commented Feb 24, 2026

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

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>
@jay-cox jay-cox added the draft label Feb 24, 2026
jay-cox and others added 3 commits February 24, 2026 09:07
…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>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 limitToFirst constraint incorrectly referenced an undefined local variable instead of props.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.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants