Enable direct ad-hoc imports
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- firebase, react, react-native, typescript
- Domain
- developer-experience, frontend, mobile
Research direction
Start by reproducing the IDBIndex error in a new Expo app using the listed React Native, Reactfire, and Firebase versions, then inspect how Reactfire exports its providers. Done means consumers can import only the needed component, such as FirebaseAppProvider, without loading unrelated functionality or triggering the error.
Written by the indexing model from the issue text.
Description
Can't find variable: IDBIndex when setting up on Expo
I used the same hierarchy I had working on the web. I am not using performance or analytics, so I think all of the underlying components should work.
But, I believe that since there isn't a way (that I can tell) to import only specific components, I end up with an error as if I were importing performance package.
import React from 'react'
import { getAuth, connectAuthEmulator } from 'firebase/auth'
import { getFunctions, connectFunctionsEmulator } from "firebase/functions"
import { getStorage, connectStorageEmulator } from "firebase/storage"
import { getFirestore, connectFirestoreEmulator } from "firebase/firestore";
import { FirebaseAppProvider, useFirebaseApp, AuthProvider, StorageProvider, FirestoreProvider } from 'reactfire';
function FirebaseComponents({ children }) {
const app = useFirebaseApp() // a parent component contains a `FirebaseAppProvider`
const auth = getAuth(app)
const functions = getFunctions(app)
const firestoreInstance = getFirestore(app)
const storage = getStorage(app)
return (
<AuthProvider sdk={auth}>
<FirestoreProvider sdk={firestoreInstance}>
<StorageProvider sdk={storage}>
{children}
</StorageProvider>
</FirestoreProvider>
</AuthProvider>
);
}
function AllFirebaseComponents({ children, fire }) {
return (
<FirebaseAppProvider firebaseApp={fire} >
<FirebaseComponents>
{children}
</FirebaseComponents>
</FirebaseAppProvider>
)
}
export default AllFirebaseComponents
Version info
"react": "^17.0.2",
"react-native": "~0.63.4",
"reactfire": "^4.2.0",
"firebase": "^9.0.1",
Test case
TBU, will try to get one of these
Steps to reproduce
Start a new expo app, attempt to use reactfire. Get error mentioned above.
Expected behavior
Be able to import only the components needed, ex:
import FirebaseAppProvider from 'reactfire/FirebaseAppProvider';
Actual behavior
I get the error mentioned above which I think comes from the performance stuff
- Dominant language
- TypeScript
- Stars
- 3.6k
- Forks
- 403
- Avg merge
- 4d 19h
- Merged PRs (30d)
- 11
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from FirebaseExtended/reactfire
-
Difficulty 5/5 Over a week Newbie friendliness 38/100
FirebaseExtended/reactfire#801 ·
Maintainers usually reply within 2 days
-
v5
Difficulty 4/5 3-5 days Newbie friendliness 48/100
FirebaseExtended/reactfire#793 ·
Maintainers usually reply within 2 days
-
v5
Difficulty 4/5 3-5 days Newbie friendliness 35/100
FirebaseExtended/reactfire#790 · 2 comments ·
Maintainers usually reply within 2 days
-
v5
Difficulty 4/5 3-5 days Newbie friendliness 55/100
FirebaseExtended/reactfire#789 ·
Maintainers usually reply within 2 days
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
FirebaseExtended/reactfire#788 ·
Maintainers usually reply within 2 days
All issues in FirebaseExtended/reactfire
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
openedx/frontend-app-authoring#3274 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
area/documentation status/need-triage
Difficulty 1/5 Under an hour Newbie friendliness 95/100
google-gemini/gemini-cli#29548 ·
Maintainers usually reply within 1 day
-
sdk-typescript vector-store
Difficulty 2/5 Half a day Newbie friendliness 82/100
mem0ai/mem0#7495 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day