reactfire 4.0.0-exp.cb3fede → 4.0.0-exp.eb1428b

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,11 +1,5 @@
1
1
  # ReactFire
2
2
 
3
- <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
4
-
5
- [![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-)
6
-
7
- <!-- ALL-CONTRIBUTORS-BADGE:END -->
8
-
9
3
  Hooks, Context Providers, and Components that make it easy to interact with
10
4
  Firebase.
11
5
 
@@ -21,12 +15,12 @@ Firebase.
21
15
 
22
16
  ```bash
23
17
  # npm
24
- npm install --save reactfire@exp firebase@exp
18
+ npm install --save firebase reactfire
25
19
 
26
20
  # or
27
21
 
28
22
  # yarn
29
- yarn add reactfire@exp firebase@exp
23
+ yarn add firebase reactfire
30
24
  ```
31
25
 
32
26
  Depending on your targeted platforms you may need to install polyfills. The most commonly needed will be [globalThis](https://caniuse.com/#search=globalThis) and [Proxy](https://caniuse.com/#search=Proxy).
@@ -34,9 +28,9 @@ Depending on your targeted platforms you may need to install polyfills. The most
34
28
  ## Docs
35
29
 
36
30
  - [**Quickstart**](./docs/quickstart.md)
37
- - Advanced: If you're using Concurrent Mode, check out the [Concurrent Mode quickstart](./docs/quickstart-concurrent-mode.md)
38
31
  - [**Common Use Cases**](./docs/use.md)
39
32
  - [**API Reference**](./docs/reference)
33
+ - [**v3 -> v4 Upgrade Guide**](./docs/upgrade-guide.md)
40
34
 
41
35
  ## Example use
42
36
 
@@ -89,10 +83,6 @@ render(
89
83
 
90
84
  ---
91
85
 
92
- > If you're looking for docs for the _deprecated_ ReactFire v1 (the one that
93
- > uses mixins), click
94
- > [here](https://github.com/FirebaseExtended/reactfire/tree/v1.0.0)
95
-
96
86
  ## Status
97
87
 
98
88
  ![Status: Experimental](https://img.shields.io/badge/Status-Experimental-blue)
@@ -101,29 +91,17 @@ This repository is maintained by Googlers but is not a supported Firebase produc
101
91
 
102
92
  ### Extra Experimental [concurrent mode](https://reactjs.org/docs/concurrent-mode-suspense.html) features
103
93
 
94
+ These features are marked as *extra experimental* because they use experimental React features that [will not be stable until sometime after React 18 is released](https://github.com/reactwg/react-18/discussions/47#:~:text=Likely%20after%20React%2018.0%3A%20Suspense%20for%20Data%20Fetching).
95
+
104
96
  - **Loading states handled by `<Suspense>`** - ReactFire's hooks throw promises
105
- that Suspense can catch. No more `isLoaded ?...` - let React
106
- [handle it for you](https://reactjs.org/docs/concurrent-mode-suspense.html).
97
+ that Suspense can catch. Let React
98
+ [handle loading states for you](https://reactjs.org/docs/concurrent-mode-suspense.html).
107
99
  - **Automatically instrument your `Suspense` load times** - Need to automatically instrument your `Suspense` load times with [RUM](https://firebase.google.com/docs/perf-mon)? Use `<SuspenseWithPerf />`.
108
100
 
109
- ## Contributors
101
+ Enable concurrent mode features by following the [concurrent mode setup guide](https://reactjs.org/docs/concurrent-mode-adoption.html#installation) and then setting the `suspense` prop in `FirebaseAppProvider`:
110
102
 
111
- Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
112
-
113
- <!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
114
- <!-- prettier-ignore-start -->
115
- <!-- markdownlint-disable -->
116
- <table>
117
- <tr>
118
- <td align="center"><a href="http://www.dfweb.no"><img src="https://avatars1.githubusercontent.com/u/45217974?v=4" width="100px;" alt=""/><br /><sub><b>w3bdesign</b></sub></a><br /><a href="https://github.com/FirebaseExtended/reactfire/commits?author=w3bdesign" title="Code">💻</a></td>
119
- <td align="center"><a href="http://prue.io"><img src="https://avatars0.githubusercontent.com/u/2992224?v=4" width="100px;" alt=""/><br /><sub><b>Scott Prue</b></sub></a><br /><a href="https://github.com/FirebaseExtended/reactfire/commits?author=prescottprue" title="Code">💻</a></td>
120
- <td align="center"><a href="http://git.io/jhuleatt"><img src="https://avatars0.githubusercontent.com/u/3759507?v=4" width="100px;" alt=""/><br /><sub><b>Jeff</b></sub></a><br /><a href="https://github.com/FirebaseExtended/reactfire/commits?author=jhuleatt" title="Code">💻</a></td>
121
- </tr>
122
- </table>
123
-
124
- <!-- markdownlint-enable -->
125
- <!-- prettier-ignore-end -->
126
-
127
- <!-- ALL-CONTRIBUTORS-LIST:END -->
103
+ ```jsx
104
+ <FirebaseAppProvider firebaseConfig={firebaseConfig} suspense={true}>
105
+ ```
128
106
 
129
- This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
107
+ See concurrent mode code samples in [example/withSuspense](https://github.com/FirebaseExtended/reactfire/tree/main/example/withSuspense)
@@ -12,7 +12,7 @@ export declare class SuspenseSubject<T> extends Subject<T> {
12
12
  private _resolveFirstEmission;
13
13
  constructor(innerObservable: Observable<T>, _timeoutWindow: number);
14
14
  get hasValue(): boolean;
15
- get value(): T | undefined;
15
+ get value(): T;
16
16
  get firstEmission(): Promise<void>;
17
17
  private _next;
18
18
  private _reset;
@@ -0,0 +1,12 @@
1
+ import { ReactFireOptions, ObservableStatus } from './';
2
+ import type { HttpsCallableOptions } from 'firebase/functions';
3
+ /**
4
+ * Calls a callable function.
5
+ *
6
+ * @param functionName - The name of the function to call
7
+ * @param options
8
+ */
9
+ export declare function useCallableFunctionResponse<RequestData, ResponseData>(functionName: string, options?: ReactFireOptions<ResponseData> & {
10
+ httpsCallableOptions?: HttpsCallableOptions;
11
+ data?: RequestData;
12
+ }): ObservableStatus<ResponseData>;
package/dist/index.d.ts CHANGED
@@ -28,6 +28,7 @@ export * from './auth';
28
28
  export * from './database';
29
29
  export * from './firebaseApp';
30
30
  export * from './firestore';
31
+ export * from './functions';
31
32
  export * from './performance';
32
33
  export * from './remote-config';
33
34
  export * from './storage';