Skip to content

Commit

Permalink
Undeprecate numbered hooks for a smoother upgrading experience (#109)
Browse files Browse the repository at this point in the history
* Set version to 0.12.1

* Deactivate uncurried mode to prevent formatter from removing uncurried dots

* Undeprecate numbered hooks for a smoother upgrading experience
  • Loading branch information
fhammerschmidt authored Feb 9, 2024
1 parent a8a4a2f commit bc0d138
Show file tree
Hide file tree
Showing 7 changed files with 90 additions and 109 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
> - :house: [Internal]
> - :nail_care: [Polish]
## 0.12.1

- Undeprecate numbered hooks for a smoother upgrading experience.

## 0.12.0

- Requires ReScript 11.0.0 or newer.
Expand Down
3 changes: 2 additions & 1 deletion bsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
"package-specs": [{ "module": "commonjs", "in-source": true }],
"suffix": ".bs.js",
"bs-dev-dependencies": [],
"bsc-flags": []
"bsc-flags": [],
"uncurried": false
}
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rescript/react",
"version": "0.12.0",
"version": "0.12.1",
"description": "React bindings for ReScript",
"files": [
"README.md",
Expand Down
96 changes: 40 additions & 56 deletions src/React.res
Original file line number Diff line number Diff line change
Expand Up @@ -160,25 +160,25 @@ external useReducerWithMapState: (
external useEffectOnEveryRender: (@uncurry (unit => option<unit => unit>)) => unit = "useEffect"
@module("react")
external useEffect: (@uncurry (unit => option<unit => unit>), 'deps) => unit = "useEffect"
@module("react") @deprecated("Please use useEffect or useEffectOnEveryRender instead")
@module("react")
external useEffect0: (@uncurry (unit => option<unit => unit>), @as(json`[]`) _) => unit =
"useEffect"
@module("react") @deprecated("Please use useEffect or useEffectOnEveryRender instead")
@module("react")
external useEffect1: (@uncurry (unit => option<unit => unit>), array<'a>) => unit = "useEffect"
@module("react") @deprecated("Please use useEffect or useEffectOnEveryRender instead")
@module("react")
external useEffect2: (@uncurry (unit => option<unit => unit>), ('a, 'b)) => unit = "useEffect"
@module("react") @deprecated("Please use useEffect or useEffectOnEveryRender instead")
@module("react")
external useEffect3: (@uncurry (unit => option<unit => unit>), ('a, 'b, 'c)) => unit = "useEffect"
@module("react") @deprecated("Please use useEffect or useEffectOnEveryRender instead")
@module("react")
external useEffect4: (@uncurry (unit => option<unit => unit>), ('a, 'b, 'c, 'd)) => unit =
"useEffect"
@module("react") @deprecated("Please use useEffect or useEffectOnEveryRender instead")
@module("react")
external useEffect5: (@uncurry (unit => option<unit => unit>), ('a, 'b, 'c, 'd, 'e)) => unit =
"useEffect"
@module("react") @deprecated("Please use useEffect or useEffectOnEveryRender instead")
@module("react")
external useEffect6: (@uncurry (unit => option<unit => unit>), ('a, 'b, 'c, 'd, 'e, 'f)) => unit =
"useEffect"
@module("react") @deprecated("Please use useEffect or useEffectOnEveryRender instead")
@module("react")
external useEffect7: (
@uncurry (unit => option<unit => unit>),
('a, 'b, 'c, 'd, 'e, 'f, 'g),
Expand All @@ -190,30 +190,30 @@ external useLayoutEffectOnEveryRender: (@uncurry (unit => option<unit => unit>))
@module("react")
external useLayoutEffect: (@uncurry (unit => option<unit => unit>), 'deps) => unit =
"useLayoutEffect"
@module("react") @deprecated("Please use useLayoutEffect or useLayoutEffectOnEveryRender instead")
@module("react")
external useLayoutEffect0: (@uncurry (unit => option<unit => unit>), @as(json`[]`) _) => unit =
"useLayoutEffect"
@module("react") @deprecated("Please use useLayoutEffect or useLayoutEffectOnEveryRender instead")
@module("react")
external useLayoutEffect1: (@uncurry (unit => option<unit => unit>), array<'a>) => unit =
"useLayoutEffect"
@module("react") @deprecated("Please use useLayoutEffect or useLayoutEffectOnEveryRender instead")
@module("react")
external useLayoutEffect2: (@uncurry (unit => option<unit => unit>), ('a, 'b)) => unit =
"useLayoutEffect"
@module("react") @deprecated("Please use useLayoutEffect or useLayoutEffectOnEveryRender instead")
@module("react")
external useLayoutEffect3: (@uncurry (unit => option<unit => unit>), ('a, 'b, 'c)) => unit =
"useLayoutEffect"
@module("react") @deprecated("Please use useLayoutEffect or useLayoutEffectOnEveryRender instead")
@module("react")
external useLayoutEffect4: (@uncurry (unit => option<unit => unit>), ('a, 'b, 'c, 'd)) => unit =
"useLayoutEffect"
@module("react") @deprecated("Please use useLayoutEffect or useLayoutEffectOnEveryRender instead")
@module("react")
external useLayoutEffect5: (@uncurry (unit => option<unit => unit>), ('a, 'b, 'c, 'd, 'e)) => unit =
"useLayoutEffect"
@module("react") @deprecated("Please use useLayoutEffect or useLayoutEffectOnEveryRender instead")
@module("react")
external useLayoutEffect6: (
@uncurry (unit => option<unit => unit>),
('a, 'b, 'c, 'd, 'e, 'f),
) => unit = "useLayoutEffect"
@module("react") @deprecated("Please use useLayoutEffect or useLayoutEffectOnEveryRender instead")
@module("react")
external useLayoutEffect7: (
@uncurry (unit => option<unit => unit>),
('a, 'b, 'c, 'd, 'e, 'f, 'g),
Expand All @@ -222,55 +222,55 @@ external useLayoutEffect7: (
@module("react")
external useMemo: (@uncurry (unit => 'any), 'deps) => 'any = "useMemo"

@module("react") @deprecated("Please use useMemo instead")
@module("react")
external useMemo0: (@uncurry (unit => 'any), @as(json`[]`) _) => 'any = "useMemo"

@module("react") @deprecated("Please use useMemo instead")
@module("react")
external useMemo1: (@uncurry (unit => 'any), array<'a>) => 'any = "useMemo"

@module("react") @deprecated("Please use useMemo instead")
@module("react")
external useMemo2: (@uncurry (unit => 'any), ('a, 'b)) => 'any = "useMemo"

@module("react") @deprecated("Please use useMemo instead")
@module("react")
external useMemo3: (@uncurry (unit => 'any), ('a, 'b, 'c)) => 'any = "useMemo"

@module("react") @deprecated("Please use useMemo instead")
@module("react")
external useMemo4: (@uncurry (unit => 'any), ('a, 'b, 'c, 'd)) => 'any = "useMemo"

@module("react") @deprecated("Please use useMemo instead")
@module("react")
external useMemo5: (@uncurry (unit => 'any), ('a, 'b, 'c, 'd, 'e)) => 'any = "useMemo"

@module("react") @deprecated("Please use useMemo instead")
@module("react")
external useMemo6: (@uncurry (unit => 'any), ('a, 'b, 'c, 'd, 'e, 'f)) => 'any = "useMemo"

@module("react") @deprecated("Please use useMemo instead")
@module("react")
external useMemo7: (@uncurry (unit => 'any), ('a, 'b, 'c, 'd, 'e, 'f, 'g)) => 'any = "useMemo"

@module("react")
external useCallback: ('f, 'deps) => 'f = "useCallback"

@module("react") @deprecated("Please use useCallback instead")
@module("react")
external useCallback0: ('f, @as(json`[]`) _) => 'f = "useCallback"

@module("react") @deprecated("Please use useCallback instead")
@module("react")
external useCallback1: ('f, array<'a>) => 'f = "useCallback"

@module("react") @deprecated("Please use useCallback instead")
@module("react")
external useCallback2: ('f, ('a, 'b)) => 'f = "useCallback"

@module("react") @deprecated("Please use useCallback instead")
@module("react")
external useCallback3: ('f, ('a, 'b, 'c)) => 'f = "useCallback"

@module("react") @deprecated("Please use useCallback instead")
@module("react")
external useCallback4: ('f, ('a, 'b, 'c, 'd)) => 'f = "useCallback"

@module("react") @deprecated("Please use useCallback instead")
@module("react")
external useCallback5: ('f, ('a, 'b, 'c, 'd, 'e)) => 'f = "useCallback"

@module("react") @deprecated("Please use useCallback instead")
@module("react")
external useCallback6: ('callback, ('a, 'b, 'c, 'd, 'e, 'f)) => 'callback = "useCallback"

@module("react") @deprecated("Please use useCallback instead")
@module("react")
external useCallback7: ('callback, ('a, 'b, 'c, 'd, 'e, 'f, 'g)) => 'callback = "useCallback"

@module("react")
Expand All @@ -292,63 +292,55 @@ external useImperativeHandle: (
) => unit = "useImperativeHandle"

@module("react")
@deprecated("Please use useImperativeHandle or useImperativeHandleOnEveryRender instead")
external useImperativeHandle0: (
Js.Nullable.t<ref<'value>>,
@uncurry (unit => 'value),
@as(json`[]`) _,
) => unit = "useImperativeHandle"

@module("react")
@deprecated("Please use useImperativeHandle or useImperativeHandleOnEveryRender instead")
external useImperativeHandle1: (
Js.Nullable.t<ref<'value>>,
@uncurry (unit => 'value),
array<'a>,
) => unit = "useImperativeHandle"

@module("react")
@deprecated("Please use useImperativeHandle or useImperativeHandleOnEveryRender instead")
external useImperativeHandle2: (
Js.Nullable.t<ref<'value>>,
@uncurry (unit => 'value),
('a, 'b),
) => unit = "useImperativeHandle"

@module("react")
@deprecated("Please use useImperativeHandle or useImperativeHandleOnEveryRender instead")
external useImperativeHandle3: (
Js.Nullable.t<ref<'value>>,
@uncurry (unit => 'value),
('a, 'b, 'c),
) => unit = "useImperativeHandle"

@module("react")
@deprecated("Please use useImperativeHandle or useImperativeHandleOnEveryRender instead")
external useImperativeHandle4: (
Js.Nullable.t<ref<'value>>,
@uncurry (unit => 'value),
('a, 'b, 'c, 'd),
) => unit = "useImperativeHandle"

@module("react")
@deprecated("Please use useImperativeHandle or useImperativeHandleOnEveryRender instead")
external useImperativeHandle5: (
Js.Nullable.t<ref<'value>>,
@uncurry (unit => 'value),
('a, 'b, 'c, 'd, 'e),
) => unit = "useImperativeHandle"

@module("react")
@deprecated("Please use useImperativeHandle or useImperativeHandleOnEveryRender instead")
external useImperativeHandle6: (
Js.Nullable.t<ref<'value>>,
@uncurry (unit => 'value),
('a, 'b, 'c, 'd, 'e, 'f),
) => unit = "useImperativeHandle"

@module("react")
@deprecated("Please use useImperativeHandle or useImperativeHandleOnEveryRender instead")
external useImperativeHandle7: (
Js.Nullable.t<ref<'value>>,
@uncurry (unit => 'value),
Expand All @@ -369,39 +361,31 @@ external useInsertionEffectOnEveryRender: (@uncurry (unit => option<unit => unit
external useInsertionEffect: (@uncurry (unit => option<unit => unit>), 'deps) => unit =
"useInsertionEffect"
@module("react")
@deprecated("Please use useInsertionEffect or useInsertionEffectOnEveryRender instead")
external useInsertionEffect0: (@uncurry (unit => option<unit => unit>), @as(json`[]`) _) => unit =
"useInsertionEffect"
@module("react")
@deprecated("Please use useInsertionEffect or useInsertionEffectOnEveryRender instead")
external useInsertionEffect1: (@uncurry (unit => option<unit => unit>), array<'a>) => unit =
"useInsertionEffect"
@module("react")
@deprecated("Please use useInsertionEffect or useInsertionEffectOnEveryRender instead")
external useInsertionEffect2: (@uncurry (unit => option<unit => unit>), ('a, 'b)) => unit =
"useInsertionEffect"
@module("react")
@deprecated("Please use useInsertionEffect or useInsertionEffectOnEveryRender instead")
external useInsertionEffect3: (@uncurry (unit => option<unit => unit>), ('a, 'b, 'c)) => unit =
"useInsertionEffect"
@module("react")
@deprecated("Please use useInsertionEffect or useInsertionEffectOnEveryRender instead")
external useInsertionEffect4: (@uncurry (unit => option<unit => unit>), ('a, 'b, 'c, 'd)) => unit =
"useInsertionEffect"
@module("react")
@deprecated("Please use useInsertionEffect or useInsertionEffectOnEveryRender instead")
external useInsertionEffect5: (
@uncurry (unit => option<unit => unit>),
('a, 'b, 'c, 'd, 'e),
) => unit = "useInsertionEffect"
@module("react")
@deprecated("Please use useInsertionEffect or useInsertionEffectOnEveryRender instead")
external useInsertionEffect6: (
@uncurry (unit => option<unit => unit>),
('a, 'b, 'c, 'd, 'e, 'f),
) => unit = "useInsertionEffect"
@module("react")
@deprecated("Please use useInsertionEffect or useInsertionEffectOnEveryRender instead")
external useInsertionEffect7: (
@uncurry (unit => option<unit => unit>),
('a, 'b, 'c, 'd, 'e, 'f, 'g),
Expand Down Expand Up @@ -441,28 +425,28 @@ module Uncurried = {
@module("react")
external useCallback: ('f, 'deps) => 'f = "useCallback"

@module("react") @deprecated("Please use useCallback instead")
@module("react")
external useCallback0: ('f, @as(json`[]`) _) => 'f = "useCallback"

@module("react") @deprecated("Please use useCallback instead")
@module("react")
external useCallback1: ('f, array<'a>) => 'f = "useCallback"

@module("react") @deprecated("Please use useCallback instead")
@module("react")
external useCallback2: ('f, ('a, 'b)) => 'f = "useCallback"

@module("react") @deprecated("Please use useCallback instead")
@module("react")
external useCallback3: ('f, ('a, 'b, 'c)) => 'f = "useCallback"

@module("react") @deprecated("Please use useCallback instead")
@module("react")
external useCallback4: ('f, ('a, 'b, 'c, 'd)) => 'f = "useCallback"

@module("react") @deprecated("Please use useCallback instead")
@module("react")
external useCallback5: ('f, ('a, 'b, 'c, 'd, 'e)) => 'f = "useCallback"

@module("react") @deprecated("Please use useCallback instead")
@module("react")
external useCallback6: ('callback, ('a, 'b, 'c, 'd, 'e, 'f)) => 'callback = "useCallback"

@module("react") @deprecated("Please use useCallback instead")
@module("react")
external useCallback7: ('callback, ('a, 'b, 'c, 'd, 'e, 'f, 'g)) => 'callback = "useCallback"
}

Expand Down
2 changes: 1 addition & 1 deletion src/RescriptReactRouter.bs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit bc0d138

Please sign in to comment.