Skip to content

Conversation

@prescottprue
Copy link
Owner

@prescottprue prescottprue commented May 15, 2017

Description

Version v1.4.0 release, which consists of all features/bugfixes from all v1.4.0-* pre-releases

Features

  • react-native support (including complete example app as well as a create your own recipe)
  • Server Side Rendering Support - #72
  • Support for Boilerplates - #53
  • pushWithMeta, setWithMeta, and updateWithMeta methods added - write to firebase with createdAt/updatedAt and createdBy/updatedBy
  • Fix for unWatchEvent helper dispatch mapping - #82
  • populatedDataToJS triggers isLoaded to be true only when all data is populated (instead of once for unpopulated data) - #121
  • Support for provider.setCustomParameters on external auth providers (i.e. provider.setCustomParameters({ prompt: 'select_account' }))
  • notParsed query param option added for not parsing when using equalTo (for searching numbers stored as strings)
  • profileParamsToPopulate now works for $key: true lists (thanks @fej-snikduj)
  • onRedirectResult config option added (callback that runs when redirect result occurs)
  • Return file snapshot on upload - #88

Enhancements/Fixes

  • Improvements to Material Example
    • Projects route is now protected (using UserIsAuthenticated HOC from utils/router)
    • Todos list only displays first 8 (first at the top) - shows using ordering query params
    • Most main routes are now sync (more simple)
  • Firebase Library dependency updated to v3.9.0
  • Fix for unWatchEvent helper dispatch mapping - #82
  • Firebase version is no longer fixed - #109
  • Only used parts of Firebase Library imported (shrinks bundle size)
  • build:size npm script added to generate size report for minified bundle - #107
  • user and credential are now returned from login method - #106
  • yarn.lock file added
  • Compose tests improved promise handling (better use of chai-as-promised)

Check List

  • All test passed
  • Added tests to ensure features work properly
  • Document Any API Changes

urbantumbleweed and others added 30 commits March 23, 2017 17:17
#### What's this PR do?

The promise from 'uploadFile' now returns an object of the file data is decorated with a `pushKey` property that is the key generated by the call to `firebase.push`.  This change will give the caller the ability to access the urls, name and key for additional processing.

#### What are the important parts of the code?
a single `.then` with a spread

#### How should this be tested by the reviewer?
Ensure the caller of this function has access to the fileData in the returned promise.

#### Is any other information necessary to understand this?
This change is proposed as the caller may need to dispatch additional actions for use with redux/redux-observable that contain the information contained in the fileData.
**NOTE:** [The original pull request](#81) for this feature and its branch have the `dist` files included in git tracking (so the branch could be referenced in package files). This pull request does not include `dist` files.

## Features
* Initial support for `react-native` (should solve #80)
* Import only needed sections of Firebase library ( #72 and #53 )

## Notes About react-native
Support for `react-native` is still in the early testing phases. That means the API and/or functionality may change.

If using `react-native`, make sure you have the following config enabled when creating your store:

```js
import ReactNative from 'react-native'
import { compose, createStore } from 'redux';
import { reactReduxFirebase } from 'react-redux-firebase'
const firebaseConfig = {} // your firebase config object
const initialState = { firebase: { authError: null } };

// then in your config when creating store
const store = createStore(
    makeRootReducer(), 
    initialState,
    compose(
      reactReduxFirebase(
        firebaseConfig,
        {
           rn: ReactNative,
           enableRedirectHandling: false,
           userProfile: 'users' 
         },
      ),
    )
  );
```

Normal authentication methods, such as `firebase.login({provider: 'google', type: 'popup'})`, will not work due to Firebase's js library (used internally) not completely supporting `react-native`. That means you must use `firebase.auth().signInWithCredential(credential)` until there is more support within the Firebase library.

It might look something like this (untested):

```js
let credential = this.props.firebase.auth.GoogleAuthProvider.credential(token);
this.props.firebase.auth().signInWithCredential(credential)
  .then(() => {
    console.log('auth successful')
  })
  .catch((err) => {
    console.log('error: ', err)
  })
```
* Auth working using `signInWithAuthCredential` - Unsupported Browser
error fixed by importing firebase using `import * as firebase from
‘firebase’` instead of separate section imports
* react-native complete example now using isLoaded and displaying data
from react-redux-firebase
* Switched to using ReactNative instead of rn
* Roadmap updated with `react-native` stuff
* react-native complete example README added
### Breaking Changes
* react-native is now used differently in config when creating store which breaks `v1.4.0-alpha` ("rn" was not as clear as "ReactNative"). Use the following config when creating store:
  ```js
  import { reactReduxFirebase } from 'react-redux-firebase'
  import { AsyncStorage } from 'react-native'
  const fbConfig = {} // your firebase config object
  reactReduxFirebase(fbConfig, {
    ReactNative: { AsyncStorage }  // now under "ReactNative" instead of "rn"
    // enableRedirectHandling: false // no longer needed
  })
  ```
* firebase library imported using `import * as firebase from 'firebase'` instead of piece by piece to fix Unsupported Browser error from `v1.4.0-alpha` (thanks @kudorori - full details in #87). Could have impact on #52, #72, or #80.

### Features
* [react-native complete example](https://github.com/prescottprue/react-redux-firebase/tree/v1.4.0-beta/examples/complete/react-native) added showing authentication
* firebase library updated to `v3.7.3`
* Package quality image added to README
* Docs updated with react-native changes
* fix using with yarn - `.npmignore` file removed so that `.yarn.lock` file will not be included in npm release (only files listed in package file `files` property)
* `pushWithMeta`, `setWithMeta`, and `updateWithMeta` methods added - write to firebase with createdAt/updatedAt and createdBy/updatedBy
* Only importing used parts of Firebase Library (fixes self undefined issue)

```js
import * as firebase from 'firebase'

// switched to

import * as firebase from 'firebase/app'
import 'firebase/auth'
import 'firebase/database'
import 'firebase/storage'

```
# Conflicts:
#	package.json
* made use of [`hoist-non-react-statics`](https://github.com/mridgway/hoist-non-react-statics) (following pattern set forth in [`react-redux`'s connect](https://github.com/reactjs/react-redux/blob/master/src/components/connectAdvanced.js#L281)) to fix issue where statics where not being passed. For example, when using `StackNavigator` with react-native:

```js
@firebaseConnect() // <- was keeping statics from being passed
@connect(({ firebase }) => ({  // <- hoists statics
  auth: pathToJS(firebase, 'auth')
}))
export default class Home extends Component {
  static navigationOptions = {  // <- was not being passed to resulting wrapped component
    title: 'Some Title'
  }

  render () {
    return (
      <View>
        <Text>React Native + Firebase!</Text>
      </View>
    )
  }
}
```

* create your own react-native app instructions added to docs (including pictures)
* user and credential are now returned from login method (solves #106)
* `onRedirectResult` config option added (runs when redirect result occurs)
* Material-ui complete example updated to use field level validation
* Docs added for `onAuthStateChanged` and `onRedirectResult` config options
* #107 - `build:size` npm script added to generate size report for minified bundle
* #109 - Firebase version is not fixed - all v1.4.0-* versions use `^` on firebase
* Multiple Dependencies and Dev Dependencies updated (including `firebase` and `jwt-decode`)
* Yarn file updated
* Compose tests improved promise handling (better use of `chai-as-promised`)
* Linting removed from updated `eslint-config-standard` rules
# Conflicts:
#	README.md
#	examples/complete/material/src/constants/formNames.js
#
examples/complete/material/src/routes/Account/containers/AccountContaine
r.js
#
examples/complete/material/src/routes/Login/components/LoginForm/LoginFo
rm.js
#
examples/complete/material/src/routes/Login/containers/LoginContainer.js
#
examples/complete/material/src/routes/Signup/components/SignupForm/Signu
pForm.js
#
examples/complete/material/src/routes/Signup/containers/SignupContainer.
js
# Conflicts:
#	README.md
#	examples/complete/material/src/constants/formNames.js
#
examples/complete/material/src/routes/Account/containers/AccountContaine
r.js
#
examples/complete/material/src/routes/Login/components/LoginForm/LoginFo
rm.js
#
examples/complete/material/src/routes/Login/containers/LoginContainer.js
#
examples/complete/material/src/routes/Signup/components/SignupForm/Signu
pForm.js
#
examples/complete/material/src/routes/Signup/containers/SignupContainer.
js
* `notParsed` query parameter added
* #121 addressed - dispatch of main data called after child dispatches
have already been called
### Description
Non-breaking small feature addition to profile parameter population.  Profile population will now work on a list of UIDs, key:value pairs, and a single UID (which was already supported)
* Material example updates
  * /projects is now protected route
  * pushWithMeta is used in projects
  * comments updated
@codecov
Copy link

codecov bot commented May 15, 2017

Codecov Report

Merging #133 into master will decrease coverage by 2.87%.
The diff coverage is 73.68%.

@@            Coverage Diff             @@
##           master     #133      +/-   ##
==========================================
- Coverage   88.81%   85.93%   -2.88%     
==========================================
  Files          17       17              
  Lines        1368     1479     +111     
  Branches      225      243      +18     
==========================================
+ Hits         1215     1271      +56     
- Misses        153      208      +55

@prescottprue prescottprue self-assigned this May 16, 2017
prescottprue and others added 3 commits May 15, 2017 20:32
* Switched back to importing PropTypes from react due to (#128)
* Roadmap updated with population features coming in `v1.5.0`
@prescottprue prescottprue merged commit 8bd5a2a into master May 17, 2017
@prescottprue prescottprue deleted the v1.4.0 branch May 17, 2017 22:36
@prescottprue prescottprue restored the v1.4.0 branch May 17, 2017 22:36
prescottprue added a commit that referenced this pull request May 17, 2017
* `react-native` support (including [complete example](https://github.com/prescottprue/react-redux-firebase/tree/v1.4.0-beta/examples/complete/react-native) app as well as a [create your own recipe](/docs/recipes/react-native.md))
* Server Side Rendering Support ([#72](#72))
* Support for Boilerplates ([#53](#53))
* `pushWithMeta`, `setWithMeta`, and `updateWithMeta` methods added - write to firebase with createdAt/updatedAt and createdBy/updatedBy
* Fix for `unWatchEvent` helper dispatch mapping (#82)
* `populatedDataToJS` triggers `isLoaded` to be true only when all data is populated (instead of once for unpopulated data) [#121](#121)
* Support for `provider.setCustomParameters` on external auth providers (i.e. `provider.setCustomParameters({ prompt: 'select_account' })`)
* `notParsed` query param option added for not parsing when using `equalTo` (for searching numbers stored as strings)
* `profileParamsToPopulate` now works for `$key: true` lists (thanks @fej-snikduj)
* `onRedirectResult` config option added (runs when redirect result occurs)

* Improvements to Material Example
  * Projects route is now protected (using `UserIsAuthenticated` HOC from `utils/router`)
  * Todos list only displays first 8 (first at the top) - shows using ordering query params
  * Most main routes are now sync (more simple)
* Firebase Library dependency updated to [`v3.9.0`](https://firebase.google.com/support/release-notes/js)
* Fix for `unWatchEvent` helper dispatch mapping ([#82](#82))
* Firebase version is no longer fixed ([#109](#109))
* Only used parts of Firebase Library imported (shrinks bundle size)
* `build:size` npm script added to generate size report for minified bundle ([#107](#107))
* `user` and `credential` are now returned from login method (solves [#106](#106))
* `yarn.lock` file added
* Compose tests improved promise handling (better use of chai-as-promised)
* `profileParamsToPopulate` now accepts `key: true` lists - thanks [@fej-snikduj](https://github.com/fej-snikduj)
@prescottprue prescottprue deleted the v1.4.0 branch October 3, 2017 00:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants