Skip to content

Commit 989d299

Browse files
authored
v2.0.0-rc.2 (prescottprue#364)
* fix(firestore): profile update with firestore - prescottprue#360 - @barnomics * fix(auth): `loginWithCustomToken` supports passing `profile` parameter - prescottprue#359 * feat(auth): error messages for not logged using same wording for all methods (i.e. “User must be logged in”) * feat(docs): `loginWithCustomToken` section updated with note about how `profile` is required in certain cases - prescottprue#359 * feat(docs): roadmap updated to include option for re-rendering HOCs based on auth state change - prescottprue#367 * feat(docs): link added to sidebar for each of the separate reducers * feat(docs): note added to FAQ about why `yarn.lock` file is not included * fix(test): extended timeout added to unit tests for `login` to prevent fail on slow connections * feat(docs): note added to reducer docs about how it is multiple slice reducers combined with `combineReducers` * feat(test): unit tests added for auth/query actions not previously covered (`updateEmail`, `updateAuth`, `orderedFromSnapshot`, etc) * fix(test): tests simplified by moving reused functions to test utils * fix(test): remove lint warning caused by `mocha.opts` being ignored * update(deps): `prop-types` dependency updated from `v15.5.*` to v15.6.*` * update(deps): tons of dev dependencies updated including `babel-cli`, `babel-core`, `eslint`, `sinon`, `mocha`, `jsdom` ##### Note `v2.0.0` syntax is now considered stable 🍾 (multiple production applications have switched from `v1.5.*` to `v2.*.*` following [the migration guide](docs.react-redux-firebase.com/history/v2.0.0/docs/v2-migration-guide.html), and test coverage is better than for `v1.5.*`). Merge conflicts with `master` have also been resolved. All of this means this release will be the final RC released on `next` before moving [`v2.0.0`](https://github.com/prescottprue/react-redux-firebase/tree/v2.0.0) to the `latest` tag on npm (the `latest` tag release will include merging to `master`).
1 parent 44fc5ab commit 989d299

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+5649
-2663
lines changed

README.md

+30-13
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,14 @@
1919
The [Material Example](https://github.com/prescottprue/react-redux-firebase/tree/master/examples/complete/material) is deployed to [demo.react-redux-firebase.com](https://demo.react-redux-firebase.com).
2020

2121
## Features
22-
- Support for updating and nested props
23-
- [Population capability](http://react-redux-firebase.com/docs/populate) (similar to mongoose's `populate` or SQL's `JOIN`)
22+
- Integrated into redux
2423
- Out of the box support for authentication (with auto load user profile)
25-
- Firebase Database, Firestore, Auth, Storage, and Messaging Support
24+
- Full Firebase Platform Support Including Real Time Database, Firestore, and Storage
25+
- Automatic binding/unbinding of listeners through React Higher Order Components (`firebaseConnect` and `firestoreConnect`)
26+
- [Population capability](http://react-redux-firebase.com/docs/populate) (similar to mongoose's `populate` or SQL's `JOIN`)
2627
- Support small data ( using `value` ) or large datasets ( using `child_added`, `child_removed`, `child_changed` )
27-
- queries including `orderByChild`, `orderByKey`, `orderByValue`, `orderByPriority`, `limitToLast`, `limitToFirst`, `startAt`, `endAt`, `equalTo`
28-
- Automatic binding/unbinding through `firestoreConnect` (manual through `watchEvent`)
29-
- Declarative decorator syntax for React components
30-
- Tons of integrations including [`redux-thunk`](https://github.com/gaearon/redux-thunk) and [`redux-observable`](https://redux-observable.js.org/)
31-
- Action Types and other Constants exported for external use (such as in `redux-observable`)
32-
- Firebase v3+ support
28+
- Multiple queries types supported including `orderByChild`, `orderByKey`, `orderByValue`, `orderByPriority`, `limitToLast`, `limitToFirst`, `startAt`, `endAt`, `equalTo`
29+
- Tons of examples of integrations including [`redux-thunk`](https://github.com/gaearon/redux-thunk) and [`redux-observable`](https://redux-observable.js.org/)
3330
- Server Side Rendering Support
3431
- [`react-native` support](/docs/recipes/react-native.md) using [native modules](http://docs.react-redux-firebase.com/history/v2.0.0/docs/recipes/react-native.html#native-modules) or [web sdk](/docs/recipes/react-native.md#jsweb)
3532

@@ -44,6 +41,9 @@ npm install --save react-redux-firebase@next
4441
Include `reactReduxFirebase` in your store compose function and `firebaseReducer` in your reducers:
4542

4643
```javascript
44+
import React from 'react'
45+
import { render } from 'react-dom'
46+
import { Provider } from 'react-redux'
4747
import { createStore, combineReducers, compose } from 'redux'
4848
import { reactReduxFirebase, firebaseReducer } from 'react-redux-firebase'
4949
import firebase from 'firebase'
@@ -69,7 +69,7 @@ const createStoreWithFirebase = compose(
6969
// reduxFirestore(firebase) // <- needed if using firestore
7070
)(createStore)
7171

72-
// Add Firebase to reducers
72+
// Add firebase to reducers
7373
const rootReducer = combineReducers({
7474
firebase: firebaseReducer,
7575
// firestore: firestoreReducer // <- needed if using firestore
@@ -78,9 +78,18 @@ const rootReducer = combineReducers({
7878
// Create store with reducers and initial state
7979
const initialState = {}
8080
const store = createStoreWithFirebase(rootReducer, initialState)
81+
82+
// Setup react-redux so that connect HOC can be used
83+
const App = () => (
84+
<Provider store={store}>
85+
<Todos />
86+
</Provider>
87+
);
88+
89+
render(<App/>, document.getElementById('root'));
8190
```
8291

83-
In components:
92+
Todos component (`./Todos`):
8493

8594
**Add Data**
8695

@@ -241,7 +250,6 @@ export default compose(
241250
)(Todos)
242251
```
243252

244-
245253
## [Docs](http://react-redux-firebase.com)
246254
See full documentation at [react-redux-firebase.com](http://react-redux-firebase.com)
247255

@@ -290,6 +298,14 @@ View docs for recipes on integrations with:
290298
* [react-native](/docs/integrations/react-native.md)
291299
* [react-native-firebase](http://docs.react-redux-firebase.com/history/v2.0.0/docs/integrations/react-native.html#native-modules) - requires `v2.0.0`
292300

301+
## Firestore
302+
303+
If you plan to use Firestore, you should checkout [`redux-firestore`][redux-firestore]. It integrates nicely with `react-redux-firebase` (v2 only) and it allows you to run Real Time Database and Firestore along side each other.
304+
305+
`react-redux-firebase` provides the `firestoreConnect` HOC (similar to `firebaseConnect`) for easy setting/unsetting of listeners.
306+
307+
Currently `react-redux-firebase` still handles auth when using [`redux-firestore`][redux-firestore] - The future plan is to also have auth standalone auth library that will allow the developer to choose which pieces they do/do not want.
308+
293309
## Starting A Project
294310

295311
### Generator
@@ -308,7 +324,7 @@ Please visit the [FAQ section of the docs](http://docs.react-redux-firebase.com/
308324

309325
This project exists thanks to all the people who contribute.
310326

311-
<a href="graphs/contributors"><img src="https://opencollective.com/react-redux-firebase/contributors.svg?width=890" /></a>
327+
<a href="https://github.com/prescottprue/react-redux-firebase/graphs/contributors"><img src="https://opencollective.com/react-redux-firebase/contributors.svg?width=890" /></a>
312328

313329
## Backers
314330

@@ -337,3 +353,4 @@ Thank you to all our backers! 🙏
337353
[code-style-url]: http://standardjs.com/
338354
[gitter-image]: https://img.shields.io/gitter/room/redux-firebase/gitter.svg?style=flat-square
339355
[gitter-url]: https://gitter.im/redux-firebase/Lobby
356+
[redux-firestore]: https://github.com/prescottprue/redux-firestore

SUMMARY.md

+12-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,18 @@
3131
* [withFirebase](/docs/api/withFirebase.md)
3232
* [firestoreConnect](/docs/api/firestoreConnect.md)
3333
* [withFirestore](/docs/api/withFirestore.md)
34-
* [firebaseStateReducer](/docs/api/reducer.md)
34+
* [firebaseReducer](/docs/api/reducer.md)
35+
* [isInitializingReducer](/docs/api/reducers.md#isinitializingreducer)
36+
* [requestingReducer](/docs/api/reducers.md#requestingreducer)
37+
* [requestedReducer](/docs/api/reducers.md#requestedreducer)
38+
* [timestampsReducer](/docs/api/reducers.md#timestampsreducer)
39+
* [authReducer](/docs/api/reducers.md#authreducer)
40+
* [authErrorReducer](/docs/api/reducers.md#autherrorreducer)
41+
* [profileReducer](/docs/api/reducers.md#profilereducer)
42+
* [errorsReducer](/docs/api/reducers.md#errorsreducer)
43+
* [listenersTeducer](/docs/api/reducers.md#listenersreducer)
44+
* [dataReducer](/docs/api/reducers.md#datareducer)
45+
* [orderedReducer](/docs/api/reducers.md#orderedreducer)
3546
* [reactReduxFirebase](/docs/api/enhancer.md)
3647
* [props.firebase](/docs/api/props-firebase.md)
3748
* [getFirebase](/docs/api/get-firebase.md)

bin/api-docs-generate.js

+4
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ const files = [
2828
src: 'helpers.js',
2929
dest: 'helpers.md'
3030
},
31+
{
32+
src: 'reducers.js',
33+
dest: 'reducers.md'
34+
},
3135
{
3236
src: 'reducer.js',
3337
dest: 'reducer.md'

docs/FAQ.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* [Complete Firebase Auth Integration](http://react-redux-firebase.com/docs/auth.html#examples) including `signInWithRedirect` compatibility for OAuth Providers
1717

1818
#### Well why not combine?
19-
I have been talking to the author of [redux-react-firebase](https://github.com/tiberiuc/redux-react-firebase) about combining, but we are not sure that the users of both want that at this point. Join us on the [redux-firebase gitter](https://gitter.im/redux-firebase/Lobby) if you haven't already since a ton of this type of discussion goes on there.
19+
I have been talking to the author of [redux-react-firebase](https://github.com/tiberiuc/redux-react-firebase) about combining, but we are not sure that the users of both want that at this point. Join us on the [redux-firebase gitter][gitter-url] if you haven't already since a ton of this type of discussion goes on there.
2020

2121
#### What about [redux-firebase](https://github.com/colbyr/redux-firebase)?
2222
The author of [redux-firebase](https://github.com/colbyr/redux-firebase) has agreed to share the npm namespace! Currently the plan is to take the framework agnostic redux core logic of `react-redux-firebase` and [place it into `redux-firebase`](https://github.com/prescottprue/redux-firebase)). Eventually `react-redux-firebase` and potentially other framework libraries can depend on that core (the new `redux-firebase`).
@@ -34,8 +34,14 @@
3434

3535
![data flow](/docs/static/dataFlow.png)
3636

37-
5. How do I help?
37+
5. Where is the `yarn.lock` file?
38+
39+
There isn't one, there is just a `package-lock.json`. `npm v5.x.x` adds support for a `package-lock.json` file which serves a similar purpose to a `yarn.lock` file. Instead of managing multiple lock files, the single `package-lock.json` contains exact version information for dependencies.
40+
41+
6. How do I help?
3842

3943
* Join the conversion on [gitter][gitter-url]
4044
* Post Issues
4145
* Create Pull Requests
46+
47+
[gitter-url]: gitter.im/redux-firebase/Lobby

docs/api/connect.md

+7-5
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ needing to access a firebase instance created under a different store key.
1515

1616
**Parameters**
1717

18-
- `storeKey` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Name of redux store which contains
18+
- `storeKey` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Name of redux store which contains
1919
Firebase state (state.firebase) (optional, default `'store'`)
2020

2121
**Examples**
@@ -31,7 +31,7 @@ const firebaseConnect = createFirebaseConnect('anotherStore')
3131
export default firebaseConnect()(SomeComponent)
3232
```
3333

34-
Returns **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** HOC that accepts a watchArray and wraps a component
34+
Returns **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** HOC that accepts a watchArray and wraps a component
3535

3636
## firebaseConnect
3737

@@ -42,14 +42,16 @@ to provided firebase paths using React's Lifecycle hooks.
4242

4343
**Parameters**
4444

45-
- `watchArray` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)** Array of objects or strings for paths to sync from Firebase. Can also be a function that returns the array. The function is passed the current props and the firebase object.
45+
- `watchArray` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)** Array of objects or strings for paths to sync
46+
from Firebase. Can also be a function that returns the array. The function
47+
is passed the current props and the firebase object.
4648

4749
**Examples**
4850

4951
_Basic_
5052

5153
```javascript
52-
// this.props.firebase set on App component as firebase object with helpers
54+
// props.firebase set on App component as firebase object with helpers
5355
import { firebaseConnect } from 'react-redux-firebase'
5456
export default firebaseConnect()(App)
5557
```
@@ -121,4 +123,4 @@ export default compose(
121123
)(SomeComponent)
122124
```
123125
124-
Returns **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** that accepts a component to wrap and returns the wrapped component
126+
Returns **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** that accepts a component to wrap and returns the wrapped component

0 commit comments

Comments
 (0)