Skip to content

Commit

Permalink
chore: 🤖 don't install only large dependencies
Browse files Browse the repository at this point in the history
This change removes useCallbag hook, it also reverts back changes for
hooks that only have tiny dependencies or dependencies that could have
been part of the hook itself. Effectivly only KeyboardJS and Rebound are
large packages that only partially are used by react-use, hence require
user to install them separately.

BREAKING CHANGE: 🧨 useCallbag hook is removed, some hooks KeyboardJS and Rebound installed
separately
  • Loading branch information
streamich committed Mar 25, 2019
1 parent 3d0a82f commit 6170067
Show file tree
Hide file tree
Showing 13 changed files with 10 additions and 71 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@
<br/>
- [**State**](./docs/State.md)
- [`createMemo`](./docs/createMemo.md) &mdash; factory of memoized hooks.
- [`useCallbag`](./docs/useCallbag.md) &mdash; tracks latest value of a callbag.
- [`useGetSet`](./docs/useGetSet.md) &mdash; returns state getter `get()` instead of raw state.
- [`useGetSetState`](./docs/useGetSetState.md) &mdash; as if [`useGetSet`](./docs/useGetSet.md) and [`useSetState`](./docs/useSetState.md) had a baby.
- [`useObservable`](./docs/useObservable.md) &mdash; tracks latest value of an `Observable`.
Expand Down
22 changes: 0 additions & 22 deletions docs/useCallbag.md

This file was deleted.

7 changes: 0 additions & 7 deletions docs/useCss.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,6 @@ React side-effect hook that changes [CSS dynamically][gen-5]. Works like "virtua
it re-renders only CSS rules that change. It is different from inline styles, because
you can use media queries and pseudo selectors.

Requires `nano-css`:
```bash
npm add nano-css
# or
yarn add nano-css
```


## Usage

Expand Down
7 changes: 0 additions & 7 deletions docs/useIdle.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@

React sensor hook that tracks if user on the page is idle.

Requires `throttle-debounce`:
```bash
npm add throttle-debounce
# or
yarn add throttle-debounce
```


## Usage

Expand Down
1 change: 1 addition & 0 deletions docs/useKeyPress.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ via [KeyboardJS key combos](https://github.com/RobertWHurst/KeyboardJS).
Check its documentation for further details on how to make combo strings.

Requires `keyboardjs`:

```bash
npm add keyboardjs
# or
Expand Down
1 change: 1 addition & 0 deletions docs/useKeyPressEvent.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ if a second and third argument are passed, the second will be used in the keyup
event and the third in the keydown event. Essentially, keydown takes precedence.

Requires `keyboardjs`:

```bash
npm add keyboardjs
# or
Expand Down
1 change: 1 addition & 0 deletions docs/useOutsideClick.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ React UI hook that triggers a callback when user
clicks outside the target element.

Requires `use-onclickoutside`:

```bash
npm add use-onclickoutside
# or
Expand Down
1 change: 1 addition & 0 deletions docs/useSpring.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ React animation hook that updates a single numeric value over time according
to spring dynamics.

Requires `rebound`:

```bash
npm add rebound
# or
Expand Down
6 changes: 0 additions & 6 deletions docs/useTween.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ React animation hook that tweens a number between 0 and 1.

[![](https://img.shields.io/badge/demo-useTween-green.svg)](https://codesandbox.io/s/52990wwzyl)

Requires `ts-easing`:
```bash
npm add ts-easing
# or
yarn add ts-easing
```

## Usage

Expand Down
6 changes: 0 additions & 6 deletions docs/useWait.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@

`useWait` is a React Hook helps to manage multiple loading states on the page without any conflict. It's based on a very simple idea that manages an `Array` of multiple loading states. The built-in `Wait` component listens its registered loader and immediately become loading state.

Requires `react-wait`:
```bash
npm add react-wait
# or
yarn add react-wait
```

## Usage

Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@
},
"homepage": "https://github.com/streamich/react-use#readme",
"dependencies": {
"@types/react": "^16.8.2"
},
"devDependencies": {
"keyboardjs": "^2.5.1",
"nano-css": "^5.0.0",
"react-wait": "^0.3.0",
"rebound": "^0.1.0",
"throttle-debounce": "^2.0.1",
"ts-easing": "^0.2.0",
"use-callbag": "^0.2.0",
"use-onclickoutside": "^0.3.0"
},
"devDependencies": {
"@types/react": "^16.8.2",
"keyboardjs": "^2.5.1",
"rebound": "^0.1.0",
"use-onclickoutside": "^0.3.0",
"@semantic-release/changelog": "3.0.2",
"@semantic-release/git": "7.0.8",
Expand Down
4 changes: 0 additions & 4 deletions src/useCallbag.ts

This file was deleted.

12 changes: 0 additions & 12 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3101,11 +3101,6 @@ [email protected]:
dependencies:
callbag "^1.1.0"

callbag-subscribe@^1.4.1:
version "1.4.1"
resolved "https://registry.yarnpkg.com/callbag-subscribe/-/callbag-subscribe-1.4.1.tgz#f9bd86b713230c9113acf6b7c5c6baf7d5ec772f"
integrity sha512-FzvJK3ODP50UhZPhfCFwJZ+YP+Hg/6Fm1+d3m2UZacA1b+jSKARpyNTIpkWlf61rAHEgpwZF1head4URY+EEMw==

callbag@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/callbag/-/callbag-1.1.0.tgz#9cbbc3352832da43e764d588ed43121d4b09c42a"
Expand Down Expand Up @@ -11088,13 +11083,6 @@ url@^0.11.0:
punycode "1.3.2"
querystring "0.2.0"

use-callbag@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/use-callbag/-/use-callbag-0.2.0.tgz#bf3bbef918effc5818e0149f44d8b7385a7d03f1"
integrity sha512-ml1cDc2ZwieqXv+AtgPZUl6UWmYN/4roZgBg+LgFrU1s8khdTVEaj44utQwughw5qJDxEZ1lIOrdWEJvbO6cMA==
dependencies:
callbag-subscribe "^1.4.1"

use-onclickoutside@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/use-onclickoutside/-/use-onclickoutside-0.3.0.tgz#a7c6bb68c8643c9a3437e34840d0cb2b96ae32b1"
Expand Down

0 comments on commit 6170067

Please sign in to comment.