-
Tried the most basic demo for RTDB, bundled by https://github.com/vitejs/vite from: import firebase from 'firebase/app'
import 'firebase/database'
const firebaseConfig = {
//
}
const db = firebase.initializeApp(firebaseConfig)
export default db to: import { initializeApp } from 'firebase/app'
import { getDatabase } from 'firebase/database'
const firebaseConfig = {
//
}
const firebaseApp = initializeApp(firebaseConfig)
const db = getDatabase(firebaseApp)
export default db |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
This is currently the case with RTDB. We only provided the database instance as a tree-shakeable function. You'll notice the rest of the methods still chain off of the instance instead of requiring functions for operations. This isn't our long term plan but it's our current state of the alpha right now. I'll let @schmidt-sebastian detail more if he's free. |
Beta Was this translation helpful? Give feedback.
-
on the other hand, node_modules is ~35Mb smaller. That's a plus) |
Beta Was this translation helpful? Give feedback.
-
We are currently working on a tree-shakeable API of the RTDB SDK and hope to have some updates for you soon. |
Beta Was this translation helpful? Give feedback.
This is currently the case with RTDB. We only provided the database instance as a tree-shakeable function. You'll notice the rest of the methods still chain off of the instance instead of requiring functions for operations. This isn't our long term plan but it's our current state of the alpha right now. I'll let @schmidt-sebastian detail more if he's free.