Skip to content

refactor(database)!: migrate to TypeScript#8977

Open
russellwheatley wants to merge 34 commits intomainfrom
database-typescript
Open

refactor(database)!: migrate to TypeScript#8977
russellwheatley wants to merge 34 commits intomainfrom
database-typescript

Conversation

@russellwheatley
Copy link
Copy Markdown
Member

@russellwheatley russellwheatley commented Apr 14, 2026

Description

Breaking changes

  • breaking removed the modular ServerValue named export from @react-native-firebase/database; consumers must use serverTimestamp() / increment() or the preserved namespaced firebase.database.ServerValue API instead. 352f44a
  • breaking changed modular goOffline(db) and goOnline(db) so they no longer return a chainable value, which breaks consumer code that awaits them or calls .then(...) on them. 461786b
  • breaking aligned the modular TypeScript surface with the firebase-js-sdk, so modular types like DatabaseReference, Query, DataSnapshot, OnDisconnect, and QueryConstraint no longer expose the older namespaced instance-style API in their public typings; TypeScript consumers may need to switch to the function-based modular helpers. db5f53b
  • breaking corrected getServerTime(db) to a synchronous Date return in the modular type surface, so TypeScript consumers that previously treated it as promise-like will need to update their code. a8c2fab

Related issues

Release Summary

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
    • Yes
  • My change supports the following platforms;
    • Android
    • iOS
    • Other (macOS, web)
  • My change includes tests;
    • e2e tests added or updated in packages/\*\*/e2e
    • jest tests added or updated in packages/\*\*/__tests__
  • I have updated TypeScript types that are affected by my change.
  • This is a breaking change;
    • Yes
    • No

Test Plan


Think react-native-firebase is great? Please consider supporting the project with any of the below:

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 14, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
react-native-firebase Error Error Apr 17, 2026 5:34pm

Request Review

@russellwheatley russellwheatley changed the title chore(database): add package tsconfig scaffolding refactor(remote-config)!: migrate to TypeScript Apr 14, 2026
@russellwheatley russellwheatley changed the title refactor(remote-config)!: migrate to TypeScript refactor(database)!: migrate to TypeScript Apr 14, 2026
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request migrates the @react-native-firebase/database package to TypeScript, introducing robust type definitions for both modular and namespaced APIs and updating the build infrastructure to use react-native-builder-bob. The changes include refactoring core classes like DatabaseDataSnapshot and DatabaseQuery to .ts and adding a snapshot of the Firebase JS SDK types for comparison. The review feedback suggests aligning the forEach callback signature with the official SDK, removing redundant type casts, and replacing unnecessary as never returns with explicit return statements for better code clarity.

Comment thread packages/database/lib/DatabaseDataSnapshot.ts Outdated
Comment thread packages/database/lib/DatabaseDataSnapshot.ts Outdated
Comment thread packages/database/lib/DatabaseQuery.ts
Comment thread packages/database/lib/DatabaseQuery.ts Outdated
Comment thread packages/database/lib/DatabaseQuery.ts Outdated
Comment thread packages/database/lib/DatabaseQuery.ts Outdated
Comment thread packages/database/lib/DatabaseReference.ts Outdated
Comment thread packages/database/lib/types/namespaced.ts Outdated
@russellwheatley russellwheatley marked this pull request as ready for review April 20, 2026 07:57
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