refactor(database)!: migrate to TypeScript#8977
Open
russellwheatley wants to merge 34 commits intomainfrom
Open
refactor(database)!: migrate to TypeScript#8977russellwheatley wants to merge 34 commits intomainfrom
russellwheatley wants to merge 34 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
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.
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.
Description
Breaking changes
ServerValuenamed export from@react-native-firebase/database; consumers must useserverTimestamp()/increment()or the preserved namespacedfirebase.database.ServerValueAPI instead. 352f44agoOffline(db)andgoOnline(db)so they no longer return a chainable value, which breaks consumer code thatawaits them or calls.then(...)on them. 461786bDatabaseReference,Query,DataSnapshot,OnDisconnect, andQueryConstraintno longer expose the older namespaced instance-style API in their public typings; TypeScript consumers may need to switch to the function-based modular helpers. db5f53bgetServerTime(db)to a synchronousDatereturn in the modular type surface, so TypeScript consumers that previously treated it as promise-like will need to update their code. a8c2fabRelated issues
Release Summary
Checklist
AndroidiOSOther(macOS, web)e2etests added or updated inpackages/\*\*/e2ejesttests added or updated inpackages/\*\*/__tests__Test Plan
Think
react-native-firebaseis great? Please consider supporting the project with any of the below:React Native FirebaseandInvertaseon Twitter