Skip to content

Commit

Permalink
Hooks API and separate packages (#129)
Browse files Browse the repository at this point in the history
* Start 3.0 refactor, separate modules into separate packages

* Make network interface required param to middleware

* useRequest hook

* useMutation, more tests and fixes

* Rewrite connectRequest with hooks

* Build config fixes

* Make build script executable

* Fix build

* Try using lerna without yarn workspaces

* v3.0.0-alpha.0

* More build fixes, start fixing site

* Get site working and update react-scripts, fix UMD builds

* Fix site dependencies

* Set preset-env node target to current to fix async tests

* v3.0.0-alpha.1

* v3.0.0-alpha.2

* Update gitHead

* Run prettier on site

* Better superagent interface tests

* Ignore dist files when analyzing test coverage

* Handle null query config params

Add more tests. Change getQueryKey to support null param. Fix memoized
action returning wrong action when query key changes.

* v3.0.0-alpha.3

* Only set babel node target for test env

* Simplify connectRequest diffing and remove some lodash libs

* Rename useMemoizedAction to useMemoizedQueryConfig

* Return the mutation promise from mutate callback

* Read query state from redux and return from hooks

* v3.0.0-alpha.4

* Start flow types

* Remove networkHandler from redux state

* Fix superagent interface build

* v3.0.0-alpha.5

* Run flow check on travis

* Add flow types to actions, query middleware

* More flow types

* v3.0.0-alpha.6

* Babel load redux-query for redux-query-react

* v3.0.0-alpha.7

* v3.0.0-alpha.8

* Fix connectRequest flow issues, start some flow tests

* v3.0.0-alpha.9

* Fix mapPropsToConfigs types

* Update dependencies

* v3.0.0-alpha.10

* Use main entry points for imports

* v3.0.0-alpha.11

* Make redux-query peer deps not regular deps

* v3.0.0-alpha.12

* Fix connectRequest retry behavior and add tests

* v3.0.0-alpha.13

* New site

* Don't dispatch cancel actions for requests that aren't pending

* Fix connectRequest cancelling requests that it shouldn't

* v3.0.0-alpha.14

* New site

* Delete build.sh (lerna bootstrap is equivalent)

* Update CONTRIBUTING

* Delete previous site

* v3.0.0-rc.0

* Make lib functions have safe defaults

* Fix useMutation return value

* Build flow entry points for all packages

* v3.0.0-rc.1

* Flow type fixes

* v3.0.0-rc.2

* Export Action type from src/types

* Add top-level types.flow entrypoint

* v3.0.0-rc.3

* Fix careless mistake in READMEs

* Use standard .js.flow extension for types

* v3.0.0-rc.4

* Add more links in docs

* Configure algolia search

* "React hooks"

* Fix build script

* Make useMutation take a callback instead of a query config

* v3.0.0-rc.5

* Update simple example

* Fix useMutation example bugs

* More code comments and code cleanup

* Improved useMutation docs

* Improved flow types

* Fix typo

* v3.0.0-rc.6

* Fix pick implementation

* v3.0.0-rc.7

* Add transition note about forwardRef

* v3.0.0
  • Loading branch information
Ryan Ashcraft committed Jun 25, 2019
1 parent 7dda816 commit 3a89acd
Show file tree
Hide file tree
Showing 176 changed files with 33,818 additions and 23,751 deletions.
6 changes: 0 additions & 6 deletions .babelrc

This file was deleted.

3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

119 changes: 0 additions & 119 deletions .eslintrc

This file was deleted.

15 changes: 15 additions & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

[ignore]

[include]
packages/*/src

[libs]

[options]
include_warnings=true
suppress_comment= \\(.\\|\n\\)*\\$FlowFixMe
suppress_comment= \\(.\\|\n\\)*\\$FlowIssue
suppress_comment= \\(.\\|\n\\)*\\$FlowIgnore
suppress_type=$FlowFixMe
suppress_type=$FlowSubtype
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
*.lcov
.nyc_output
*.log
coverage
dist
node_modules
Expand Down
5 changes: 5 additions & 0 deletions .huskyrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
hooks: {
'pre-commit': 'pretty-quick --staged',
},
};
9 changes: 0 additions & 9 deletions .npmignore

This file was deleted.

19 changes: 6 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
language: node_js
node_js:
- "node"
- 'node'
cache:
yarn: true
directories:
- node_modules
- examples/async/node_modules
- site/node_modules
yarn: true
script:
- yarn run build
- yarn run test:cov
- yarn install --cwd examples/async
- yarn run build:examples
- yarn install --cwd site
- yarn run build:site
- lerna bootstrap
- yarn run test
- yarn flow-check
after_success:
- yarn run coverage
- yarn run coverage
5 changes: 2 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ Please follow these rules for all code changes:
- Use [yarn](https://yarnpkg.com/) to install and commit lock file changes.
- When making feature improvements, please provide new tests.
- Code coverage for the project should stay above 90%.
- Please make sure to run `yarn run lint` to run eslint and format the code with prettier.
- Please test the changes with the redux-query site project. To do that, run `yarn run build:umd` from the root directory and `yarn run start` from the site directory. All examples should behave consistently with https://amplitude.github.io/redux-query/.
- Update the README and examples if adding new features or API changes.
- Please make sure to run `yarn test` to run jest.
- Update the docs if adding new features or making any API changes.
- Separate commits into distinct changes with clear messages.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Amplitude

The MIT License (MIT)

Copyright (c) 2017 Amplitude
Copyright (c) 2017-2019 Amplitude

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down

0 comments on commit 3a89acd

Please sign in to comment.