-
-
Notifications
You must be signed in to change notification settings - Fork 553
Version v1.4.0 #133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Version v1.4.0 #133
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### 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
Signed-off-by: petetnt <[email protected]>
### 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 Report
@@ 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 |
…base feature info.
….4.0 release * Added notes from #93 to simple example.
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)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Version v1.4.0 release, which consists of all features/bugfixes from all v1.4.0-* pre-releases
Features
react-nativesupport (including complete example app as well as a create your own recipe)pushWithMeta,setWithMeta, andupdateWithMetamethods added - write to firebase with createdAt/updatedAt and createdBy/updatedByunWatchEventhelper dispatch mapping - #82populatedDataToJStriggersisLoadedto be true only when all data is populated (instead of once for unpopulated data) - #121provider.setCustomParameterson external auth providers (i.e.provider.setCustomParameters({ prompt: 'select_account' }))notParsedquery param option added for not parsing when usingequalTo(for searching numbers stored as strings)profileParamsToPopulatenow works for$key: truelists (thanks @fej-snikduj)onRedirectResultconfig option added (callback that runs when redirect result occurs)Enhancements/Fixes
UserIsAuthenticatedHOC fromutils/router)v3.9.0unWatchEventhelper dispatch mapping - #82build:sizenpm script added to generate size report for minified bundle - #107userandcredentialare now returned from login method - #106yarn.lockfile addedCheck List