Skip to content

Commit cc7ad26

Browse files
authored
v2.1.0
* feat(firebaseConnect): allow reuse of existing subscriptions when paths change - @Lecss * fix(watch): issue with multiple watchers on same path - @Tapped * feat(storage): add size and contentType to file uploads - @urbantumbleweed * feat(storage): errors in `uploadFile` now call `console.error` * feat(docs): `logErrors` config parameter added to docs * feat(core): husky added as a dev dep so that lint is run on push (`prepush` already in `package.json`) * fix(storage): `uploadFile` can accept both `options.progress` and options name together - prescottprue#414 * feat(tests): tests added to confirm name option works with other options - prescottprue#414 * feat(query): `onProfileWriteError` config option added to allow for hooking into error case of profile writes * feat(storage): `deleteFile` metadata removal logic simplified * feat(storage): `upload` metadata set logic simplified * feat(tests): Unit tests for `firestoreConnect` improved to more deeply test listener updates on prop changes * feat(tests): Unit tests added to test logic for `presence` and `sessions` config options * feat(core): `npm publish` now takes place on Travis through `deploy` config (any new version merged to master will be published by default)
2 parents cb79095 + aa5a9ee commit cc7ad26

36 files changed

+15533
-1684
lines changed

.babelrc

+6-7
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,18 @@
1818
],
1919
"env": {
2020
"es": {
21-
"comments": false,
22-
"plugins": [
23-
]
21+
"comments": false
2422
},
2523
"commonjs": {
26-
"comments": false,
27-
"plugins": [
28-
]
24+
"comments": false
2925
},
3026
"test": {
3127
"plugins": [
3228
"transform-runtime",
33-
"transform-async-to-generator"
29+
"transform-async-to-generator",
30+
["module-resolver", {
31+
"root": ["./src"]
32+
}]
3433
]
3534
}
3635
}

.eslintignore

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
examples/**
22
coverage/**
33
node_modules/**
4+
dist/**
5+
es/**
6+
lib/**
47
_book/**
58
_site/**
69
test/mocha.opts
10+
docs/**

.travis.yml

+12-3
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ language: node_js
44

55
node_js:
66
- 6.11.5 # Cloud Functions Runtime (Used for firebase-functions)
7-
- 8 # L.T.S
8-
- 9 # Current
7+
- 8
8+
- 9
99

1010
notifications:
1111
# Only send notifications when travis status changes
@@ -24,12 +24,21 @@ cache:
2424
branches:
2525
only:
2626
- master
27-
- v2.0.0
27+
- next
2828

2929
script:
3030
- npm run lint
3131
- npm run test:cov
3232

33+
deploy:
34+
skip_cleanup: true
35+
provider: npm
36+
email: $NPM_EMAIL
37+
api_key: $NPM_TOKEN
38+
on:
39+
node: '9'
40+
branch: 'master'
41+
3342
after_success:
3443
- npm install -g codeclimate-test-reporter
3544
- codeclimate-test-reporter < coverage/lcov.info

README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ import { reactReduxFirebase, firebaseReducer } from 'react-redux-firebase'
5353
import firebase from 'firebase'
5454
// import { reduxFirestore, firestoreReducer } from 'redux-firestore' // <- needed if using firestore
5555
// import 'firebase/firestore' // <- needed if using firestore
56+
// import 'firebase/functions' // <- needed if using httpsCallable
5657

5758
const firebaseConfig = {}
5859

@@ -62,11 +63,12 @@ const rrfConfig = {
6263
// useFirestoreForProfile: true // Firestore for Profile instead of Realtime DB
6364
}
6465

65-
// initialize firebase instance
66+
// Initialize firebase instance
6667
firebase.initializeApp(firebaseConfig)
6768

68-
// initialize firestore
69+
// Initialize other services on firebase instance
6970
// firebase.firestore() // <- needed if using firestore
71+
// firebase.functions() // <- needed if using httpsCallable
7072

7173
// Add reactReduxFirebase enhancer when making store creator
7274
const createStoreWithFirebase = compose(

docs/api/constants.md

+10-4
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,13 @@ Default configuration options
8787
- `sessions` **([String][4] \| [Function][5])** `sessions` Location on Firebase where user
8888
sessions are stored (only if presense is set). Often set to `'sessions'` or
8989
`'userSessions'`. If a function is passed, the arguments are: `(currentUser, firebase)`.
90-
- `enableLogging` **[Boolean][6]** `false` Whether or not firebase
91-
database logging is enabled.
92-
- `preserveOnLogout` **([Array][7] \| [Object][8])** `null` Data parameters to
90+
- `enableLogging` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** `false` Whether or not firebase
91+
database logging is enabled. Providing `true` turns on error logging
92+
(enabled by itself through `logErrors`).
93+
- `logErrors` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** `true` Whether or not to log internal
94+
Firebase errors (i.e. error querying or writing data) to the javascript
95+
console .
96+
- `preserveOnLogout` **([Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array) \| [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object))** `null` Data parameters to
9397
preserve when logging out. If Array is passed, each item represents keys
9498
within state.firebase.data preserve. If an object is passed, Keys associate
9599
with parts of state to preserve, and the values are Arrays contain keys
@@ -103,7 +107,9 @@ Default configuration options
103107
whatever is returned from the function is set to that slice of state (`auth`).
104108
- `updateProfileOnLogin` **[Boolean][6]** `true` Whether or not to update
105109
user profile when logging in.
106-
- `resetBeforeLogin` **[Boolean][6]** `true` Whether or not to reset auth
110+
- `useFirestoreForStorageMeta` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** `false` Write storage
111+
file metadata to Firestore instead of Real Time Database.
112+
- `resetBeforeLogin` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** `true` Whether or not to reset auth
107113
and profile when logging in (see issue
108114
[#254][9]
109115
for more details).

docs/api/enhancer.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,11 @@ along side applyMiddleware.
4343
preserve when logging out. Keys associate with parts of state to preserve,
4444
and the values are Arrays contain keys for keys within that slice of state
4545
to preserve.
46-
- `config.enableRedirectHandling` **[Boolean][4]** Whether or not to enable
46+
- `config.useFirestoreForProfile` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** `false` Write profile
47+
data to Firestore instead of Real Time Database.
48+
- `config.useFirestoreForStorageMeta` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** `false` Write storage
49+
file metadata to Firestore instead of Real Time Database.
50+
- `config.enableRedirectHandling` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Whether or not to enable
4751
auth redirect handling listener. (default: `true`)
4852
- `config.onAuthStateChanged` **[Function][5]** Function run when auth state
4953
changes. Argument Pattern: `(authData, firebase, dispatch)`

examples/complete/material/build/webpack.config.js

-14
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ const path = require('path')
22
const webpack = require('webpack')
33
const HtmlWebpackPlugin = require('html-webpack-plugin')
44
const ExtractTextPlugin = require('extract-text-webpack-plugin')
5-
const FaviconsWebpackPlugin = require('favicons-webpack-plugin')
65
const project = require('../project.config')
76

87
const inProject = path.resolve.bind(path, project.basePath)
@@ -254,19 +253,6 @@ if (__PROD__) {
254253
if_return: true,
255254
join_vars: true
256255
}
257-
}),
258-
new FaviconsWebpackPlugin({
259-
logo: 'static/logo.svg',
260-
inject: true,
261-
title: 'material-example',
262-
persistentCache: true,
263-
icons: {
264-
favicons: true,
265-
appleIcon: true,
266-
appleStartup: true,
267-
firefox: true,
268-
android: true
269-
}
270256
})
271257
)
272258
}

0 commit comments

Comments
 (0)