Skip to content

Conversation

@fdikmen
Copy link

@fdikmen fdikmen commented Nov 23, 2025

Update Firebase SDK to Latest Versions (v12.6.0 and v13.6.0)

Summary

This PR updates the Firebase JavaScript SDK and Firebase Admin SDK to their latest versions to ensure compatibility with the most recent Firebase features, security patches, and performance improvements.

Changes Made

1. Updated Firebase Dependencies

Main package.json:

  • firebase: ^10.0.0^12.6.0 (devDependency)
  • firebase-admin: ~11.4.0^13.6.0 (devDependency)

Example package.json:

  • firebase: 9.17.1^12.6.0
  • firebase-admin: ^11.9.0^13.6.0

2. Updated Peer Dependencies

Updated peer dependency ranges to support the new Firebase versions:

  • firebase: >=9.0.0 <12>=9.0.0 <13
  • firebase-admin: >=10.0.0 <12>=10.0.0 <14

This allows users of the library to use Firebase v12 and firebase-admin v13 while maintaining backward compatibility with existing installations.

3. Fixed Jest Mock for firebase-admin/auth

File: __mocks__/firebase-admin/auth.ts

Problem: The mock was using jest.requireActual('firebase-admin/auth') which caused test failures with firebase-admin v13+ due to dependencies (like jose) that don't work well in Jest's Node environment.

Solution: Replaced jest.requireActual with a manual mock implementation that doesn't require loading the actual firebase-admin/auth module during tests.

Before:

const { Auth } = jest.requireActual('firebase-admin/auth')
const firebaseAdminAuth: jest.Mocked<typeof Auth> = jest.createMockFromModule(
  'firebase-admin/auth'
)

After:

// Avoid using jest.requireActual for firebase-admin/auth as it causes issues
// with firebase-admin v13+ due to dependencies like 'jose' that don't work
// well in Jest's Node environment. Instead, create a manual mock.
const firebaseAdminAuth = {
  getAuth: jest.fn(),
}

4. Updated Documentation Comments

Updated the devDependenciesComments section to reflect that the previous Jest test issue with firebase-admin v11.5.0 may be resolved in v13.6.0.

Why These Changes Were Made

  1. Security & Stability: Latest Firebase versions include important security patches and bug fixes
  2. Feature Support: New Firebase features and improvements are only available in newer versions
  3. Compatibility: Ensures the library works with the latest Firebase ecosystem
  4. Maintenance: Keeps dependencies up-to-date to reduce technical debt

Testing

All existing tests pass successfully:

  • 34 test suites passed
  • 431 tests passed
  • 98.4% code coverage maintained
  • ✅ No breaking changes detected

Test Results

Test Suites: 34 passed, 34 total
Tests:       431 passed, 431 total
Snapshots:   0 total
Time:        5.903 s

Compatibility

  • Backward Compatible: The library maintains backward compatibility with Firebase v9+ and firebase-admin v10+
  • API Compatibility: All existing APIs remain unchanged
  • No Breaking Changes: The modular Firebase API (v9+) used in the codebase is fully compatible with Firebase v12

Migration Notes

For users of this library:

  • No code changes required
  • Simply update your firebase and firebase-admin dependencies to the latest versions
  • The library will automatically work with Firebase v12 and firebase-admin v13

Files Changed

  • package.json - Updated devDependencies and peerDependencies
  • example/package.json - Updated Firebase dependencies
  • __mocks__/firebase-admin/auth.ts - Fixed Jest mock implementation
  • yarn.lock - Updated dependency lock file

Related Issues

This update addresses compatibility with the latest Firebase SDK versions and resolves the Jest test issues that were noted in the previous firebase-admin v11.5.0 comment.

Checklist

  • All tests pass
  • Code coverage maintained
  • No breaking changes introduced
  • Peer dependencies updated appropriately
  • Example app dependencies updated
  • Jest mocks fixed for new Firebase versions
  • Documentation comments updated

- Update firebase from ^10.0.0 to ^12.6.0
- Update firebase-admin from ~11.4.0 to ^13.6.0
- Update peer dependencies to support Firebase v12 and firebase-admin v13
- Fix Jest mock for firebase-admin/auth to work with v13+
- Update example app dependencies to latest versions

All tests pass (431 tests, 98.4% coverage maintained)
Maintains backward compatibility with Firebase v9+ and firebase-admin v10+
@vercel
Copy link

vercel bot commented Nov 23, 2025

@fdikmen is attempting to deploy a commit to the Gladly Team on Vercel.

A member of the Team first needs to authorize it.

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