Skip to content

Conversation

@javamonn
Copy link
Contributor

@javamonn javamonn commented May 15, 2017

Description

Adds various features supporting populates that we found to be missing for our use-case. I've ensured the tests pass and functionally everything appears to work. We could consider splitting this PR up if some features are deemed undesired for merge.

  • Adds support for lodash supported path syntax in populates.child, e.g. this.is.a.nested.prop. This was added to support populating on ids that may be nested arbitrarily in the top level object and primarily required changing direct JS prop accessors foo[bar], foo.bar to _.get(foo, bar)
  • Adds support for per-item populates configurations by specifying a function callback that generates the populates configuration from the top level (key, item) tuple. This enables dynamically populating items, such as using the top level key when building the root path, or to only populate items passing a test when querying for a list.
  • Adds support for storeAs when populates is configured to continue working around bug(populates): populates clears all data at root #130 - is there a reason why this shouldn't work?

Check List

  • All test passed
  • Added test to ensure to fix/ensure properly.

@javamonn
Copy link
Contributor Author

Hmm, the test suite passes for me locally, will have a look later this afternoon.

@codecov
Copy link

codecov bot commented May 15, 2017

Codecov Report

❗ No coverage uploaded for pull request base (v1.5.0@df2a81a). Click here to learn what that means.
The diff coverage is 98.5%.

@@            Coverage Diff            @@
##             v1.5.0     #132   +/-   ##
=========================================
  Coverage          ?   89.03%           
=========================================
  Files             ?       17           
  Lines             ?     1413           
  Branches          ?      229           
=========================================
  Hits              ?     1258           
  Misses            ?      155           
  Partials          ?        0

@prescottprue
Copy link
Owner

prescottprue commented May 15, 2017

These are awesome additions to populate! Going to test it out today, and look into when this should be merged.

@prescottprue prescottprue self-requested a review May 15, 2017 15:55
@prescottprue prescottprue changed the base branch from master to v1.5.0 May 16, 2017 18:49
@prescottprue
Copy link
Owner

These features have been added to the roadmap for v1.5.0.

Going to mere into v1.5.0 branch for now. Hoping to have an alpha version of v1.5.0 soon.

@prescottprue prescottprue self-assigned this May 16, 2017
@prescottprue prescottprue added this to the v1.5.0 milestone May 16, 2017
@prescottprue prescottprue reopened this May 17, 2017
requested: true
})
})
dispatch({
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This got moved to the dispatch after the populate children dispatches (keeps isLoaded from being true before all children are set to redux)

@prescottprue prescottprue merged commit 4e212dd into prescottprue:v1.5.0 May 17, 2017
@prescottprue prescottprue mentioned this pull request May 18, 2017
3 tasks
prescottprue added a commit that referenced this pull request May 23, 2017
### Description
* Adds `updateProfile`, `updateAuth`, and `updateEmail` methods that dispatch associated start/success/failure actions
* Adds multiple features to populate - #132
* Uses `prop-types` instead of importing from react - #122 
* `distpatchOnUnsetListener` fixed to be `dispatchOnUnsetListener` (depreciation warning added along with a test confirm it is displayed)
* Do not include `dbPath` in response from `deleteFile` method if it is undefined (test added to check this case)
* `.eslintrc` file now using yaml format instead of JSON format (easier to read)
* Unnessesary global eslint comments removed from tests (no longer needed due to globals being moved to `.eslintrc`)
* `enableEmptyAuthChanges` config option added - #137

### Check List

- [X] All tests passing
- [X] Docs updated with any changes or examples
- [X] Added tests to ensure feature(s) work properly

### Relevant Issues
* [#122](https://github.com/prescottprue/react-redux-firebase/issues/#122)
* [#132](https://github.com/prescottprue/react-redux-firebase/issues/#132)
* [#137](https://github.com/prescottprue/react-redux-firebase/issues/#137)
@prescottprue prescottprue mentioned this pull request Sep 7, 2017
prescottprue added a commit that referenced this pull request Sep 18, 2017
🍾 🥂 The long awaited v1.5.0 release 🥂 🍾 

### Breaking Changes
* `browser` field has been removed from `package.json` which means commonJS build is used instead of `UMD` build from Webpack (much smaller)
* [firebaseConnect] Uses `prop-types` instead of importing from React - #122 

### Core
* [firebaseConnect] Allow usage of different stores in `firebaseConnect` - #148, #29
* [firebaseConnect] statics are now hoisted thanks to `hoist-non-react-statics`
* [firebaseConnect] exposed `createFirebaseConnect` for creating `firebaseConnect` HOCs connected to different stores
* [auth] `login` method supports `credential` parameter (with matching docs and tests updates)
* [auth] deprecation warning added for `token` and `provider` combo in `login` method
* [auth] Adds `updateProfile`, `updateAuth`, and `updateEmail` methods that dispatch associated start/success/failure actions
* [helpers] `deleteFile` method response no longer includes `dbPath` if it is undefined (test added to check this case)
* [helpers] No more race condition with `uniqueSet` - #207
* [typescript] Typescript typings - #142, #214 
* [query] `watchEvent` accepts options object as third argument
* [populate] Lodash path syntax support - #132
* [populate] accept a function for populate for item based populate config - #132
* [populate] Profile population (`profileParamsToPopulate`) supports single item and list population - #203
* [storage] `uploadFile` and `uploadFiles` no longer track progress by default (`storageRef.put` called directly)
* [config] Usage of `profileFactory` is wrapped in try/catch to handle and reject errors within provided factory function
* [config] `distpatchOnUnsetListener` spelling fixed to be `dispatchOnUnsetListener` (depreciation warning added along with a test confirm it is displayed)
* [config] `enableEmptyAuthChanges` config option added - #137


### Build
* Firebase is now an external in Webpack config (shrinks UMD build size)
* `.npmignore` expanded to include more files that do not needed to be included in published version (including `.babelrc` which can cause build errors)
* `.babelrc` settings are now environment specific (decorators only used in testing)
* `babel-preset-stage-1` removed (unnecessary)
* `.eslintrc` added to tests folder which contains globals that are only necessary for testing (simplifies top level eslint config)
* `.eslintrc` file now using yaml format instead of JSON format (easier to read)
* `async/await` added to unit tests
* Webpack 2
* [`firebase-server`](https://github.com/urish/firebase-server) used in tests instead of connecting to a real Firebase instance

### Docs
* Query docs updated with `storeAs` and `keyProp` query options
* `redux-persist` recipe added
prescottprue added a commit that referenced this pull request Sep 18, 2017
🍾 🥂 The long awaited v1.5.0 release 🥂 🍾

* `browser` field has been removed from `package.json` which means commonJS build is used instead of `UMD` build from Webpack (much smaller)
* [firebaseConnect] Uses `prop-types` instead of importing from React - #122

* [firebaseConnect] Allow usage of different stores in `firebaseConnect` - #148, #29
* [firebaseConnect] statics are now hoisted thanks to `hoist-non-react-statics`
* [firebaseConnect] exposed `createFirebaseConnect` for creating `firebaseConnect` HOCs connected to different stores
* [auth] `login` method supports `credential` parameter (with matching docs and tests updates)
* [auth] deprecation warning added for `token` and `provider` combo in `login` method
* [auth] Adds `updateProfile`, `updateAuth`, and `updateEmail` methods that dispatch associated start/success/failure actions
* [helpers] `deleteFile` method response no longer includes `dbPath` if it is undefined (test added to check this case)
* [helpers] No more race condition with `uniqueSet` - #207
* [typescript] Typescript typings - #142, #214
* [query] `watchEvent` accepts options object as third argument
* [populate] Lodash path syntax support - #132
* [populate] accept a function for populate for item based populate config - #132
* [populate] Profile population (`profileParamsToPopulate`) supports single item and list population - #203
* [storage] `uploadFile` and `uploadFiles` no longer track progress by default (`storageRef.put` called directly)
* [config] Usage of `profileFactory` is wrapped in try/catch to handle and reject errors within provided factory function
* [config] `distpatchOnUnsetListener` spelling fixed to be `dispatchOnUnsetListener` (depreciation warning added along with a test confirm it is displayed)
* [config] `enableEmptyAuthChanges` config option added - #137

* Firebase is now an external in Webpack config (shrinks UMD build size)
* `.npmignore` expanded to include more files that do not needed to be included in published version (including `.babelrc` which can cause build errors)
* `.babelrc` settings are now environment specific (decorators only used in testing)
* `babel-preset-stage-1` removed (unnecessary)
* `.eslintrc` added to tests folder which contains globals that are only necessary for testing (simplifies top level eslint config)
* `.eslintrc` file now using yaml format instead of JSON format (easier to read)
* `async/await` added to unit tests
* Webpack 2
* [`firebase-server`](https://github.com/urish/firebase-server) used in tests instead of connecting to a real Firebase instance

* Query docs updated with `storeAs` and `keyProp` query options
* `redux-persist` recipe added
prescottprue added a commit that referenced this pull request Sep 18, 2017
🍾 🥂 The long awaited v1.5.0 release 🥂 🍾

* `browser` field has been removed from `package.json` which means commonJS build is used instead of `UMD` build from Webpack (much smaller)
* [firebaseConnect] Uses `prop-types` instead of importing from React - #122

* [firebaseConnect] Allow usage of different stores in `firebaseConnect` - #148, #29
* [firebaseConnect] statics are now hoisted thanks to `hoist-non-react-statics`
* [firebaseConnect] exposed `createFirebaseConnect` for creating `firebaseConnect` HOCs connected to different stores
* [auth] `login` method supports `credential` parameter (with matching docs and tests updates)
* [auth] deprecation warning added for `token` and `provider` combo in `login` method
* [auth] Adds `updateProfile`, `updateAuth`, and `updateEmail` methods that dispatch associated start/success/failure actions
* [helpers] `deleteFile` method response no longer includes `dbPath` if it is undefined (test added to check this case)
* [helpers] No more race condition with `uniqueSet` - #207
* [typescript] Typescript typings - #142, #214
* [query] `watchEvent` accepts options object as third argument
* [populate] Lodash path syntax support - #132
* [populate] accept a function for populate for item based populate config - #132
* [populate] Profile population (`profileParamsToPopulate`) supports single item and list population - #203
* [storage] `uploadFile` and `uploadFiles` no longer track progress by default (`storageRef.put` called directly)
* [config] Usage of `profileFactory` is wrapped in try/catch to handle and reject errors within provided factory function
* [config] `distpatchOnUnsetListener` spelling fixed to be `dispatchOnUnsetListener` (depreciation warning added along with a test confirm it is displayed)
* [config] `enableEmptyAuthChanges` config option added - #137

* Firebase is now an external in Webpack config (shrinks UMD build size)
* `.npmignore` expanded to include more files that do not needed to be included in published version (including `.babelrc` which can cause build errors)
* `.babelrc` settings are now environment specific (decorators only used in testing)
* `babel-preset-stage-1` removed (unnecessary)
* `.eslintrc` added to tests folder which contains globals that are only necessary for testing (simplifies top level eslint config)
* `.eslintrc` file now using yaml format instead of JSON format (easier to read)
* `async/await` added to unit tests
* Webpack 2
* [`firebase-server`](https://github.com/urish/firebase-server) used in tests instead of connecting to a real Firebase instance

* Query docs updated with `storeAs` and `keyProp` query options
* `redux-persist` recipe added
prescottprue added a commit that referenced this pull request Sep 18, 2017
🍾 🥂 The long awaited v1.5.0 release 🥂 🍾

* `browser` field has been removed from `package.json` which means commonJS build is used instead of `UMD` build from Webpack (much smaller)
* [firebaseConnect] Uses `prop-types` instead of importing from React - #122

* [firebaseConnect] Allow usage of different stores in `firebaseConnect` - #148, #29
* [firebaseConnect] statics are now hoisted thanks to `hoist-non-react-statics`
* [firebaseConnect] exposed `createFirebaseConnect` for creating `firebaseConnect` HOCs connected to different stores
* [auth] `login` method supports `credential` parameter (with matching docs and tests updates)
* [auth] deprecation warning added for `token` and `provider` combo in `login` method
* [auth] Adds `updateProfile`, `updateAuth`, and `updateEmail` methods that dispatch associated start/success/failure actions
* [helpers] `deleteFile` method response no longer includes `dbPath` if it is undefined (test added to check this case)
* [helpers] No more race condition with `uniqueSet` - #207
* [typescript] Typescript typings - #142, #214
* [query] `watchEvent` accepts options object as third argument
* [populate] Lodash path syntax support - #132
* [populate] accept a function for populate for item based populate config - #132
* [populate] Profile population (`profileParamsToPopulate`) supports single item and list population - #203
* [storage] `uploadFile` and `uploadFiles` no longer track progress by default (`storageRef.put` called directly)
* [config] Usage of `profileFactory` is wrapped in try/catch to handle and reject errors within provided factory function
* [config] `distpatchOnUnsetListener` spelling fixed to be `dispatchOnUnsetListener` (depreciation warning added along with a test confirm it is displayed)
* [config] `enableEmptyAuthChanges` config option added - #137

* Firebase is now an external in Webpack config (shrinks UMD build size)
* `.npmignore` expanded to include more files that do not needed to be included in published version (including `.babelrc` which can cause build errors)
* `.babelrc` settings are now environment specific (decorators only used in testing)
* `babel-preset-stage-1` removed (unnecessary)
* `.eslintrc` added to tests folder which contains globals that are only necessary for testing (simplifies top level eslint config)
* `.eslintrc` file now using yaml format instead of JSON format (easier to read)
* `async/await` added to unit tests
* Webpack 2
* [`firebase-server`](https://github.com/urish/firebase-server) used in tests instead of connecting to a real Firebase instance

* Query docs updated with `storeAs` and `keyProp` query options
* `redux-persist` recipe added
prescottprue added a commit that referenced this pull request Sep 18, 2017
🍾 🥂 The long awaited v1.5.0 release 🥂 🍾

* `browser` field has been removed from `package.json` which means commonJS build is used instead of `UMD` build from Webpack (much smaller)
* [firebaseConnect] Uses `prop-types` instead of importing from React - #122

* [firebaseConnect] Allow usage of different stores in `firebaseConnect` - #148, #29
* [firebaseConnect] statics are now hoisted thanks to `hoist-non-react-statics`
* [firebaseConnect] exposed `createFirebaseConnect` for creating `firebaseConnect` HOCs connected to different stores
* [auth] `login` method supports `credential` parameter (with matching docs and tests updates)
* [auth] deprecation warning added for `token` and `provider` combo in `login` method
* [auth] Adds `updateProfile`, `updateAuth`, and `updateEmail` methods that dispatch associated start/success/failure actions
* [helpers] `deleteFile` method response no longer includes `dbPath` if it is undefined (test added to check this case)
* [helpers] No more race condition with `uniqueSet` - #207
* [typescript] Typescript typings - #142, #214
* [query] `watchEvent` accepts options object as third argument
* [populate] Lodash path syntax support - #132
* [populate] accept a function for populate for item based populate config - #132
* [populate] Profile population (`profileParamsToPopulate`) supports single item and list population - #203
* [storage] `uploadFile` and `uploadFiles` no longer track progress by default (`storageRef.put` called directly)
* [config] Usage of `profileFactory` is wrapped in try/catch to handle and reject errors within provided factory function
* [config] `distpatchOnUnsetListener` spelling fixed to be `dispatchOnUnsetListener` (depreciation warning added along with a test confirm it is displayed)
* [config] `enableEmptyAuthChanges` config option added - #137

* Firebase is now an external in Webpack config (shrinks UMD build size)
* `.npmignore` expanded to include more files that do not needed to be included in published version (including `.babelrc` which can cause build errors)
* `.babelrc` settings are now environment specific (decorators only used in testing)
* `babel-preset-stage-1` removed (unnecessary)
* `.eslintrc` added to tests folder which contains globals that are only necessary for testing (simplifies top level eslint config)
* `.eslintrc` file now using yaml format instead of JSON format (easier to read)
* `async/await` added to unit tests
* Webpack 2
* [`firebase-server`](https://github.com/urish/firebase-server) used in tests instead of connecting to a real Firebase instance

* Query docs updated with `storeAs` and `keyProp` query options
* `redux-persist` recipe added
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants