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
Copy file name to clipboardExpand all lines: README.md
+47-10Lines changed: 47 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,25 +16,45 @@ connected to Firebase, allowing you to use [Suspense](https://reactjs.org/docs/c
16
16
17
17
## Quickstart
18
18
19
-
Listen for realtime changes in a Firestore document with Reactfire. We'll use [`create-react-app`](https://facebook.github.io/create-react-app/docs/getting-started) to quickly get a Reactfire demo up and running.
19
+
⚛ + 🔥 = 🌯
20
20
21
-
1. Create a fresh React app.
21
+
We'll build a web app that displays, in _real time_, the tastiness of a burrito. It will listen to **Cloud Firestore** for its data, and we'll configure **Firebase Performance Monitoring** so we can get some perf stats.
22
+
23
+
> Prerequisite: make sure you have [Node.js](https://nodejs.org/en/) installed.
24
+
25
+
1. In a terminal, create a fresh React app and `cd` into its directory.
22
26
23
27
```shell
24
-
create-react-app myapp
28
+
npx create-react-app myapp
29
+
cd myapp
25
30
```
26
31
27
32
1. Install reactfire and the Firebase SDK
28
33
29
34
```shell
30
-
npm i firebase reactfire@canary
35
+
yarn add firebase reactfire@canary
31
36
```
32
37
33
-
1. Create a world-readable document in Firestore.
38
+
1. Create a document in Cloud Firestore.
39
+
40
+
1. Go to the _Database_ tab in the Firebase console. If your project doesn't have a Cloud Firestore instance yet, initialize it in locked mode
41
+
1. Add a document
42
+
43
+
1. In the _Data_ tab of the console, click _Add Collection_
34
44
35
-
For example, a collection called **_tryreactfire_** with document **_burrito_** with field `yummy: true`.
45
+
1. Name the collection **_tryreactfire_**
46
+
1. Add a document with ID **_burrito_** and boolean field `yummy: true`
36
47
37
-
To keep this as simple as possible, modify your security rules to make that document world-readable.
@@ -125,6 +152,16 @@ Listen for realtime changes in a Firestore document with Reactfire. We'll use [`
125
152
126
153
1. Edit the value of `yummy` in the Firebase console, and watch it update in real time in your app! 🔥🔥🔥
127
154
155
+
1._"But what about Firebase Performance Monitoring?"_
156
+
157
+
By passing the `initPerformance` prop to `FirebaseAppProvider`, our app will automatically measure [common performance stats](https://firebase.google.com/docs/perf-mon/automatic-web), as well as report on our custom trace, `load-burrito-status`, that we set in the `traceId` prop of `SuspenseWithPerf`.
158
+
159
+
However, Firebase Performance Monitoring can take about 12 hours to crunch your data and show it in the _Performance_ tab of the Firebase console.
160
+
161
+
This is an example of some of the stats in the Firebase Performance Monitoring console after 12 hours:
0 commit comments