You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While working extensively with Firebase RTDB with my team, we noticed a lot of bugs that needed to be caught by automated or manual testing while only being typos, more or less. This led to slow save-test-troubleshoot iterations and wasted dev time. We created a TypeScript-based solution to provide IntelliSense and statically check RTDB paths and values to speed up development while reducing these issues.
While the community has already created packages (e.g. FireSage) to fix the lack of strong typings, I strongly consider that having this as an opt-in, fully backwards compatible feature in the official SDK is crucial as it would encourage more people to use it and thus improve their DX.
I have created a basic, proof-of-concept implementation for a couple of types in @ag-media/firebase-js-sdk. Here's a demo of how this would work. Only types have been changed in @ag-media/firebase-database vs. firebase/database.
We have already implemented an almost fully-featured solution in our private packages. Instead of publishing these packages, we would like to add this functionality directly into the Firebase JS SDK, as this is the most impactful way to share it with the Firebase community. Our solution includes automatically generating the DBType typescript interface based on the RTDB bolt rules. This is a game-changer since this means there is only one source of truth, the security rules of the project's database and no wasted dev-time copying over the rtdb structure to a typescript interface.
While our solution deals with RTDB exclusively, it should be easy to adapt the types to work for Firestore.
We would like to have some acknowledgement from Firebase maintainers/contributors before starting working on the PRs since it's not an insignificant amount of work. Note that for our types to work, TypeScript 5 is required as we use const modifier on type parameters.
Steps and code to reproduce issue
_
The text was updated successfully, but these errors were encountered:
Operating System
not relevant
Browser Version
not relevant
Firebase SDK Version
10.1.0
Firebase SDK Product:
Database
Describe your project's tooling
_
Describe the problem
While working extensively with Firebase RTDB with my team, we noticed a lot of bugs that needed to be caught by automated or manual testing while only being typos, more or less. This led to slow save-test-troubleshoot iterations and wasted dev time. We created a TypeScript-based solution to provide IntelliSense and statically check RTDB paths and values to speed up development while reducing these issues.
While the community has already created packages (e.g. FireSage) to fix the lack of strong typings, I strongly consider that having this as an opt-in, fully backwards compatible feature in the official SDK is crucial as it would encourage more people to use it and thus improve their DX.
I have created a basic, proof-of-concept implementation for a couple of types in @ag-media/firebase-js-sdk. Here's a demo of how this would work. Only types have been changed in
@ag-media/firebase-database
vs.firebase/database
.We have already implemented an almost fully-featured solution in our private packages. Instead of publishing these packages, we would like to add this functionality directly into the Firebase JS SDK, as this is the most impactful way to share it with the Firebase community. Our solution includes automatically generating the
DBType
typescript interface based on the RTDB bolt rules. This is a game-changer since this means there is only one source of truth, the security rules of the project's database and no wasted dev-time copying over the rtdb structure to a typescript interface.While our solution deals with RTDB exclusively, it should be easy to adapt the types to work for Firestore.
We would like to have some acknowledgement from Firebase maintainers/contributors before starting working on the PRs since it's not an insignificant amount of work. Note that for our types to work, TypeScript 5 is required as we use const modifier on type parameters.
Steps and code to reproduce issue
_
The text was updated successfully, but these errors were encountered: