reactfire 4.0.0-exp.e80fc49 → 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 +14 -15
- 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
|
@@ -3,12 +3,6 @@
|
|
|
3
3
|
Hooks, Context Providers, and Components that make it easy to interact with
|
|
4
4
|
Firebase.
|
|
5
5
|
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
> **WARNING**: This branch is the work in progress for version 4 of ReactFire. [You can find version 3 here](https://github.com/firebaseextended/reactfire/tree/v3), if you're looking for documentation or to contribute to stable.
|
|
9
|
-
|
|
10
|
-
---
|
|
11
|
-
|
|
12
6
|
## What is ReactFire?
|
|
13
7
|
|
|
14
8
|
- **Easy realtime updates for your function components** - Hooks
|
|
@@ -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,7 +28,6 @@ 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)
|
|
40
33
|
- [**v3 -> v4 Upgrade Guide**](./docs/upgrade-guide.md)
|
|
@@ -90,10 +83,6 @@ render(
|
|
|
90
83
|
|
|
91
84
|
---
|
|
92
85
|
|
|
93
|
-
> If you're looking for docs for the _deprecated_ ReactFire v1 (the one that
|
|
94
|
-
> uses mixins), click
|
|
95
|
-
> [here](https://github.com/FirebaseExtended/reactfire/tree/v1.0.0)
|
|
96
|
-
|
|
97
86
|
## Status
|
|
98
87
|
|
|
99
88
|

|
|
@@ -102,7 +91,17 @@ This repository is maintained by Googlers but is not a supported Firebase produc
|
|
|
102
91
|
|
|
103
92
|
### Extra Experimental [concurrent mode](https://reactjs.org/docs/concurrent-mode-suspense.html) features
|
|
104
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
|
+
|
|
105
96
|
- **Loading states handled by `<Suspense>`** - ReactFire's hooks throw promises
|
|
106
|
-
that Suspense can catch.
|
|
107
|
-
[handle
|
|
97
|
+
that Suspense can catch. Let React
|
|
98
|
+
[handle loading states for you](https://reactjs.org/docs/concurrent-mode-suspense.html).
|
|
108
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 />`.
|
|
100
|
+
|
|
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`:
|
|
102
|
+
|
|
103
|
+
```jsx
|
|
104
|
+
<FirebaseAppProvider firebaseConfig={firebaseConfig} suspense={true}>
|
|
105
|
+
```
|
|
106
|
+
|
|
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