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 +12 -34
- package/dist/SuspenseSubject.d.ts +1 -1
- package/dist/functions.d.ts +12 -0
- package/dist/index.d.ts +1 -0
- package/dist/reactfire.cjs.development.js +155 -212
- package/dist/reactfire.cjs.development.js.map +1 -1
- package/dist/reactfire.cjs.production.min.js +1 -1
- package/dist/reactfire.cjs.production.min.js.map +1 -1
- package/dist/reactfire.esm.js +136 -212
- package/dist/reactfire.esm.js.map +1 -1
- package/dist/{remote-config/index.d.ts → remote-config.d.ts} +2 -7
- package/dist/sdk.d.ts +28 -1
- package/package.json +9 -7
- package/src/SuspenseSubject.ts +6 -4
- package/src/auth.tsx +6 -6
- package/src/database.tsx +3 -29
- package/src/firebaseApp.tsx +1 -1
- package/src/firestore.tsx +3 -3
- package/src/functions.tsx +26 -0
- package/src/index.ts +1 -0
- package/src/{remote-config/index.tsx → remote-config.tsx} +4 -16
- package/src/sdk.tsx +26 -27
- package/src/storage.tsx +2 -24
- package/src/useObservable.ts +48 -28
- package/dist/remote-config/getValue.d.ts +0 -10
- package/src/remote-config/getValue.tsx +0 -58
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
|
-
[](#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
|
|
18
|
+
npm install --save firebase reactfire
|
|
25
19
|
|
|
26
20
|
# or
|
|
27
21
|
|
|
28
22
|
# yarn
|
|
29
|
-
yarn add reactfire
|
|
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
|

|
|
@@ -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.
|
|
106
|
-
[handle
|
|
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
|
-
|
|
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
|
-
|
|
112
|
-
|
|
113
|
-
|
|
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
|
-
|
|
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
|
|
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