Skip to content
This repository was archived by the owner on Jul 8, 2023. It is now read-only.

Commit 5fef1a5

Browse files
committed
🛠️ no need for Recompose as a peer dependency
1 parent 28b3021 commit 5fef1a5

File tree

52 files changed

+123
-98
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+123
-98
lines changed

packages/debounce-handler/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
"access": "public"
2626
},
2727
"dependencies": {
28-
"just-debounce-it": "^1.0.1"
28+
"just-debounce-it": "^1.0.1",
29+
"react-display-name": "^0.2.4"
2930
},
3031
"peerDependencies": {
31-
"react": "^16.3.0",
32-
"recompose": "^0.27.0"
32+
"react": "^16.3.0"
3333
}
3434
}

packages/debounce-handler/readme.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Helps to debounce handlers like `onChange`.
99
## Install
1010

1111
```
12-
yarn add recompose @hocs/debounce-handler
12+
yarn add @hocs/debounce-handler
1313
```
1414

1515
## Usage

packages/debounce-handler/src/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { createElement, Component } from 'react'
2-
import { setDisplayName, wrapDisplayName } from 'recompose'
2+
import getDisplayName from 'react-display-name'
33
import debounce from 'just-debounce-it'
44

55
const debounceHandler = (handlerName, delay, leadingCall) => (Target) => {
@@ -27,7 +27,7 @@ const debounceHandler = (handlerName, delay, leadingCall) => (Target) => {
2727
}
2828

2929
if (process.env.NODE_ENV !== 'production') {
30-
return setDisplayName(wrapDisplayName(Target, 'debounceHandler'))(DebounceHandler)
30+
DebounceHandler.displayName = `debounceHandler(${getDisplayName(Target)})`
3131
}
3232

3333
return DebounceHandler

packages/omit-props/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
"access": "public"
2626
},
2727
"dependencies": {
28-
"just-omit": "^1.0.1"
28+
"just-omit": "^1.0.1",
29+
"react-display-name": "^0.2.4"
2930
},
3031
"peerDependencies": {
31-
"react": "^16.3.0",
32-
"recompose": "^0.27.0"
32+
"react": "^16.3.0"
3333
}
3434
}

packages/omit-props/readme.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Helps to omit unnecessary context prop, state setters or anything else you don't
99
## Install
1010

1111
```
12-
yarn add recompose @hocs/omit-props
12+
yarn add @hocs/omit-props
1313
```
1414

1515
## Usage

packages/omit-props/src/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { createElement } from 'react'
2-
import { setDisplayName, wrapDisplayName } from 'recompose'
2+
import getDisplayName from 'react-display-name'
33
import omit from 'just-omit'
44

55
const omitProps = (...propsToOmit) => (Target) => {
66
const OmitProps = (props) => createElement(Target, (omit(props, propsToOmit)))
77

88
if (process.env.NODE_ENV !== 'production') {
9-
return setDisplayName(wrapDisplayName(Target, 'omitProps'))(OmitProps)
9+
OmitProps.displayName = `omitProps(${getDisplayName(Target)})`
1010
}
1111

1212
return OmitProps

packages/prevent-handlers-default/package.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
"access": "public"
2626
},
2727
"peerDependencies": {
28-
"react": "^16.3.0",
29-
"recompose": "^0.27.0"
28+
"react": "^16.3.0"
29+
},
30+
"dependencies": {
31+
"react-display-name": "^0.2.4"
3032
}
3133
}

packages/prevent-handlers-default/readme.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Decouples [`e.preventDefault()`](https://developer.mozilla.org/en-US/docs/Web/AP
99
## Install
1010

1111
```
12-
yarn add recompose @hocs/prevent-handlers-default
12+
yarn add @hocs/prevent-handlers-default
1313
```
1414

1515
## Usage

packages/prevent-handlers-default/src/index.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { createElement, Component } from 'react'
2-
import { setDisplayName, wrapDisplayName } from 'recompose'
2+
import getDisplayName from 'react-display-name'
33

44
const preventHandlersDefault = (...handlers) => (Target) => {
55
class PreventHandlersDefault extends Component {
@@ -30,9 +30,7 @@ const preventHandlersDefault = (...handlers) => (Target) => {
3030
}
3131

3232
if (process.env.NODE_ENV !== 'production') {
33-
return setDisplayName(
34-
wrapDisplayName(Target, 'preventHandlersDefault')
35-
)(PreventHandlersDefault)
33+
PreventHandlersDefault.displayName = `preventHandlersDefault(${getDisplayName(Target)})`
3634
}
3735

3836
return PreventHandlersDefault

packages/safe-timers/package.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@
2828
"access": "public"
2929
},
3030
"peerDependencies": {
31-
"react": "^16.3.0",
32-
"recompose": "^0.27.0"
31+
"react": "^16.3.0"
32+
},
33+
"dependencies": {
34+
"react-display-name": "^0.2.4"
3335
}
3436
}

packages/safe-timers/readme.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Inspired by [react-timer-mixin](https://github.com/reactjs/react-timer-mixin).
1111
## Install
1212

1313
```
14-
yarn add recompose @hocs/safe-timers
14+
yarn add @hocs/safe-timers
1515
```
1616

1717
## Usage

packages/safe-timers/src/safeTimerFactory.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable max-params */
22
import { createElement, Component } from 'react'
3-
import { setDisplayName, wrapDisplayName } from 'recompose'
3+
import getDisplayName from 'react-display-name'
44

55
const safeTimerFactory = (setFn, clearFn, propName, hocName) => (Target) => {
66
class SafeTimer extends Component {
@@ -35,7 +35,7 @@ const safeTimerFactory = (setFn, clearFn, propName, hocName) => (Target) => {
3535
}
3636

3737
if (process.env.NODE_ENV !== 'production') {
38-
return setDisplayName(wrapDisplayName(Target, hocName))(SafeTimer)
38+
SafeTimer.displayName = `${hocName}(${getDisplayName(Target)})`
3939
}
4040

4141
return SafeTimer

packages/throttle-handler/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
"access": "public"
2626
},
2727
"dependencies": {
28-
"just-throttle": "^1.0.2"
28+
"just-throttle": "^1.0.2",
29+
"react-display-name": "^0.2.4"
2930
},
3031
"peerDependencies": {
31-
"react": "^16.3.0",
32-
"recompose": "^0.27.0"
32+
"react": "^16.3.0"
3333
}
3434
}

packages/throttle-handler/readme.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Helps to throttle handlers like `onChange`.
99
## Install
1010

1111
```
12-
yarn add recompose @hocs/throttle-handler
12+
yarn add @hocs/throttle-handler
1313
```
1414

1515
## Usage

packages/throttle-handler/src/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { createElement, Component } from 'react'
2-
import { setDisplayName, wrapDisplayName } from 'recompose'
2+
import getDisplayName from 'react-display-name'
33
import throttle from 'just-throttle'
44

55
const throttleHandler = (handlerName, interval, leadingCall) => (Target) => {
@@ -27,7 +27,7 @@ const throttleHandler = (handlerName, interval, leadingCall) => (Target) => {
2727
}
2828

2929
if (process.env.NODE_ENV !== 'production') {
30-
return setDisplayName(wrapDisplayName(Target, 'throttleHandler'))(ThrottleHandler)
30+
ThrottleHandler.displayName = `throttleHandler(${getDisplayName(Target)})`
3131
}
3232

3333
return ThrottleHandler

packages/with-callback-on-change-while/package.json

+3
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,8 @@
2727
"peerDependencies": {
2828
"react": "^16.3.0",
2929
"recompose": "^0.27.0"
30+
},
31+
"dependencies": {
32+
"react-display-name": "^0.2.4"
3033
}
3134
}

packages/with-callback-on-change-while/readme.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Invokes a callback on prop change while condition is true, useful to decouple si
99
## Install
1010

1111
```
12-
yarn add recompose @hocs/with-callback-on-change-while
12+
yarn add @hocs/with-callback-on-change-while
1313
```
1414

1515
## Usage

packages/with-callback-on-change-while/src/index.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { createElement, Component } from 'react'
2-
import { setDisplayName, wrapDisplayName } from 'recompose'
2+
import getDisplayName from 'react-display-name'
33

44
const withCallbackOnChangeWhile = (propName, shouldCall, callback) => (Target) => {
55
class WithCallbackOnChangeWhile extends Component {
@@ -25,9 +25,7 @@ const withCallbackOnChangeWhile = (propName, shouldCall, callback) => (Target) =
2525
}
2626

2727
if (process.env.NODE_ENV !== 'production') {
28-
return setDisplayName(
29-
wrapDisplayName(Target, 'withCallbackOnChangeWhile')
30-
)(WithCallbackOnChangeWhile)
28+
WithCallbackOnChangeWhile.displayName = `withCallbackOnChangeWhile(${getDisplayName(Target)})`
3129
}
3230

3331
return WithCallbackOnChangeWhile

packages/with-callback-on-change/package.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
"access": "public"
2626
},
2727
"peerDependencies": {
28-
"react": "^16.3.0",
29-
"recompose": "^0.27.0"
28+
"react": "^16.3.0"
29+
},
30+
"dependencies": {
31+
"react-display-name": "^0.2.4"
3032
}
3133
}

packages/with-callback-on-change/readme.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Invokes a callback on prop change, useful to decouple side effects like `onChang
99
## Install
1010

1111
```
12-
yarn add recompose @hocs/with-callback-on-change
12+
yarn add @hocs/with-callback-on-change
1313
```
1414

1515
## Usage

packages/with-callback-on-change/src/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { createElement, Component } from 'react'
2-
import { setDisplayName, wrapDisplayName } from 'recompose'
2+
import getDisplayName from 'react-display-name'
33

44
const withCallbackOnChange = (propName, callback) => (Target) => {
55
class WithCallbackOnChange extends Component {
@@ -25,7 +25,7 @@ const withCallbackOnChange = (propName, callback) => (Target) => {
2525
}
2626

2727
if (process.env.NODE_ENV !== 'production') {
28-
return setDisplayName(wrapDisplayName(Target, 'withCallbackOnChange'))(WithCallbackOnChange)
28+
WithCallbackOnChange.displayName = `withCallbackOnChange(${getDisplayName(Target)})`
2929
}
3030

3131
return WithCallbackOnChange

packages/with-callback-once/package.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
"access": "public"
2626
},
2727
"peerDependencies": {
28-
"react": "^16.3.0",
29-
"recompose": "^0.27.0"
28+
"react": "^16.3.0"
29+
},
30+
"dependencies": {
31+
"react-display-name": "^0.2.4"
3032
}
3133
}

packages/with-callback-once/readme.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Invokes a callback once condition is true (while previous check was false), usef
99
## Install
1010

1111
```
12-
yarn add recompose @hocs/with-callback-once
12+
yarn add @hocs/with-callback-once
1313
```
1414

1515
## Usage

packages/with-callback-once/src/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { createElement, Component } from 'react'
2-
import { setDisplayName, wrapDisplayName } from 'recompose'
2+
import getDisplayName from 'react-display-name'
33

44
const withCallbackOnce = (shouldCall, callback) => (Target) => {
55
class WithCallbackOnce extends Component {
@@ -27,7 +27,7 @@ const withCallbackOnce = (shouldCall, callback) => (Target) => {
2727
}
2828

2929
if (process.env.NODE_ENV !== 'production') {
30-
return setDisplayName(wrapDisplayName(Target, 'withCallbackOnce'))(WithCallbackOnce)
30+
WithCallbackOnce.displayName = `withCallbackOnce(${getDisplayName(Target)})`
3131
}
3232

3333
return WithCallbackOnce

packages/with-debugger/package.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626
"access": "public"
2727
},
2828
"peerDependencies": {
29-
"react": "^16.3.0",
30-
"recompose": "^0.27.0"
29+
"react": "^16.3.0"
30+
},
31+
"dependencies": {
32+
"react-display-name": "^0.2.4"
3133
}
3234
}

packages/with-debugger/readme.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Injects `debugger` into render.
99
## Install
1010

1111
```
12-
yarn add recompose @hocs/with-debugger
12+
yarn add @hocs/with-debugger
1313
```
1414

1515
## Usage

packages/with-debugger/src/index.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable no-debugger */
22
import { createElement } from 'react'
3-
import { setDisplayName, wrapDisplayName } from 'recompose'
3+
import getDisplayName from 'react-display-name'
44

55
const withDebugger = (Target) => {
66
if (process.env.NODE_ENV === 'production') {
@@ -13,7 +13,9 @@ const withDebugger = (Target) => {
1313
return createElement(Target, props)
1414
}
1515

16-
return setDisplayName(wrapDisplayName(Target, 'withDebugger'))(WithDebugger)
16+
WithDebugger.displayName = `withDebugger(${getDisplayName(Target)})`
17+
18+
return WithDebugger
1719
}
1820

1921
export default withDebugger

packages/with-intersection-observer-props/package.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,12 @@
2424
"access": "public"
2525
},
2626
"peerDependencies": {
27-
"react": "^16.3.0",
28-
"recompose": "^0.27.0"
27+
"react": "^16.3.0"
2928
},
3029
"devDependencies": {
3130
"intersection-observer": "^0.5.0"
31+
},
32+
"dependencies": {
33+
"react-display-name": "^0.2.4"
3234
}
3335
}

packages/with-intersection-observer-props/readme.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Dynamically map visibility of a component to boolean props using [Intersection O
99
## Install
1010

1111
```
12-
yarn add recompose @hocs/with-intersection-observer-props
12+
yarn add @hocs/with-intersection-observer-props
1313
```
1414

1515
## Usage

packages/with-intersection-observer-props/src/index.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { createElement, Component } from 'react'
2-
import { setDisplayName, wrapDisplayName } from 'recompose'
2+
import getDisplayName from 'react-display-name'
33

44
const isIntersectionObserverSupported = typeof global.IntersectionObserver === 'function'
55

@@ -59,9 +59,7 @@ const withIntersectionObserverProps = (thresholds, options, onRefName = 'onRef')
5959
}
6060

6161
if (process.env.NODE_ENV !== 'production') {
62-
return setDisplayName(
63-
wrapDisplayName(Target, 'withIntersectionObserverProps')
64-
)(WithIntersectionObserverProps)
62+
WithIntersectionObserverProps.displayName = `withIntersectionObserverProps(${getDisplayName(Target)})`
6563
}
6664

6765
return WithIntersectionObserverProps

packages/with-lifecycle/package.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
"access": "public"
2626
},
2727
"peerDependencies": {
28-
"react": "^16.3.0",
29-
"recompose": "^0.27.0"
28+
"react": "^16.3.0"
29+
},
30+
"dependencies": {
31+
"react-display-name": "^0.2.4"
3032
}
3133
}

0 commit comments

Comments
 (0)