Skip to content

refactor(database)!: move to typescript #8915

Draft
MichaelVerdon wants to merge 2 commits intomainfrom
typescript-rtdb
Draft

refactor(database)!: move to typescript #8915
MichaelVerdon wants to merge 2 commits intomainfrom
typescript-rtdb

Conversation

@MichaelVerdon
Copy link
Collaborator

…ation

  • Add lib/types/database.ts with public/modular types (Database, Statics, Reference, Query, etc.)
  • Add lib/types/namespaced.ts with deprecated FirebaseDatabaseTypes namespace
  • Add lib/types/internal.ts with DatabaseInternal and WithModularDeprecationArg
  • Move FirebaseDatabaseModule and createModuleNamespace into lib/namespaced.js
  • Slim lib/index.js to re-export from namespaced and modular
  • Replace lib/index.d.ts with barrel re-exporting types and declare module augmentation
  • Include database type sources in root tsconfig

Description

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:

…ation

- Add lib/types/database.ts with public/modular types (Database, Statics, Reference, Query, etc.)
- Add lib/types/namespaced.ts with deprecated FirebaseDatabaseTypes namespace
- Add lib/types/internal.ts with DatabaseInternal and WithModularDeprecationArg
- Move FirebaseDatabaseModule and createModuleNamespace into lib/namespaced.js
- Slim lib/index.js to re-export from namespaced and modular
- Replace lib/index.d.ts with barrel re-exporting types and declare module augmentation
- Include database type sources in root tsconfig
@vercel
Copy link

vercel bot commented Mar 5, 2026

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

Project Deployment Actions Updated (UTC)
react-native-firebase Error Error Mar 5, 2026 4:33pm

Request Review

…cation tests

- Use Database and Reference from types/database in modular declarations
- Export Statics from modular; fix getServerTime return type to Date
- Trim tsconfig to type-test only for database package
- Add @ts-expect-error for namespaced API usage in V9 deprecation tests
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