-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: deprecation guide for moving to firebase-js-sdk v9 modular API #8279
Open
russellwheatley
wants to merge
12
commits into
main
Choose a base branch
from
v9-migration-toggle-docs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+95
−8
Open
Changes from 5 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
686c181
docs: deprecation guide for moving to v9 modular API
russellwheatley 17d15c7
chore: hide warning logs from another function
russellwheatley 6146c06
docs: update spacing
russellwheatley 407fce2
chore: remove console log
russellwheatley 5e51972
docs: tweak
russellwheatley 01a29fa
docs: update links
russellwheatley 4fa0db8
docs: add migration guide to docs
russellwheatley 6e52cb8
docs: full stop
russellwheatley ad647c5
chore: update deprecation log with link to migration guide
russellwheatley 92e1332
docs: update migration guide
russellwheatley 317f2d3
chore:format
russellwheatley 357d1d8
docs: fix spelling
russellwheatley File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
--- | ||
title: Migrating to v22 | ||
description: Migrate to React Native Firebase v22 | ||
next: /typescript | ||
previous: / | ||
--- | ||
|
||
# Switching off warning logs | ||
|
||
You may notice an influx of console warning logs as we continue deprecating all existing namespaced API. If you would like to switch these logs off, you may set the following global property to `true` anywhere before you initialise Firebase. | ||
|
||
```js | ||
globalThis.RNFB_SILENCE_V8_DEPRECATION_WARNINGS = true; | ||
``` | ||
|
||
# Migrating to React Native modular API | ||
|
||
React Native Firebase does not currently have documentation for modular API. A refresh of the React Native Firebase documentation is something we will be aiming to achieve in the near future. We're keen to move the project to TypeScript which will then allow us to generate reference documentation from those types. | ||
|
||
However, if you are familiar with the Firebase JS SDK, it will be a much smoother process. React Native Firebase is using the same API as can be found on the official [Firebase JS SDK modular API documentation](https://firebase.google.com/docs/reference/js). | ||
|
||
## Firestore example | ||
|
||
## deprecated namespaced Query | ||
|
||
```js | ||
import firestore from '@react-native-firebase/firestore'; | ||
|
||
const db = firestore(); | ||
|
||
const querySnapshot = await db.collection("cities").where("capital", "==", true).get(); | ||
|
||
querySnapshot.forEach((doc) => { | ||
console.log(doc.id, " => ", doc.data()); | ||
}); | ||
``` | ||
|
||
## modular Query | ||
|
||
```js | ||
import { collection, query, where, getDocs, getFirestore } from "@react-native-firebase/firestore"; | ||
|
||
const db = getFirestore(); | ||
|
||
const q = query(collection(db, "cities"), where("capital", "==", true)); | ||
|
||
const querySnapshot = await getDocs(q); | ||
|
||
querySnapshot.forEach((doc) => { | ||
console.log(doc.id, " => ", doc.data()); | ||
}); | ||
``` | ||
|
||
For more examples of requesting data, see the official Firebase documentation for [Get data with Cloud Firestore](https://firebase.google.com/docs/firestore/query-data/get-data). You will find code snippets for "Web namespaced API" and "Web modular API". You can find code snippets for both namespaced API and modular API through out the Firebase web documentation. |
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
everything looks beautiful except the guide isn't hooked up to the URL here and the prev/next links need rearrange, you probably know that
only commenting to say this all looks like a +1 from me otherwise, even though it's draft at moment