Skip to content

Commit c1c98be

Browse files
Scott Prueprescottprue
Scott Prue
authored andcommitted
Merged master.
2 parents 7b8739a + 3cdcfe1 commit c1c98be

File tree

101 files changed

+4844
-27846
lines changed

Some content is hidden

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

101 files changed

+4844
-27846
lines changed

.github/ISSUE_TEMPLATE.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
**Do you want to request a *feature* or report a *bug*?**
22

3-
(If this is a *usage question*, please **do not post it here**—post it on [gitter](https://gitter.im/redux-firebase/Lobby) or [Stack Overflow](http://stackoverflow.com/questions/tagged/react-redux-firebase) instead. If this is not a “feature” or a “bug”, or the phrase “How do I...?” applies, then it's probably a usage question.)
3+
(If this is a *usage question*, please **do not post it here**—post it on [gitter](https://gitter.im/redux-firebase/Lobby). If this is not a “feature” or a “bug”, or the phrase “How do I...?” applies, then it's probably a usage question.)
44

55

66
**What is the current behavior?**
77

88

99

10-
**If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar.**
10+
**If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via [codesandbox](https://codesandbox.io/) or similar.**
1111

1212

1313

@@ -18,4 +18,4 @@
1818
**Which versions of dependencies, and which browser and OS are affected by this issue? Did this work in previous versions or setups?**
1919

2020
<!-- Love react-redux-firebase? Please consider supporting our collective:
21-
👉 https://opencollective.com/react-redux-firebase/donate -->
21+
👉 https://opencollective.com/react-redux-firebase/donate -->

.github/PULL_REQUEST_TEMPLATE.md

+2-9
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
11
### Description
22

3-
<!-- Write Your Description Here ^ -->
4-
<!-- Some things that may be of interest to address:
5-
- Will a new version need to be released or is this a docs change?
6-
- Which version should this be published as a part of? ("ASAP", "no idea", and specific version number)
7-
- Does this impact the external API?
8-
- Will it need to be a breaking change? -->
93

104
### Check List
115
If not relevant to pull request, check off as complete
126

137
- [ ] All tests passing
14-
- [ ] Docs updated with any changes or examples
15-
- [ ] Added tests to ensure feature(s) work properly
8+
- [ ] Docs updated with any changes or examples if applicable
9+
- [ ] Added tests to ensure new feature(s) work properly
1610

1711
### Relevant Issues
18-
<!-- List Relevant Issues here -->
1912
<!-- * #1 -->

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ coverage
2121
dist
2222
es
2323
lib
24+
_book
25+
# Logs
26+
*.log
27+
.DS_Store
28+
.idea
2429
examples/complete/react-native/ios/build
2530
examples/complete/react-native-firebase/ios/build
2631

README.md

+38-36
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,13 @@ npm install --save react-redux-firebase
4545

4646
The above install command will install the `@latest` tag. You may also use the following tags when installing to get different versions:
4747

48-
* `@next` - Next upcoming release. Currently points to active progress with `v1.5.0-*` pre-releases
49-
* `@canary` - Most possible up to date code. Currently points to active progress with `v2.0.0-*` pre-releases. *Warning:* Syntax is different than current stable version.
48+
* `@canary` - Most possible up to date code. Currently, points to active progress with `v2.0.0-*` pre-releases. *Warning:* Syntax is different than current stable version.
5049

51-
Other versions docs are available using the dropdown on the above docs link. For quick access:
52-
* [Version `1.5.0` Docs](http://docs.react-redux-firebase.com/history/v1.5.0/)
53-
* [Version `2.0.0` Docs](http://docs.react-redux-firebase.com/history/v2.0.0/)
54-
55-
Be aware of changes when using version that are tagged `@latest`. Please report any issues you encounter, and try to keep an eye on the [releases page](https://github.com/prescottprue/react-redux-firebase/releases) for updates.
50+
Be aware of changes when using a version that is not tagged `@latest`. Please report any issues you encounter, and try to keep an eye on the [releases page](https://github.com/prescottprue/react-redux-firebase/releases) for updates.
5651

5752
## Use
5853

59-
**Note:** If you are just starting a new project, you may want to use [`v2.0.0`](http://docs.react-redux-firebase.com/history/v2.0.0/#use) since it is has an even easier syntax. For clarity on the transition, view the [`v1` -> `v2` migration guide](http://docs.react-redux-firebase.com/history/v2.0.0/docs/v2-migration-guide.html)
54+
**Note:** If you are just starting a new project, you may want to use [`v2.0.0`](http://docs.react-redux-firebase.com/history/v2.0.0/#use) since it has an even easier syntax. For clarity on the transition, view the [`v1` -> `v2` migration guide](http://docs.react-redux-firebase.com/history/v2.0.0/docs/v2-migration-guide.html)
6055

6156
Include `reactReduxFirebase` in your store compose function and `firebaseStateReducer` in your reducers:
6257

@@ -65,13 +60,7 @@ import { createStore, combineReducers, compose } from 'redux'
6560
import { reactReduxFirebase, firebaseStateReducer } from 'react-redux-firebase'
6661
import firebase from 'firebase'
6762

68-
// Add Firebase to reducers
69-
const rootReducer = combineReducers({
70-
firebase: firebaseStateReducer
71-
})
72-
73-
// Firebase config
74-
const config = {
63+
const firebaseConfig = {
7564
apiKey: '<your-api-key>',
7665
authDomain: '<your-auth-domain>',
7766
databaseURL: '<your-database-url>',
@@ -87,7 +76,13 @@ const createStoreWithFirebase = compose(
8776
reactReduxFirebase(firebaseApp, rrfConfig), // firebase instance as first argument
8877
)(createStore)
8978

79+
// Add Firebase to reducers
80+
const rootReducer = combineReducers({
81+
firebase: firebaseStateReducer
82+
})
83+
9084
// Create store with reducers and initial state
85+
const initialState = {}
9186
const store = createStoreWithFirebase(rootReducer, initialState)
9287
```
9388

@@ -115,6 +110,9 @@ class Todos extends Component {
115110
newTodo.value = ''
116111
console.log('Todo Created!')
117112
})
113+
.catch((err) => {
114+
console.log('Error creating todo:', err) // error is also set to state.firebase.authError
115+
})
118116
}
119117

120118
render() {
@@ -197,7 +195,7 @@ export default class SomeComponent extends Component {
197195
}
198196
```
199197

200-
In order to enable this functionality, you will most likely need to install a plugin (depending on your build setup). For Webpack and Babel, you will need to make sure you have installed and enabled [babel-plugin-transform-decorators-legacy](https://github.com/loganfsmyth/babel-plugin-transform-decorators-legacy) by doing the following:
198+
To enable this functionality, you will most likely need to install a plugin (depending on your build setup). For Webpack and Babel, you will need to make sure you have installed and enabled [babel-plugin-transform-decorators-legacy](https://github.com/loganfsmyth/babel-plugin-transform-decorators-legacy) by doing the following:
201199

202200
1. run `npm i --save-dev babel-plugin-transform-decorators-legacy`
203201
2. Add the following line to your `.babelrc`:
@@ -245,7 +243,7 @@ Join us on the [redux-firebase gitter](https://gitter.im/redux-firebase/Lobby).
245243
View docs for recipes on integrations with:
246244

247245
* [redux-thunk](/docs/recipes/thunks.md)
248-
* [redux-observable](/docs/recipes/redux-observable.md)
246+
* [redux-observable](/docs/recipes/epics.md)
249247
* [redux-saga](/docs/recipes/redux-saga.md)
250248
* [redux-form](/docs/recipes/redux-form.md)
251249
* [redux-auth-wrapper](/docs/recipes/routing.md#advanced)
@@ -267,33 +265,37 @@ The [examples folder](/examples) contains full applications that can be copied/a
267265

268266
1. How is this different than [`redux-react-firebase`](https://github.com/tiberiuc/redux-react-firebase)?
269267

270-
This library was actually originally forked from redux-react-firebase, but adds extended functionality such as:
271-
* [populate functionality](http://react-redux-firebase.com/docs/populate) (similar to mongoDB or SQL JOIN)
272-
* `react-native` support ([web/js](http://react-redux-firebase.com/docs/recipes/react-native.html) or native modules through [`react-native-firebase`](http://docs.react-redux-firebase.com/history/v2.0.0/docs/recipes/react-native.html#native-modules))
273-
* tons of [integrations](#integrations)
274-
* [`profileFactory`](http://react-redux-firebase.com/docs/config) - change format of profile stored on Firebase
275-
* [`getFirebase`](http://react-redux-firebase.com/docs/thunks) - access to firebase instance that fires actions when methods are called
276-
* [access to firebase's `storage`](http://react-redux-firebase.com/docs/storage) method`
277-
* `uniqueSet` method helper for only setting if location doesn't already exist
278-
* Object or String notation for paths (`[{ path: '/todos' }]` equivalent to `['/todos']`)
279-
* Action Types and other Constants are exposed for external usage (such as with `redux-observable`)
280-
* Server Side Rendering Support
281-
* [Complete Firebase Auth Integration](http://react-redux-firebase.com/docs/auth.html#examples) including `signInWithRedirect` compatibility for OAuth Providers
282-
283-
#### Well why not combine?
284-
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.
268+
This library was actually originally forked from redux-react-firebase, but adds extended functionality such as:
269+
* [populate functionality](http://react-redux-firebase.com/docs/populate) (similar to mongoose's `populate` or SQL's `JOIN`)
270+
* `react-native` support ([web/js](http://react-redux-firebase.com/docs/recipes/react-native.html) or native modules through [`react-native-firebase`](http://docs.react-redux-firebase.com/history/v2.0.0/docs/recipes/react-native.html#native-modules))
271+
* tons of [integrations](#integrations)
272+
* [`profileFactory`](http://react-redux-firebase.com/docs/config) - change format of profile stored on Firebase
273+
* [`getFirebase`](http://react-redux-firebase.com/docs/thunks) - access to firebase instance that fires actions when methods are called
274+
* [access to firebase's `storage`](http://react-redux-firebase.com/docs/storage) and `messaging` services
275+
* `uniqueSet` method helper for only setting if location doesn't already exist
276+
* Object or String notation for paths (`[{ path: '/todos' }]` equivalent to `['/todos']`)
277+
* Action Types and other Constants are exposed for external usage (such as with `redux-observable`)
278+
* Server Side Rendering Support
279+
* [Complete Firebase Auth Integration](http://react-redux-firebase.com/docs/auth.html#examples) including `signInWithRedirect` compatibility for OAuth Providers
280+
281+
#### Well why not combine?
282+
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.
283+
284+
#### What about [redux-firebase](https://github.com/colbyr/redux-firebase)?
285+
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`).
285286

286287
2. Why use redux if I have Firebase to store state?
287288

288-
This isn't a super quick answer, so I wrote up [a medium article to explain](https://medium.com/@prescottprue/firebase-with-redux-82d04f8675b9)
289+
This isn't a super quick answer, so I wrote up [a medium article to explain](https://medium.com/@prescottprue/firebase-with-redux-82d04f8675b9)
289290

290291
3. Where can I find some examples?
291292

292-
* [Recipes Section](http://react-redux-firebase.com/docs/recipes/) of [the docs](http://react-redux-firebase.com/docs/recipes/)
293-
* [examples folder](/examples) contains [complete example apps](/examples/complete) as well as [useful snippets](/examples/snippets)
293+
* [Recipes Section](http://react-redux-firebase.com/docs/recipes/) of [the docs](http://react-redux-firebase.com/docs/recipes/)
294+
* [examples folder](/examples) contains [complete example apps](/examples/complete) as well as [useful snippets](/examples/snippets)
295+
294296
4. How does `connect` relate to `firebaseConnect`?
295297

296-
![data flow](/docs/static/dataFlow.png)
298+
![data flow](/docs/static/dataFlow.png)
297299

298300
5. How do I help?
299301

SUMMARY.md

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
* [React Native](/docs/recipes/react-native.md)
2424
* [React Chrome Redux](/docs/recipes/react-chrome-redux.md)
2525
* [Server Side Rendering](/docs/recipes/ssr.md)
26+
* [Performance](/docs/recipes/performance.md)
2627
* [API Reference](/docs/api/README.md)
2728
* [constants](/docs/api/constants.md)
2829
* [firebaseConnect](/docs/api/connect.md)

book.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
},
2828
{
2929
"value": "http://docs.react-redux-firebase.com/history/v1.5.0/",
30-
"text": "Version 1.5.0"
30+
"text": "Version 1.5.0",
31+
"selected": true
3132
},
3233
{
3334
"value": "http://docs.react-redux-firebase.com/history/v2.0.0/",

docs/api/compose.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Middleware that handles configuration (placed in redux's
5454
automatically populate profile with data loaded through profileParamsToPopulate config. (default: `true`)
5555
- `config.setProfilePopulateResults` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Whether or not to
5656
call SET actions for data that results from populating profile to redux under
57-
the data path. For example: role paramter on profile populated from 'roles'
57+
the data path. For example role parameter on profile populated from 'roles'
5858
root. True will call SET_PROFILE as well as a SET action with the role that
5959
is loaded (places it in data/roles). (default: `false`)
6060

docs/api/connect.md

+1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ export default connect(({ firebase: data: { todos }, auth, profile }) => ({
7474
todos,
7575
profile, // pass profile data as this.props.profile
7676
auth // pass auth data as this.props.auth
77+
>>>>>>> master
7778
}))(fbWrapped)
7879
```
7980

docs/api/constants.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Object containing all action types
3434
- `LOGIN_ERROR` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** `@@reactReduxFirebase/LOGIN_ERROR`
3535
- `NO_VALUE` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** `@@reactReduxFirebase/NO_VALUE`
3636
- `UNAUTHORIZED_ERROR` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** `@@reactReduxFirebase/UNAUTHORIZED_ERROR`
37-
- `ERROR` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** `@@reactReduxFirebase/UNAUTHORIZED_ERROR`
37+
- `ERROR` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** `@@reactReduxFirebase/ERROR`
3838
- `SET_LISTENER` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** `@@reactReduxFirebase/SET_LISTENER`
3939
- `UNSET_LISTENER` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** `@@reactReduxFirebase/UNSET_LISTENER`
4040
- `AUTHENTICATION_INIT_STARTED` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** `@@reactReduxFirebase/AUTHENTICATION_INIT_STARTED`
@@ -85,6 +85,8 @@ Default configuration options
8585
logging out.
8686
- `updateProfileOnLogin` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** `true` Whether or not to update
8787
user profile when logging in.
88+
- `resetBeforeLogin` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** `true` Whether or not to reset auth
89+
and profile when logging in (see issue #254 for more details).
8890
- `enableRedirectHandling` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** `true` Whether or not to enable
8991
redirect handling. This must be disabled if environment is not http/https
9092
such as with react-native.
@@ -98,7 +100,7 @@ Default configuration options
98100
profileParamsToPopulate config.
99101
- `setProfilePopulateResults` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** `true` Whether or not to
100102
call SET actions for data that results from populating profile to redux under
101-
the data path. For example: role paramter on profile populated from 'roles'
103+
the data path. For example role parameter on profile populated from 'roles'
102104
root. True will call SET_PROFILE as well as a SET action with the role that
103105
is loaded (places it in data/roles).
104106
- `dispatchOnUnsetListener` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** `false` Whether or not to

0 commit comments

Comments
 (0)