Skip to content

Commit 16dcbd8

Browse files
tom-shermanrickyvetter
authored andcommitted
Update rescript and apply formatting
1 parent c3017ec commit 16dcbd8

8 files changed

+400
-411
lines changed

package-lock.json

Lines changed: 40 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
"src/**/*.resi"
1212
],
1313
"scripts": {
14-
"build": "bsb -make-world",
15-
"start": "bsb -make-world -w",
16-
"clean": "bsb -clean-world",
14+
"build": "rescript build",
15+
"start": "rescript build -w",
16+
"clean": "rescript clean -with-deps",
1717
"test": "echo 'tests disabled for now'"
1818
},
1919
"keywords": [
@@ -28,11 +28,11 @@
2828
},
2929
"homepage": "https://rescript-lang.org/docs/react/latest/introduction",
3030
"devDependencies": {
31-
"bs-platform": "8.3.0",
3231
"jest": "^26.0.1",
3332
"react": "^16.8.1",
3433
"react-dom": "^16.8.1",
35-
"reason-test-framework": "^0.3.2"
34+
"reason-test-framework": "^0.3.2",
35+
"rescript": "^9.1.4"
3636
},
3737
"peerDependencies": {
3838
"react": ">=16.8.1",

src/React.res

Lines changed: 17 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,8 @@ module Context = {
8888
external createContext: 'a => Context.t<'a> = "createContext"
8989

9090
@module("react")
91-
external forwardRef: (@uncurry ('props, Js.Nullable.t<ref<'a>>) => element) => component<
92-
'props,
93-
> = "forwardRef"
91+
external forwardRef: (@uncurry ('props, Js.Nullable.t<ref<'a>>) => element) => component<'props> =
92+
"forwardRef"
9493

9594
@module("react")
9695
external memo: component<'props> => component<'props> = "memo"
@@ -165,14 +164,11 @@ module Experimental = {
165164
* only way to safely have any type of state and be able to update it correctly.
166165
*/
167166
@module("react")
168-
external useState: (@uncurry (unit => 'state)) => ('state, ('state => 'state) => unit) =
169-
"useState"
167+
external useState: (@uncurry (unit => 'state)) => ('state, ('state => 'state) => unit) = "useState"
170168

171169
@module("react")
172-
external useReducer: (
173-
@uncurry ('state, 'action) => 'state,
174-
'state,
175-
) => ('state, 'action => unit) = "useReducer"
170+
external useReducer: (@uncurry ('state, 'action) => 'state, 'state) => ('state, 'action => unit) =
171+
"useReducer"
176172

177173
@module("react")
178174
external useReducerWithMapState: (
@@ -191,19 +187,16 @@ external useEffect1: (@uncurry (unit => option<unit => unit>), array<'a>) => uni
191187
@module("react")
192188
external useEffect2: (@uncurry (unit => option<unit => unit>), ('a, 'b)) => unit = "useEffect"
193189
@module("react")
194-
external useEffect3: (@uncurry (unit => option<unit => unit>), ('a, 'b, 'c)) => unit =
195-
"useEffect"
190+
external useEffect3: (@uncurry (unit => option<unit => unit>), ('a, 'b, 'c)) => unit = "useEffect"
196191
@module("react")
197192
external useEffect4: (@uncurry (unit => option<unit => unit>), ('a, 'b, 'c, 'd)) => unit =
198193
"useEffect"
199194
@module("react")
200195
external useEffect5: (@uncurry (unit => option<unit => unit>), ('a, 'b, 'c, 'd, 'e)) => unit =
201196
"useEffect"
202197
@module("react")
203-
external useEffect6: (
204-
@uncurry (unit => option<unit => unit>),
205-
('a, 'b, 'c, 'd, 'e, 'f),
206-
) => unit = "useEffect"
198+
external useEffect6: (@uncurry (unit => option<unit => unit>), ('a, 'b, 'c, 'd, 'e, 'f)) => unit =
199+
"useEffect"
207200
@module("react")
208201
external useEffect7: (
209202
@uncurry (unit => option<unit => unit>),
@@ -213,10 +206,8 @@ external useEffect7: (
213206
@module("react")
214207
external useLayoutEffect: (@uncurry (unit => option<unit => unit>)) => unit = "useLayoutEffect"
215208
@module("react")
216-
external useLayoutEffect0: (
217-
@uncurry (unit => option<unit => unit>),
218-
@as(json`[]`) _,
219-
) => unit = "useLayoutEffect"
209+
external useLayoutEffect0: (@uncurry (unit => option<unit => unit>), @as(json`[]`) _) => unit =
210+
"useLayoutEffect"
220211
@module("react")
221212
external useLayoutEffect1: (@uncurry (unit => option<unit => unit>), array<'a>) => unit =
222213
"useLayoutEffect"
@@ -230,10 +221,8 @@ external useLayoutEffect3: (@uncurry (unit => option<unit => unit>), ('a, 'b, 'c
230221
external useLayoutEffect4: (@uncurry (unit => option<unit => unit>), ('a, 'b, 'c, 'd)) => unit =
231222
"useLayoutEffect"
232223
@module("react")
233-
external useLayoutEffect5: (
234-
@uncurry (unit => option<unit => unit>),
235-
('a, 'b, 'c, 'd, 'e),
236-
) => unit = "useLayoutEffect"
224+
external useLayoutEffect5: (@uncurry (unit => option<unit => unit>), ('a, 'b, 'c, 'd, 'e)) => unit =
225+
"useLayoutEffect"
237226
@module("react")
238227
external useLayoutEffect6: (
239228
@uncurry (unit => option<unit => unit>),
@@ -293,10 +282,8 @@ external useCallback2: (@uncurry ('input => 'output), ('a, 'b)) => callback<'inp
293282
"useCallback"
294283

295284
@module("react")
296-
external useCallback3: (
297-
@uncurry ('input => 'output),
298-
('a, 'b, 'c),
299-
) => callback<'input, 'output> = "useCallback"
285+
external useCallback3: (@uncurry ('input => 'output), ('a, 'b, 'c)) => callback<'input, 'output> =
286+
"useCallback"
300287

301288
@module("react")
302289
external useCallback4: (
@@ -404,8 +391,7 @@ module Uncurried = {
404391
type callback<'input, 'output> = (. 'input) => 'output
405392

406393
@module("react")
407-
external useCallback: (@uncurry ('input => 'output)) => callback<'input, 'output> =
408-
"useCallback"
394+
external useCallback: (@uncurry ('input => 'output)) => callback<'input, 'output> = "useCallback"
409395

410396
@module("react")
411397
external useCallback0: (
@@ -422,10 +408,8 @@ module Uncurried = {
422408
"useCallback"
423409

424410
@module("react")
425-
external useCallback3: (
426-
@uncurry ('input => 'output),
427-
('a, 'b, 'c),
428-
) => callback<'input, 'output> = "useCallback"
411+
external useCallback3: (@uncurry ('input => 'output), ('a, 'b, 'c)) => callback<'input, 'output> =
412+
"useCallback"
429413

430414
@module("react")
431415
external useCallback4: (

0 commit comments

Comments
 (0)